Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check optional sections in TOML file #546

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Conversation

vers-w
Copy link
Collaborator

@vers-w vers-w commented Feb 5, 2025

Optional TOML sections: time and logging.

@vers-w vers-w marked this pull request as draft February 6, 2025 19:36
@vers-w vers-w changed the title Check optional logging setting in TOML file Check optional sections in TOML file Feb 6, 2025
@visr
Copy link
Member

visr commented Feb 7, 2025

Ah I guess this will fix the build on TeamCity:

  [ Info: Simulation duration: 40 seconds, 577 milliseconds
05:17:35   ┌ Info: Write output states to netCDF file
05:17:35   └ /opt/teamcityagent/work/46377fba7f56e004/test/data/output/outstates-moselle.nc.
05:17:38   ERROR: LoadError: KeyError: key "logging" not found
05:17:38   Stacktrace:
05:17:38    [1] getindex
05:17:38      @ ./dict.jl:477 [inlined]
05:17:38    [2] getproperty(config::Wflow.Config, f::Symbol)
05:17:38      @ Wflow /opt/teamcityagent/work/46377fba7f56e004/src/io.jl:51
05:17:38    [3] run(tomlpath::String; silent::Nothing)
05:17:38      @ Wflow /opt/teamcityagent/work/46377fba7f56e004/src/Wflow.jl:218
05:17:38    [4] run(tomlpath::String)
05:17:38      @ Wflow /opt/teamcityagent/work/46377fba7f56e004/src/Wflow.jl:214
05:17:38    [5] top-level scope
05:17:38      @ /opt/teamcityagent/work/46377fba7f56e004/build/create_binaries/precompile.jl:10
05:17:38   in expression starting at /opt/teamcityagent/work/46377fba7f56e004/build/create_binaries/precompile.jl:10

@JoostBuitink
Copy link
Contributor

As briefly discussed yesterday, perhaps (if possible) it is nicer to fix this in the Config function, such that the following approach would also work

using Wflow
config = Wflow.Config(toml_fn)
Wflow.run(config)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants