Skip to content

Commit

Permalink
Improved settings specification
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdurrant committed Jul 31, 2024
1 parent 0182a24 commit 185e655
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions rompy/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
# working in a python environement
DATA_SOURCE_TYPES = os.getenv(
"DATA_SOURCE_TYPES",
"SourceDataset:rompy.core.data,SourceFile:rompy.core.data,SourceIntake:rompy.core.data,SourceDatamesh:rompy.core.data",
"rompy.core.data.SourceDataset,rompy.core.data.SourceFile,rompy.core.data.SourceIntake,rompy.core.data.SourceDatamesh",
)

BOUNDARY_SOURCE_TYPES = os.getenv("BOUNDARY_SOURCE_TYPES", DATA_SOURCE_TYPES)
SPEC_BOUNDARY_SOURCE_TYPES = os.getenv(
"SPEC_BOUNDARY_SOURCE_TYPES",
DATA_SOURCE_TYPES + ",SourceWavespectra:rompy.core.boundary",
DATA_SOURCE_TYPES + ",rompy.core.boundary.SourceWavespectra",
)
3 changes: 2 additions & 1 deletion rompy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ def process_setting(settings_str: str):
# Get the actual model classes
data_source_types = []
for data_source_type_name in data_source_type_names:
class_name, module_name = data_source_type_name.split(":")
split = data_source_type_name.split(".")
module_name, class_name = ".".join(split[:-1]), split[-1]
data_source_types.append(get_class_from_module(module_name, class_name))

# Filter out any None values (in case of invalid model names)
Expand Down

0 comments on commit 185e655

Please sign in to comment.