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

Function to generate data / folder structure from a template #649

Open
hrlai opened this issue Dec 30, 2024 · 1 comment
Open

Function to generate data / folder structure from a template #649

hrlai opened this issue Dec 30, 2024 · 1 comment

Comments

@hrlai
Copy link
Collaborator

hrlai commented Dec 30, 2024

Is your feature request related to a problem? Please describe.
This feature request is similar to the train of thought here. The idea is to have a function that setup the folders and placeholder config files for a user who wants to initiate a simulation / project. I wanted to play around with a soil-module-only simulation, but it seems that the best way is to copy the files from ve_example and then modify them?

Describe the solution you'd like
I was hoping for some function like setup_from_template(...) with a bunch of arguments, e.g.,

  • path of a new folder to generate for a project
  • what modules to include
  • settings for each modules

The result is to generate the necessary files in a new config and data folders.

One option is for this to be a single function with lots of arguments for the user to specify at once, but this could end up being very very long. Alternatively, the function could be interactive. For example, it could be something like setup_from_template("path/to/new/folder"), then it starts an interactive prompt:

Select modules to include:
1. core
2. hydrology
3. animal
4. litter
5. soil
6. ...

and then the user would enter something like 1 3 5 and hit enter to get the next prompt:

For the core module, select a variable to configure initial values:
1. air_temperature_ref
2. relative_humidity_ref
3. ...
4. mean_annual_temperature
5. <accept the rest with default values> (or some ways to end the prompt)

When one selects air_temperature_ref to configure, the few options could be

  1. select path to data file (a .nc file)
  2. a single value (not useful?)
  3. a helper function to generate random number

This cycles through all variables until the user is willing to accept the rest with the default.

Then the user runs ve_run on the generated configs and data.

If this happens, it could even replace ve_example as a less hard-coded example???

@davidorme
Copy link
Collaborator

I think the first part of this would be very useful, particularly with the setup of static/active modules (#373). It would be written as a function but the UI should be something like ve_utils generate_setup /path/to/new/folder.

Honestly, I don't think it should go beyond the model choice - the config files are designed to be human readable and it is going to be very tedious (and error prone) to do this interactively. But - giving people a tuned setup TOML file with "fill in the blanks" placeholders for the data files and settings would be very useful.

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

No branches or pull requests

2 participants