Skip to content

Commit 0861c95

Browse files
Merge pull request #985 from ImperialCollegeLondon/release/v0.1.1a12
Release 0.1.1a12
2 parents 0c4f449 + c54ba45 commit 0861c95

File tree

11 files changed

+933
-945
lines changed

11 files changed

+933
-945
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: actions/checkout@v4
1717
- uses: actions/setup-python@v5
1818
with:
19-
python-version: "3.10"
19+
python-version: "3.11"
2020
- uses: pre-commit/[email protected]
2121

2222
test:
@@ -26,7 +26,7 @@ jobs:
2626
fail-fast: false
2727
matrix:
2828
os: [ ubuntu-latest, macos-latest, windows-latest ]
29-
python-version: [ "3.10", "3.11", "3.12", "3.13"]
29+
python-version: ["3.11", "3.12", "3.13"]
3030

3131
steps:
3232
- uses: actions/checkout@v4
@@ -36,9 +36,9 @@ jobs:
3636
python-version: ${{ matrix.python-version }}
3737

3838
- name: Install Poetry
39-
uses: abatilo/[email protected]
40-
with:
41-
poetry-version: 1.5.1
39+
run: |
40+
pipx install poetry --python python${{ matrix.python-version }}
41+
poetry --version
4242
4343
- name: Install dependencies
4444
run: poetry install
@@ -53,7 +53,7 @@ jobs:
5353
github.event.pull_request.user.login == 'pre-commit-ci[bot]'
5454
) && (
5555
matrix.os == 'ubuntu-latest' &&
56-
matrix.python-version == '3.10'
56+
matrix.python-version == '3.11'
5757
)
5858
}}
5959
uses: codecov/codecov-action@v5
@@ -68,13 +68,13 @@ jobs:
6868
- uses: actions/checkout@v4
6969
- uses: actions/setup-python@v5
7070
with:
71-
python-version: "3.10"
71+
python-version: "3.11"
7272

7373
- name: Install Poetry
74-
uses: abatilo/[email protected]
75-
with:
76-
poetry-version: 1.5.1
77-
74+
run: |
75+
pipx install poetry --python python3.11
76+
poetry --version
77+
7878
- name: Install dependencies
7979
run: poetry install
8080

docs/source/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ class MyReferenceStyle(AuthorYearReferenceStyle):
144144
("py:class", "dataclasses.InitVar"),
145145
("py:class", "Quantity"),
146146
("py:class", "numpy._typing._array_like._ScalarType_co"),
147+
("py:class", "numpy._typing._array_like._ScalarT"),
147148
# God only knows why this is needed. We don't refer to pint.util.Quantity and it
148149
# isn't in the pint objects.inv, so why the hell is intersphinx trying to build
149150
# references to it.

docs/source/using_the_ve/virtual_ecosystem_in_static_mode.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,11 @@ Once the baseline run is complete, you can set up the experiment with default
163163
164164
# Generate the static config file programmatically
165165
import sys
166+
import tomllib
166167
from pathlib import Path
167168
168169
import tomli_w
169170
170-
if sys.version_info[:2] >= (3, 11):
171-
import tomllib
172-
else:
173-
import tomli as tomllib
174171
175172
# Create output directory
176173
output_dir = Path("/tmp/ve_example/HydroDefault_out/")

poetry.lock

