ImperialCollegeLondon / virtual_ecosystem

This repository is the home for the codebase for the Virtual Ecosystem project.
https://virtual-ecosystem.readthedocs.io
BSD 3-Clause "New" or "Revised" License
9 stars 1 forks source link

ve_run on example does not output initial_state.nc #544

Closed hrlai closed 6 days ago

hrlai commented 1 week ago

When I try to following the example tutorial, ve_run finishes:

Starting Virtual Ecosystem simulation.
* Logging to: ve_example\out\logfile.log
* Loading configuration
* Saved compiled configuration: ve_example\out\vr_full_model_configuration.toml
* Built core model components
* Initial data loaded
* Models initialised: animals, plants, litter, hydrology, abiotic_simple, soil
* Starting simulation
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 24/24 [00:04<00:00,  5.34it/s] 
* Simulation completed
* Merged time series data
* Saved final model state
Virtual Ecosystem run complete.

But it did not save the initial_state.nc file to the out directory. My out folder only contains:

out\.gitignore
out\all_continuous_data.nc
out\final_state.nc
out\logfile.log
out\vr_full_model_configuration.toml

and as a result I wasn't able to continue the tutorial from here onwards...

jacobcook1995 commented 1 week ago

Whether or not the initial state of the model is saved is set by the config option core.data_output_options.save_initial_state. This option seems to default to False, which is probably sane in general so that people don't get spammed with files they don't want.

For the tutorial we need the initial file for the examples to actually work, so the config file for the example run needs to be changed so that this file actually gets outputted.

If you keep this issue open I'll make a pull request to fix this, (and the documentation problem you noticed in #543)

jacobcook1995 commented 1 week ago

This bug has actually been fixed in the most recent development code, but we had not got round to releasing it to users yet. I will make a new release, which should fix this problem!

hrlai commented 1 week ago

Cool thanks! I was too keen and installed this pull request with pip install git+https://github.com/ImperialCollegeLondon/virtual_ecosystem.git@release/0.1.1a5 then needed to install tabulate too. But still ended up with

ModuleNotFoundError: No module named 'virtual_ecosystem.models.animals'

and I wasn't sure how to get this installed.

jacobcook1995 commented 1 week ago

Yeah for the developer code we don't use pip for installation we use poetry, which is described here. The virtual rainforest documentation gives some explanation of how we use poetry here.

If you want to use poetry you really should be using pyenv, this might be useful to you in general actually as it helps a lot with managing python versions. A guide to installing and using pyenv can be found here.

Anyway hopefully we will get the new release out soon, and then you will just be able to simply install it using pip. I've added release schedules to the discussion agenda for the next team meeting, as it is important that we make sure that the data team has access to recent enough code.

jacobcook1995 commented 1 week ago

The new version is now available through PyPI, so you should be able to install/upgrade it through pip. The new version is 0.1.1a5

hrlai commented 6 days ago

Thanks! I can confirm that this is solved with the new release.