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

Update main to v0.0.7 #9

Merged
merged 12 commits into from
Dec 17, 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
8 changes: 4 additions & 4 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ jobs:
python: "3.12-dev"
os: ubuntu-latest
toxenv: py312
experimental: true
- name: Type check with mypy
python: "3.10"
experimental: false
- name: Test suite with py313-ubuntu
python: "3.13"
os: ubuntu-latest
toxenv: type
toxenv: py313
experimental: false
- name: Formatting with black + isort
python: "3.10"
Expand Down
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ classifiers = [
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Topic :: Scientific/Engineering :: Hydrology',
'Intended Audience :: Science/Research',
"License :: OSI Approved :: MIT License",
Expand Down Expand Up @@ -50,7 +52,7 @@ flake8 = "^6.1.0"
ruff = "^0.1.9"
black = { extras = ["jupyter"], version = "^23.12.1" }
isort = "^5.13.2"
mypy = "^1.8.0"
mypy = "^1.13.0"
pandas-stubs = "^2.1.4.231218"
pytest = "^7.4.3"
pytest-cov = "^4.1.0"
Expand Down Expand Up @@ -80,6 +82,8 @@ profile = "black"

[tool.mypy]
mypy_path = "src"
plugins = "numpy.typing.mypy_plugin"


[tool.ruff]
line-length = 88
Expand All @@ -96,7 +100,7 @@ pythonpath = ["src"]
legacy_tox_ini = """
[tox]
requires = tox>=4
env_list = format, type, lint, py{310,311,312}
env_list = format, type, lint, py{310,311,312,313}

[testenv]
description = run unit tests
Expand Down
2 changes: 1 addition & 1 deletion src/pedon/_typing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from numpy import float64
from numpy.typing import NDArray

FloatArray = float | NDArray[float64]
FloatArray = NDArray[float64]
2 changes: 1 addition & 1 deletion src/pedon/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.6"
__version__ = "0.0.7"
8 changes: 8 additions & 0 deletions src/pedon/soil.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# type: ignore
import logging
from dataclasses import dataclass, field
from pathlib import Path
from typing import Type
Expand Down Expand Up @@ -384,6 +385,13 @@ def from_name(

path = Path(__file__).parent / "datasets/soilsamples.csv"
ser = read_csv(path, delimiter=";", index_col=0)
if "HYDRUS_" in self.name:
self.name = self.name.replace("HYDRUS_", "")
source = "HYDRUS"
logging.warning(
"Removed 'HYDRUS_' from soil name. For future use"
"please provide source='HYDRUS' argument"
)
sersm = ser[ser["soilmodel"] == smn].loc[[self.name], :]
if source is None and len(sersm) > 1:
raise Exception(
Expand Down
2 changes: 1 addition & 1 deletion src/pedon/soilmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def theta(self, h: FloatArray) -> FloatArray:
return self.theta_s
else:
theta = full(h.shape, self.theta_s)
theta[h >= self.h_b] = self.theta_r + self.s(h[h > self.h_b]) * (
theta[h >= self.h_b] = self.theta_r + self.s(h[h >= self.h_b]) * (
self.theta_s - self.theta_r
)
return theta
Expand Down
Loading