Lines changed: 873 additions & 868 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 41 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
[tool.poetry]
1+
[project]
22
authors = [
3-
"Rob Ewers <[email protected]>",
4-
"David Orme <[email protected]>",
5-
"Jacob Cook <[email protected]>",
6-
"Vivienne Groner <[email protected]>",
7-
"Taran Rallings <[email protected]>",
8-
"Olivia Daniel <[email protected]>",
9-
"Jaideep Joshi <[email protected]>",
10-
"Anna Rallings <[email protected]>",
11-
"Priyanga Amarasekare <[email protected]>",
12-
"Diego Alonso Alvarez <[email protected]>",
13-
"Alex Dewar <[email protected]>",
3+
{name = "Rob Ewers", email = "[email protected]"},
4+
{name = "David Orme", email = "[email protected]"},
5+
{name = "Jacob Cook", email = "[email protected]"},
6+
{name = "Vivienne Groner", email = "[email protected]"},
7+
{name = "Taran Rallings", email = "[email protected]"},
8+
{name = "Olivia Daniel", email = "[email protected]"},
9+
{name = "Jaideep Joshi", email = "[email protected]"},
10+
{name = "Anna Rallings", email = "[email protected]"},
11+
{name = "Priyanga Amarasekare", email = "[email protected]"},
12+
{name = "Diego Alonso Alvarez", email = "[email protected]"},
13+
{name = "Alex Dewar", email = "[email protected]"},
1414
]
1515
classifiers = [
1616
"Development Status :: 2 - Pre-Alpha",
@@ -19,33 +19,40 @@ classifiers = [
1919
"Topic :: Scientific/Engineering",
2020
]
2121
description = """An holistic ecosystem simulation model."""
22-
homepage = "https://virtual-ecosystem.readthedocs.io/"
2322
license = "BSD-3-Clause"
23+
license-files = ["LICENSE"]
2424
name = "virtual_ecosystem"
2525
readme = "README.md"
26-
repository = "https://github.com/ImperialCollegeLondon/virtual_ecosystem"
27-
version = "0.1.1a11"
26+
version = "0.1.1a12"
27+
28+
requires-python = ">=3.11"
29+
30+
dependencies = [
31+
"Shapely (>2.0)",
32+
"dask (>2023.6)",
33+
"dpath (>2.0)",
34+
"jsonschema (>4.14)",
35+
"netcdf4 (>1.6)",
36+
"numpy (>2.0)",
37+
"openpyxl (>3.1)",
38+
"pint (>0.24)",
39+
"pyrealm (>=2.0.0rc5)",
40+
"scipy (>1.12)",
41+
"tomli-w (>1.0)",
42+
"tqdm (>4.66)",
43+
"xarray (>2024.6)",
44+
"types-tabulate (>0.9)",
45+
]
2846

29-
[tool.poetry.scripts]
47+
[project.scripts]
3048
ve_run = "virtual_ecosystem.entry_points:ve_run_cli"
3149

32-
[tool.poetry.dependencies]
33-
Shapely = "^2.0"
34-
dask = ">=2023.6,<2026.0"
35-
dpath = "^2.0.6"
36-
jsonschema = "^4.14.0"
37-
netcdf4 = "^1.6.5"
38-
numpy = "^2.0"
39-
openpyxl = "^3.1.5"
40-
pint = "^0.24.1"
41-
pyrealm = {git = "https://github.com/ImperialCollegeLondon/pyrealm.git", branch = "develop"}
42-
python = ">=3.10,<3.14"
43-
scipy = "^1.9.0"
44-
tomli = {version = "^2.0.1", python = "<3.11"}
45-
tomli-w = "^1.0.0"
46-
tqdm = "^4.66.2"
47-
xarray = ">=2024.6,<2026.0"
48-
types-tabulate = "^0.9.0.20241207"
50+
[project.urls]
51+
homepage = "https://virtual-ecosystem.readthedocs.io/"
52+
repository = "https://github.com/ImperialCollegeLondon/virtual_ecosystem"
53+
54+
[tool.poetry]
55+
requires-poetry = ">=2.0"
4956

5057
[tool.poetry.group.types.dependencies]
5158
types-dataclasses = "^0.6.6"
@@ -104,7 +111,7 @@ python_files = 'test_*.py'
104111
testpaths = ['tests']
105112

106113
[tool.ruff]
107-
target-version = "py310"
114+
target-version = "py311"
108115

109116
[tool.ruff.lint]
110117
# Enable all `pydocstyle` rules, limiting to those that adhere to the

tests/core/test_variables.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
"""Tests for the virtual_ecosystem.core.variables module."""
22

3-
import sys
4-
53
import pytest
64

7-
if sys.version_info[:2] >= (3, 11):
8-
import tomllib
9-
else:
10-
import tomli as tomllib # noqa: F401
11-
125

136
@pytest.fixture(autouse=True)
147
def known_variables():

virtual_ecosystem/core/config.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
module for details.
99
""" # noqa: D205
1010

11-
import sys
11+
import tomllib
1212
from collections.abc import Sequence
1313
from copy import deepcopy
1414
from pathlib import Path
@@ -22,11 +22,6 @@
2222
from virtual_ecosystem.core.registry import MODULE_REGISTRY, register_module
2323
from virtual_ecosystem.core.schema import ValidatorWithDefaults, merge_schemas
2424

25-
if sys.version_info[:2] >= (3, 11):
26-
import tomllib
27-
else:
28-
import tomli as tomllib
29-
3025

3126
def config_merge(
3227
dest: dict, source: dict, conflicts: tuple = (), path: str = ""

virtual_ecosystem/core/variables.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
import json
3131
import pkgutil
32-
import sys
32+
import tomllib
3333
from collections.abc import Hashable
3434
from dataclasses import asdict, dataclass, field
3535
from graphlib import CycleError, TopologicalSorter
@@ -46,11 +46,6 @@
4646
from virtual_ecosystem.core.logger import LOGGER
4747
from virtual_ecosystem.core.schema import ValidatorWithDefaults
4848

49-
if sys.version_info[:2] >= (3, 11):
50-
import tomllib
51-
else:
52-
import tomli as tomllib
53-
5449

5550
def to_camel_case(snake_str: str) -> str:
5651
"""Convert a snake_case string to CamelCase.

virtual_ecosystem/entry_points.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
import argparse
88
import sys
99
import textwrap
10+
import tomllib
1011
from collections.abc import Sequence
1112
from pathlib import Path
1213
from shutil import copytree, ignore_patterns
14+
from tomllib import TOMLDecodeError
1315
from typing import Any
1416

1517
import virtual_ecosystem as ve
@@ -19,13 +21,6 @@
1921
from virtual_ecosystem.core.logger import LOGGER
2022
from virtual_ecosystem.main import Progress, ve_run
2123

22-
if sys.version_info[:2] >= (3, 11):
23-
import tomllib
24-
from tomllib import TOMLDecodeError
25-
else:
26-
import tomli as tomllib
27-
from tomli import TOMLDecodeError
28-
2924

3025
def _parse_param_str(s: str) -> dict[str, Any]:
3126
"""Parse a single parameter string into a dict.

virtual_ecosystem/models/hydrology/above_ground.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def calculate_soil_evaporation(
307307
saturation_vapour_pressure = calc_vp_sat(
308308
ta=temperature,
309309
core_const=pyrealm_const(),
310-
).astype(np.floating) # pyrealm returning np.float64
310+
)
311311

312312
saturated_specific_humidity = (
313313
gas_constant_water_vapour * saturation_vapour_pressure

0 commit comments

Comments
 (0)