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

Field trees #492

Merged
merged 4 commits into from
Mar 15, 2024
Merged

Field trees #492

merged 4 commits into from
Mar 15, 2024

Conversation

milankl
Copy link
Member

@milankl milankl commented Mar 14, 2024

One can now do

julia> tree(simulation)
Simulation{PrimitiveWetModel}
├┐prognostic_variables
│├ trunc
│├ nlat_half
│├ nlev
│├ n_steps
│├┐layers
││└┐timesteps
││ ├ trunc
││ ├ vor
││ ├ div
││ ├ temp
││ └ humid
│├┐surface
││└┐timesteps
││ ├ trunc
││ └ pres
│├┐ocean
││├ nlat_half
││├ time
││├ sea_surface_temperature
││└ sea_ice_concentration
│├┐land
││├ nlat_half
││├ time
││├ land_surface_temperature
...

to get a full field tree (a tree of all fields and their fields as long as they are defined in SpeedyWeather) printed. It's convenient to visualise nested structs. Also added to the docs to have that automatically documented.

@natgeo-wong this is a first step towards "a more detailed explanation of modules" by which I think you mean the components of a SpeedyWeather simulation (avoiding the term "module" because of its use in Julia)

@milankl milankl added documentation 📚 Improvements or additions to documentation structure 🏠 Internal structure of the code labels Mar 14, 2024
@milankl milankl requested a review from navidcy March 14, 2024 22:12
docs/src/structure.md Outdated Show resolved Hide resolved
@milankl milankl merged commit 82af49c into main Mar 15, 2024
3 checks passed
@milankl milankl deleted the mk/struct_graph branch March 20, 2024 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation 📚 Improvements or additions to documentation structure 🏠 Internal structure of the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants