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

Implementation of Community object init and factory methods. #282

Merged
merged 26 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6e1856c
Initial import of @amyoctocat files for this subset from #231
davidorme Sep 6, 2024
58458ab
Firming up example proposed input formats for community
davidorme Sep 6, 2024
484d4e5
Amalgamating T model function modules
davidorme Sep 6, 2024
1856b9d
Initial refactor to dataclass
davidorme Sep 6, 2024
a0e6a40
Adding array structured PFT data to Flora
davidorme Sep 8, 2024
2280d69
Validating pft names in cohorts in Community __init__
davidorme Sep 8, 2024
ba2e004
Merge branch 'develop' into 278-implementation-of-community-object
davidorme Sep 9, 2024
f081777
Use pandas to represent flora data as arrays
davidorme Sep 9, 2024
a3b9689
Implementing community as a pandas dataframe of cohort data
davidorme Sep 9, 2024
08922fa
Updating T Model functions and populating T model predictions in coho…
davidorme Sep 10, 2024
f4fe6a7
Moving q_m and p_zm calculations back into t model functions module f…
davidorme Sep 10, 2024
f1750a5
Update T model and fix broken tests
davidorme Sep 10, 2024
7305b47
T Model docstring updates
davidorme Sep 10, 2024
2087367
Explicit testing of exception messages in community data validation
davidorme Sep 11, 2024
7fb901f
Implementation of Community.from_csv and testing
davidorme Sep 11, 2024
c6a186e
Firming up community serialisation formats, more direct factory metho…
davidorme Sep 12, 2024
a5f39dd
Removing old marshmallow schema, firming up validation and testing
davidorme Sep 12, 2024
0b7fa05
Simplified and aligned test inputs, added meaningful test of correct …
davidorme Sep 12, 2024
89a6a21
Extending intersphinx details and whacking docs issues - some not fixed
davidorme Sep 12, 2024
81088e0
Docstring updates
davidorme Sep 13, 2024
5df492d
Forgot to merge in @AmyOctoCat's tests for the t model functionality
davidorme Sep 13, 2024
2032adc
Fixed incorrect yield value in TModelConst and updated regression tests
davidorme Sep 13, 2024
be40279
Merge branch '281-yield-incorrect-in-tmodel' into 278-implementation-…
davidorme Sep 13, 2024
2dea74a
Merging in @AmyOctoCat's t model function tests
davidorme Sep 13, 2024
6cf5c1b
Worked example of community use.
davidorme Sep 16, 2024
89e5670
Updates from @j-emberton review
davidorme Sep 16, 2024
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
16 changes: 16 additions & 0 deletions docs/source/api/demography_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,19 @@ kernelspec:
:autosummary:
:members:
```

## The {mod}`~pyrealm.demography.community` module

```{eval-rst}
.. automodule:: pyrealm.demography.community
:autosummary:
:members:
```

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

```{eval-rst}
.. automodule:: pyrealm.demography.t_model_functions
:autosummary:
:members:
```
4 changes: 4 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class MyReferenceStyle(AuthorYearReferenceStyle):
("py:class", "numpy._typing._array_like._ScalarType_co"),
("py:class", "numpy._typing._generic_alias.ScalarType"),
("py:class", "numpy.float32"),
("py:class", "numpy.int64"),
("py:class", "numpy.timedelta64"),
("py:class", "numpy.bool_"),
("py:class", "numpy.ndarray"),
Expand Down Expand Up @@ -144,6 +145,7 @@ class MyReferenceStyle(AuthorYearReferenceStyle):
"numpy.ndarray[typing.Any, numpy.dtype[+ScalarType]]]"
),
),
("py:class", "pandas.core.frame.DataFrame"),
]

# +
Expand All @@ -152,7 +154,9 @@ class MyReferenceStyle(AuthorYearReferenceStyle):
"numpy": ("https://numpy.org/doc/stable/", None),
"python": ("https://docs.python.org/3/", None),
"xarray": ("https://docs.xarray.dev/en/stable/", None),
"pandas": ("http://pandas.pydata.org/pandas-docs/dev/", None),
"shapely": ("https://shapely.readthedocs.io/en/stable/", None),
"marshmallow": ("https://marshmallow.readthedocs.io/en/stable/", None),
}
# -

Expand Down
15 changes: 6 additions & 9 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ tabulate = "^0.8.10"
marshmallow = "^3.22.0"
pandas = "^2.2.2"
marshmallow-dataclass = "^8.7.0"
pandas-stubs = "^2.2.2.240909"
[tool.poetry.group.types.dependencies]
pandas-stubs = "^2.2.0.240218"
types-tabulate = "^0.9.0.0"
Expand Down
2 changes: 1 addition & 1 deletion pyrealm/constants/tmodel_const.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class TModelTraits(ConstantsClass):
"""Fine-root turnover time (:math:`\tau_r`, 1.04, years)"""
par_ext: float = 0.5 # k, PAR extinction coefficient (-)
"""PAR extinction coefficient (:math:`k`, 0.5, -)"""
yld: float = 0.17 # y, Yield_factor (-)
yld: float = 0.6 # y, Yield_factor (-)
"""Yield_factor (:math:`y`, 0.17, -)"""
zeta: float = 0.17 # zeta, Ratio of fine-root mass to foliage area (kgCm-2)
r"""Ratio of fine-root mass to foliage area (:math:`\zeta`, 0.17, kg C m-2)"""
Expand Down
Loading
Loading