Skip to content

Commit

Permalink
add support for old HYDRUS_ behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
martinvonk committed Dec 17, 2024
1 parent 51d57f4 commit 86abbc7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 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,12 @@ 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 use source='HYDRUS' argument"
)
sersm = ser[ser["soilmodel"] == smn].loc[[self.name], :]
if source is None and len(sersm) > 1:
raise Exception(
Expand Down

0 comments on commit 86abbc7

Please sign in to comment.