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

223 dimr rainfallrunoffmodel fmmodel are not read #225

Merged
merged 3 commits into from
Apr 8, 2022
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: 7 additions & 1 deletion hydrolib/core/io/bc/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
from hydrolib.core.io.ini.models import DataBlockINIBasedModel, INIGeneral, INIModel
from hydrolib.core.io.ini.parser import Parser, ParserConfig
from hydrolib.core.io.ini.serializer import SerializerConfig, write_ini
from hydrolib.core.io.ini.util import get_enum_validator, get_from_subclass_defaults
from hydrolib.core.io.ini.util import (
get_enum_validator,
get_from_subclass_defaults,
make_list_validator,
)

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -204,6 +208,8 @@ class ForcingModel(INIModel):
general: ForcingGeneral = ForcingGeneral()
forcing: List[ForcingBase] = []

_split_to_list = make_list_validator("forcing")

@classmethod
def _ext(cls) -> str:
return ".bc"
Expand Down
2 changes: 1 addition & 1 deletion hydrolib/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def get_substring_between(source: str, start: str, end: str) -> Optional[str]:

index_start += len(start)

index_end = source.find(end, index_start)
index_end = source.rfind(end, index_start)
if index_end == -1:
return None

Expand Down