ImperialCollegeLondon / ImperialCollegeLondon/virtual_ecosystem

Function to generate data / folder structure from a template

Open
#649 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
20
Forks
5
Avg merge
2d 1h
Merged PRs (30d)
34

Description

**Is your feature request related to a problem? Please describe.**
This feature request is similar to the train of thought [here](https://virtual-ecosystem.readthedocs.io/en/latest/development/design/core.html#data-generator). 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. (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](https://virtual-ecosystem.readthedocs.io/en/latest/development/design/core.html#data-generator) 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???

Contributor guide

Open the contributing guide

Research direction

Start with the data-generator design described in the linked core documentation and compare it with the existing ve_example directory. Define the scope of setup_from_template, including module selection, configuration inputs, and generated config/data folders; completion should be demonstrated by running ve_run with the generated project.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.