Skip to content

Commit

Permalink
docs: Fixed a few failing links (#86)
Browse files Browse the repository at this point in the history
* docs: Fixed a few failing links

* ci(bumpversion.yml): Disabled workflow as it never really works
  • Loading branch information
Carsopre authored Apr 13, 2022
1 parent 66d20dd commit 5a27af0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
File renamed without changes.
24 changes: 13 additions & 11 deletions docs/guides/run_simulation_veg.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@

To fully understand how to create a simulation object in NBSDynamics we recommend first going through the basic guideline [How to create and run a simulation](../../guides/run_simulation).

An example of how a simulation is run can be found in the [acceptance tests](../../test/test_acceptance.py#TestAcceptance::test_given_veg_case_runs)
An example of how a simulation is run can be found in the acceptance tests.

## 1. Simulation structure.
The [Vegetation Delft3d Simulation](../../reference/simulation/vegetation_simulation/#src.biota_models.vegetation.simulation.veg_delft3d_simulation) is a concrete implementation of the [BaseSimulation]() which implements the `SimulationProtocol` already described in the previous mentioned [guide](../../guides/run_simulation#1.-Simulation-structure). As such, we are allowed to define our own interpretations of the simulation. Here is how we build a Vegetation simulation:
The [Vegetation Delft3d Simulation](../../reference/biota_models/vegetation/vegetation_simulation/) is a concrete implementation of the [BaseSimulation](../../reference/core/simulation/simulation/#base-simulation) which implements the `SimulationProtocol` already described in the previous mentioned [guide](../../guides/run_simulation#1.-Simulation-structure). As such, we are allowed to define our own interpretations of the simulation. Here is how we build a Vegetation simulation:

* Constants -> [VegetationConstants](../../reference/common/common/#src.biota_models.vegetation.model.veg_constants). Different species are defined through different constant values, as well as time related constants (e.g. start time and ecological time steps).
* Constants -> [VegetationConstants](../../reference/biota_models/vegetation/vegetation_model/#vegetation-constants). Different species are defined through different constant values, as well as time related constants (e.g. start time and ecological time steps).
* To initialize the object at least a valid species name is required.
* This class will load its values looking for the default [vegetation constants file]().
* This class will load its values looking for the default [vegetation constants file](https://github.com/Deltares/NBSDynamics/blob/master/src/biota_models/vegetation/model/veg_constants.json).
* We also allow the user to load their own file by doing the following:
```python
VegetationConstants(species='Salicornia', input_file='your_json_filepath_here.json')
```
* Further species can be added by defining their specific parameters using [constants_json_create](../../src/biota_models/vegetation/vegetation_model#src.biota_models.vegetation.model.constants_json_create).
* Biota -> [Vegetation](../../src/biota_models/vegetation/vegetation_model#vegetation-model)
* This biota also includes extra characteristics such as [LifeStages](../../reference/vegetation/vegetation_model/#src.biota_models.vegetation.model.veg_lifestages).
* Further species can be added by defining their specific parameters using [constants_json_create](https://github.com/Deltares/NBSDynamics/blob/master/src/biota_models/vegetation/model/constants_json_create.py).
* Biota -> [Vegetation](../../reference/biota_models/vegetation/vegetation_model/#vegetation-model)
* This biota also includes extra characteristics such as [LifeStages](../../reference/biota_models/vegetation/vegetation_model/#src.biota_models.vegetation.model.veg_lifestages.LifeStages).
* Environment -> None (we do not need it for this simulation).
* Hydrodynamics -> Either of the following two:
* [Delft3D - FlowFMModel](../../reference/core/hydrodynamics/hydromodels/#src.core.hydrodynamics.delft3d.FlowFmModel).
* [Delft3D - DimrModel](../../reference/core/hydrodynamics/hydromodels/#src.core.hydrodynamics.delft3d.DimrModel).
* Output -> [VegetationOutputWrapper](../../reference/output/vegetation_output/#src.biota_models.vegetation.output.veg_output_wrapper).
* Output -> [VegetationOutputWrapper](../../reference/biota_models/vegetation/vegetation_output/#src.biota_models.vegetation.output.veg_output_wrapper.VegOutputWrapper).
* Our custom wrapper ensures the required output variables are stored to be later evaluated.

## 2. Simulation steps.
When the previous paramaters have been correctly assigned to the object, the simulation is started by using the required methods from [BaseSimulation](../../reference/simulation/vegetation_simulation/#src.biota_models.vegetation.simulation.veg_base_simulation) and defined in [VegFlowFmSimulation](../../reference/simulation/vegetation_simulation/#src.biota_models.vegetation.simulation.veg_delft3d_simulation):
When the previous paramaters have been correctly assigned to the object, the simulation is started by using the required methods from [BaseSimulation](../../reference/core/simulation/simulation/#base-simulation) and defined in [VegFlowFmSimulation](reference/biota_models/vegetation/vegetation_simulation/#src.biota_models.vegetation.simulation.veg_delft3d_simulation.VegFlowFmSimulation):

1. Initiate:
* Configures hydrodynamics and output
Expand Down Expand Up @@ -78,9 +78,11 @@ output_dir = test_dir / "output"
test_case = test_dir / "input" / "MinFiles"

# 2. Prepare model.
# Create vegetation constants based on the above species.
veg_constants = VegetationConstants(species="Salicornia")
sim_run = VegFlowFmSimulation(
working_dir=test_dir,
constants=VegetationConstants(species="Salicornia"),
constants=veg_constants,
hydrodynamics=dict(
working_dir=test_dir / "d3d_work",
d3d_home=kernels_dir,
Expand All @@ -94,7 +96,7 @@ sim_run = VegFlowFmSimulation(
output_params=dict(),
),
),
biota=Vegetation(species="Salicornia"),
biota=Vegetation(species="Salicornia", constants=veg_constants),
)

# 3. Run simulation.
Expand Down
11 changes: 6 additions & 5 deletions docs/reference/biota_models/vegetation/vegetation_model.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
## Vegetation models for the NBSDynamics package.

## Vegetation Protocol
:: src.core.vegetation.veg_protocol
::: src.biota_models.vegetation.model.veg_protocol

## Vegetation Model
:: src.core.vegetation.veg_model
::: src.biota_models.vegetation.model.veg_model

## Vegetation Constants
:: src.biota_models.vegetation.model.veg_constants
::: src.biota_models.vegetation.model.veg_constants

## Utils
:: src.core.vegetation.veg_lifestages
:: src.core.vegetation.veg_only
::: src.biota_models.vegetation.model.veg_lifestages

::: src.biota_models.vegetation.model.veg_only
1 change: 1 addition & 0 deletions test/test_acceptance.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def test_given_veg_case_runs(self):

test_case = test_dir / "input" / "MinFiles"
species = "Salicornia"
# Create vegetation constants based on the above species.
veg_constants = VegetationConstants(species=species)
sim_run = VegFlowFmSimulation(
working_dir=test_dir,
Expand Down

0 comments on commit 5a27af0

Please sign in to comment.