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

Annual fAPAR_max and LAI_max #403

Open
wants to merge 30 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a1a4373
wip on fapar code
MarionBWeinzierl Jan 7, 2025
571f515
added @davidorme 's example to the build data, adapted fapar_limitation
MarionBWeinzierl Jan 24, 2025
8c4a282
draft implementation for computing fapar_max from pmodel
MarionBWeinzierl Jan 27, 2025
b90d77a
fixed typehints and typing, added docstrings etc.
MarionBWeinzierl Jan 28, 2025
8823dde
fixed linting issues
MarionBWeinzierl Jan 29, 2025
ab9de6e
make sure there isn't a strange string
MarionBWeinzierl Jan 29, 2025
fc05c2d
update import for lower Python versions
MarionBWeinzierl Jan 29, 2025
328e140
very much wip on including growing season
MarionBWeinzierl Jan 31, 2025
4c0424e
include growing season, slight refactor for farpar_limitation classes…
MarionBWeinzierl Feb 4, 2025
10c1760
merged mean and total fcts
MarionBWeinzierl Feb 4, 2025
5faca7e
Adding some documentation
MarionBWeinzierl Feb 4, 2025
8094557
Get rid of superfluous functions
MarionBWeinzierl Feb 4, 2025
3e99586
Accept @davidorme 's suggestion from code review
MarionBWeinzierl Feb 10, 2025
796c6df
Accept @davidorme 's suggestion from code review
MarionBWeinzierl Feb 10, 2025
6b05594
Accept @davidorme 's suggestion from code review
MarionBWeinzierl Feb 10, 2025
f7795c4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 10, 2025
3b0f235
create phenology constants class
MarionBWeinzierl Feb 10, 2025
e5ef062
add check for array sizes
MarionBWeinzierl Feb 10, 2025
2dc84f0
add f_0 coefficients to phenology constants
MarionBWeinzierl Feb 10, 2025
26c1965
Accept @davidorme 's suggestion from code review
MarionBWeinzierl Feb 11, 2025
1f3d44f
add datetimes check
MarionBWeinzierl Feb 12, 2025
0193560
started implementing tests for fapar limitation
MarionBWeinzierl Feb 14, 2025
f51db91
add check for month
MarionBWeinzierl Feb 17, 2025
6444909
extended and fixed phenology unit tests
MarionBWeinzierl Feb 17, 2025
841571f
Do not try and test the removed old system
davidorme Feb 3, 2025
ca8a768
Merge remote-tracking branch 'origin/develop' into issue348_annual_fa…
MarionBWeinzierl Feb 19, 2025
d7d1ede
Accept @davidorme 's suggestion from code review
MarionBWeinzierl Feb 25, 2025
8617ee2
changed/added docstrings as requested in code review by david
MarionBWeinzierl Feb 25, 2025
c3112fa
Merge branch 'issue348_annual_fapar_and_lai' of github.com:ImperialCo…
MarionBWeinzierl Feb 25, 2025
e8d30f1
Turning on TODO lists and adding phenology API stub to docs
davidorme Feb 25, 2025
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
36 changes: 36 additions & 0 deletions docs/source/api/phenology_api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
jupytext:
formats: md:myst
text_representation:
extension: .md
format_name: myst
format_version: 0.13
kernelspec:
display_name: Python 3
language: python
name: python3
language_info:
codemirror_mode:
name: ipython
version: 3
file_extension: .py
mimetype: text/x-python
name: python
nbconvert_exporter: python
pygments_lexer: ipython3
version: 3.11.9
---

# The {mod}`~pyrealm.phenology` module

```{eval-rst}
.. automodule:: pyrealm.phenology
:members:
```

## The FAPAR limitation module

```{eval-rst}
.. automodule:: pyrealm.phenology.fapar_limitation
:members:
```
14 changes: 4 additions & 10 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@

from pyrealm import __version__ as pyrealm_version

# +
sys.path.insert(0, os.path.abspath("../"))
# -


# -- Project information -----------------------------------------------------

Expand Down Expand Up @@ -52,6 +49,7 @@
"sphinx.ext.mathjax",
"sphinx.ext.autosummary",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinxcontrib.bibtex",
"myst_nb",
"sphinx_rtd_theme",
Expand All @@ -62,11 +60,11 @@
external_toc_path = "_toc.yml" # optional, default: _toc.yml
external_toc_exclude_missing = False # optional, default: False

# + [markdown]
# Citation styling
# -
# Include TODOs
todo_include_todos = True


# Citation styling
def bracket_style() -> BracketStyle:
"""Custom citation parenthesis style."""
return BracketStyle(
Expand Down Expand Up @@ -156,7 +154,6 @@ class MyReferenceStyle(AuthorYearReferenceStyle):
("py:class", "pandas.core.frame.DataFrame"),
]

# +
intersphinx_mapping = {
"pytest": ("https://docs.pytest.org/en/stable/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
Expand All @@ -166,7 +163,6 @@ class MyReferenceStyle(AuthorYearReferenceStyle):
"shapely": ("https://shapely.readthedocs.io/en/stable/", None),
"marshmallow": ("https://marshmallow.readthedocs.io/en/stable/", None),
}
# -


autodoc_default_flags = ["members"]
Expand Down Expand Up @@ -213,7 +209,6 @@ class MyReferenceStyle(AuthorYearReferenceStyle):
# html_theme = 'sphinx_material'
html_theme = "sphinx_rtd_theme"

# +
html_theme_options = {
"logo_only": True,
"version_selector": True,
Expand All @@ -227,7 +222,6 @@ class MyReferenceStyle(AuthorYearReferenceStyle):
"includehidden": True,
"titles_only": False,
}
# -


# Add any paths that contain custom static files (such as style sheets) here,
Expand Down
3 changes: 3 additions & 0 deletions pyrealm/constants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
* :class:`~pyrealm.constants.isotope_const.IsotopesConst`
* :class:`~pyrealm.constants.pmodel_const.PModelConst`
* :class:`~pyrealm.constants.tmodel_const.TModelTraits`
* :class:`~pyrealm.constants.phenology_const.PhenologyConst`
""" # noqa: D205, D415

from pyrealm.constants.base import ConstantsClass
from pyrealm.constants.competition_const import C3C4Const
from pyrealm.constants.core_const import CoreConst
from pyrealm.constants.isotope_const import IsotopesConst
from pyrealm.constants.phenology_const import PhenologyConst
from pyrealm.constants.pmodel_const import PModelConst
from pyrealm.constants.tmodel_const import TModelTraits

Expand All @@ -22,5 +24,6 @@
"CoreConst",
"IsotopesConst",
"PModelConst",
"PhenologyConst",
"TModelTraits",
]
26 changes: 26 additions & 0 deletions pyrealm/constants/phenology_const.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""The phenology_const module TODO."""

from dataclasses import dataclass

from pyrealm.constants import ConstantsClass


@dataclass(frozen=True)
class PhenologyConst(ConstantsClass):
r"""Model constants for the phenology module class.

This data class holds constants needed for the FaparLimitation and other classes
in the phenology module.
"""

z: float = 12.227
"""z accounts for the costs of building and maintaining leaves and the total
below-ground allocation required to support the nutrient demand of those
leaves. [mol m^{-2} year^{-1}]."""

k: float = 0.5
"""Light extinction coefficient."""

f0_coefficients = (0.65, 0.604169, 1.9)
"""Coefficients to calculate f_0, the ratio of annual total transpiration of annual
total precipitation."""
1 change: 1 addition & 0 deletions pyrealm/phenology/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""The phenology module."""
Loading