Skip to content

Updating documentation of static models on config page.#702

Merged
vgro merged 64 commits intodevelopfrom
686-documentation-for-static-model
Jul 3, 2025
Merged

Updating documentation of static models on config page.#702
vgro merged 64 commits intodevelopfrom
686-documentation-for-static-model

Conversation

@sallymatson
Copy link
Copy Markdown
Collaborator

@sallymatson sallymatson commented Jan 28, 2025

Description

Documentation update for the static model.

The overview is built here and the example is built here.

A few notes:

  • The config files are built programmatically, assuming that the combination of models in the example does not change. The code can be viewed if wanted.
  • The path setting is still not universal for as os but I have added a note about that at the start.
  • I collapsed the output of ve_run so it does not clutter the documentation, and I also collapsed the code for the plots.

@sallymatson I cannot add you as a reviewer, please feel free to comment :-)

Fixes #686

Type of change

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)

Key checklist

  • Make sure you've run the pre-commit checks: $ pre-commit run -a

@sallymatson sallymatson requested a review from vgro January 28, 2025 09:07
@sallymatson sallymatson linked an issue Jan 28, 2025 that may be closed by this pull request
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 28, 2025

Codecov Report

❌ Patch coverage is 91.00529% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.89%. Comparing base (2c08828) to head (f7c8ac3).
⚠️ Report is 1925 commits behind head on develop.

Files with missing lines Patch % Lines
virtual_ecosystem/models/animal/animal_cohorts.py 66.66% 5 Missing ⚠️
virtual_ecosystem/models/testing/testing_model.py 75.00% 5 Missing ⚠️
virtual_ecosystem/models/abiotic/energy_balance.py 92.68% 3 Missing ⚠️
virtual_ecosystem/models/abiotic/microclimate.py 92.85% 3 Missing ⚠️
virtual_ecosystem/models/plants/plants_model.py 95.83% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #702      +/-   ##
===========================================
- Coverage    93.96%   93.89%   -0.07%     
===========================================
  Files           75       77       +2     
  Lines         5828     5912      +84     
===========================================
+ Hits          5476     5551      +75     
- Misses         352      361       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vgro
Copy link
Copy Markdown
Collaborator

vgro commented Feb 5, 2025

@sallymatson I put together some ideas for an example, please let me know if you think this makes sense and I can create the new input file and add the plotting bits. I'll fix the numbering item issue.

@sallymatson
Copy link
Copy Markdown
Collaborator Author

@sallymatson I put together some ideas for an example, please let me know if you think this makes sense and I can create the new input file and add the plotting bits. I'll fix the numbering item issue.

I think it's a great approach!! I think it would be helpful for us to figure out the best way to "name" the two approaches because then we can use them in the documentation (on the config page that I've been working on) and here, so that users can quickly understand how the two documents relate to eachother. Otherwise, I think it's clear and thorough !!

@vgro
Copy link
Copy Markdown
Collaborator

vgro commented Mar 7, 2025

@sallymatson I updated the example to make it a bit simpler and focus only on the static setting that starts from scratch for now, not the option to provide all the variables at the start (I think it was a bit confusing and might be better in a separate example, for instance an experiment 3).
My question is do you know how to make changes to the config files in the notebook, or no we need to somehow provide the alternative config files with the example?

@sallymatson
Copy link
Copy Markdown
Collaborator Author

@sallymatson I updated the example to make it a bit simpler and focus only on the static setting that starts from scratch for now, not the option to provide all the variables at the start (I think it was a bit confusing and might be better in a separate example, for instance an experiment 3). My question is do you know how to make changes to the config files in the notebook, or no we need to somehow provide the alternative config files with the example?

I think that we would need to create a separate example config for the run. If we load the config first, then we could so something like this like I just did for some testing in the plants model:

fixture_config["plants"]["constants"] = {"PlantsConsts": {"leaf_lignin": 100.0}}

Or, you could open the file in the jupyter notebook and edit it (and just explain that this code does not need to be copied.) But I generally think it would be easier and better practice to have its own config, especially since we wouldn't then know if the config changed for other reasons, if it would impact this tutorial.

Does that make sense? If you want to upload the example you have and then I can play around with the config, happy to help more!!

@vgro vgro requested review from arne-exe and davidorme June 18, 2025 13:57
@vgro vgro marked this pull request as ready for review June 18, 2025 13:57
@davidorme davidorme mentioned this pull request Jun 18, 2025
8 tasks
Copy link
Copy Markdown
Collaborator

@davidorme davidorme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good. I've suggested a few changes:

  • Some technical changes to the setup of the worked example (not using the toml package, syntax and hiding the programmatic config creation).

    I ran those changes locally to check I wasn't breaking it, so have a commit I can push if those sound sensible. Let me know if you want me to do that.

  • Some styling suggestions for accessibility and tweaks to wording.

  • I think the overview of static mode is a little hard hitting. Again - I have a revised version which I'm happy to push if that is ok.

[example instructions](./virtual_ecosystem_in_use.md) to familiarise yourself with the
setup.

```{code-cell} ipython3
Copy link
Copy Markdown
Collaborator

@davidorme davidorme Jun 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```{code-cell} ipython3
```{code-cell} bash

Here and elsewhere, these cells should not be styled as python.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh bugger. We can't do this, because our use of jupytext dictates a single {code-cell} language and it automatically enforces this. See mwouts/jupytext#1267 (comment)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all the relevant information is here but it goes in hard with technical details and repeats quite a lot - I think it would be easier to follow if it builds up a bit more from first principles.

@davidorme
Copy link
Copy Markdown
Collaborator

davidorme commented Jun 19, 2025

@vgro and @sallymatson I've pushed my suggestions to a new PR subbranch off this one #905 and asked for a review.

Copy link
Copy Markdown
Collaborator

@arne-exe arne-exe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @vgro, a very nice applied example of how to run the model in static mode. I only had suggestions in 2 places where you repeated the same words.

@vgro vgro requested a review from davidorme July 1, 2025 13:01
Copy link
Copy Markdown
Collaborator

@davidorme davidorme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vgro vgro merged commit 31cb58d into develop Jul 3, 2025
16 checks passed
@vgro vgro deleted the 686-documentation-for-static-model branch July 3, 2025 08:54
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.

Documentation for static model

5 participants