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

Remove outdated T Model module #370

Merged
merged 3 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docs/source/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ subtrees:
- file: users/demography/crown.md
- file: users/demography/community.md
- file: users/demography/canopy.md
- file: users/tmodel/tmodel.md
- file: users/tmodel/canopy.md
- file: users/splash.md
- file: users/constants.md
- file: users/hygro.md
Expand Down
4 changes: 2 additions & 2 deletions docs/source/api/demography_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ language_info:
:members:
```

## The {mod}`~pyrealm.demography.t_model_functions` module
## The {mod}`~pyrealm.demography.tmodel` module

```{eval-rst}
.. automodule:: pyrealm.demography.t_model_functions
.. automodule:: pyrealm.demography.tmodel
:autosummary:
:members:
```
Expand Down
33 changes: 0 additions & 33 deletions docs/source/api/tmodel_api.md

This file was deleted.

23 changes: 16 additions & 7 deletions docs/source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,27 @@ following modules:

## Module overview

The `core` module
: Contains fundamental utilities and physics functionality shared across the
package, including the [hygro](users/hygro) and the utilities submodules.

The `pmodel` module
: Fitting the [P Model](users/pmodel/module_overview), which is an ecophysiological
model of optimal carbon dioxide uptake by plants {cite:p}`Prentice:2014bc,
Wang:2017go,Stocker:2020dh`, along with various extensions.

The `tmodel` module
: Estimating plant allocation of gross primary productivity to growth and respiration,
using the [T Model](users/tmodel/tmodel) {cite:p}`Li:2014bc`.

The `core` module
: Contains fundamental utilities and physics functionality shared across the
package, including the [hygro](users/hygro) and the utilities submodules.
The `splash` module
: Fits the [SPLASH v1 model](users/splash.md), which can be used to
estimate soil moisture, actual evapotranspiration and soil runoff from daily
temperature, precipitation and sunshine data {cite:p}`davis:2017a`.

The `demography` module
: Provides functionality for [modelling plant allocation and growth and
demography](users/demography/module_overview.md), including classes to represent plant
functional types, cohorts and communities. This module includes an implementation of
the T Model for estimating plant allocation of gross primary productivity to growth
and respiration {cite:p}`Li:2014bc`. This module is still in active development but a
lot of initial functionality is present.

## Indices and tables

Expand Down
2 changes: 1 addition & 1 deletion docs/source/users/demography/canopy.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ from pyrealm.demography.flora import PlantFunctionalType, Flora
from pyrealm.demography.community import Cohorts, Community
from pyrealm.demography.crown import CrownProfile, get_crown_xy
from pyrealm.demography.canopy import Canopy
from pyrealm.demography.t_model_functions import StemAllometry
from pyrealm.demography.tmodel import StemAllometry
```

The `canopy` module in `pyrealm` is used to calculate a model of the light environment
Expand Down
6 changes: 3 additions & 3 deletions docs/source/users/demography/crown.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ from pyrealm.demography.flora import (
Flora,
)

from pyrealm.demography.t_model_functions import (
from pyrealm.demography.tmodel import (
calculate_dbh_from_height,
StemAllometry,
)
Expand Down Expand Up @@ -198,7 +198,7 @@ profiles for PFTs. It requires:

* a {class}`~pyrealm.demography.flora.Flora` instance providing a set of PFTs to be
compared,
* a {class}`~pyrealm.demography.t_model_functions.StemAllometry` instance setting the
* a {class}`~pyrealm.demography.tmodel.StemAllometry` instance setting the
specific stem sizes for the profile, and
* a set of heights at which to estimate the profile variables

Expand Down Expand Up @@ -226,7 +226,7 @@ flora.to_pandas()[["name", "h_max", "ca_ratio", "m", "n", "f_g", "q_m", "z_max_p

The next section of code generates the `StemAllometry` to use for the profiles.
The T Model requires DBH to define stem size - here the
{meth}`~pyrealm.demography.t_model_functions.calculate_dbh_from_height` function
{meth}`~pyrealm.demography.tmodel.calculate_dbh_from_height` function
is used to back-calculate the required DBH values to give three stems with similar
heights that are near the maximum height for each PFT.

Expand Down
14 changes: 7 additions & 7 deletions docs/source/users/demography/t_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import numpy as np
import pandas as pd

from pyrealm.demography.flora import PlantFunctionalType, Flora
from pyrealm.demography.t_model_functions import StemAllocation, StemAllometry
from pyrealm.demography.tmodel import StemAllocation, StemAllometry
```

To generate predictions under the T Model, we need a Flora object providing the
Expand All @@ -55,7 +55,7 @@ flora = Flora([short_pft, medium_pft, tall_pft])
## Stem allometry

We can visualise how the stem size, canopy size and various masses of PFTs change with
stem diameter by using the {class}`~pyrealm.demography.t_model_functions.StemAllometry`
stem diameter by using the {class}`~pyrealm.demography.tmodel.StemAllometry`
class. Creating a `StemAllometry` instance needs an existing `Flora` instance and an
array of values for diameter at breast height (DBH, metres). The returned class contains
the predictions of the T Model for:
Expand All @@ -77,7 +77,7 @@ for each PFT. This then calculates a single estimate at the given size for each
single_allometry = StemAllometry(stem_traits=flora, at_dbh=np.array([0.1, 0.1, 0.1]))
```

The {meth}`~pyrealm.demography.t_model_functions.StemAllometry` class provides the
The {meth}`~pyrealm.demography.tmodel.StemAllometry` class provides the
{meth}`~pyrealm.demography.core.PandasExporter.to_pandas()` method to export the stem
data for data exploration.

Expand Down Expand Up @@ -124,7 +124,7 @@ for ax, (var, ylab) in zip(axes.flatten(), plot_details):
```

The {meth}`~pyrealm.demography.core.PandasExporter.to_pandas()` method of the
{meth}`~pyrealm.demography.t_model_functions.StemAllometry` class can still be used, but
{meth}`~pyrealm.demography.tmodel.StemAllometry` class can still be used, but
the values are stacked into columns along with a index showing the different cohorts.

```{code-cell} ipython3
Expand All @@ -135,7 +135,7 @@ allometries.to_pandas()

The T Model also predicts how potential GPP will be allocated to respiration, turnover
and growth for stems with a given PFT and allometry using the
{meth}`~pyrealm.demography.t_model_functions.StemAllometry` class. Again, a single
{meth}`~pyrealm.demography.tmodel.StemAllometry` class. Again, a single
value can be provided to get a single estimate of the allocation model for each stem:

```{code-cell} ipython3
Expand All @@ -146,7 +146,7 @@ single_allocation
```

The {meth}`~pyrealm.demography.core.PandasExporter.to_pandas()` method of the
{meth}`~pyrealm.demography.t_model_functions.StemAllocation` class can be used to
{meth}`~pyrealm.demography.tmodel.StemAllocation` class can be used to
export data for exploration.

```{code-cell} ipython3
Expand Down Expand Up @@ -229,7 +229,7 @@ fig.delaxes(axes[-1])
```

As before, the {meth}`~pyrealm.demography.core.PandasExporter.to_pandas()` method of the
{meth}`~pyrealm.demography.t_model_functions.StemAllometry` classs can be used to export
{meth}`~pyrealm.demography.tmodel.StemAllometry` classs can be used to export
the data for each stem:

```{code-cell} ipython3
Expand Down
Loading
Loading