Skip to content

Commit

Permalink
fix: github CI could not install etas model, because gdal binaries we…
Browse files Browse the repository at this point in the history
…re not present (fiona requires it). Therefore, removed env specification of case_h models, so that floatcsep automatically detects running env.
  • Loading branch information
pabloitu committed Aug 2, 2024
1 parent f68ad29 commit 5f59334
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 13 deletions.
3 changes: 0 additions & 3 deletions examples/case_h/models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
n_sims: 100
mc: 3.5
seed: 23
build: venv
- Poisson Mock:
giturl: https://git.gfz-potsdam.de/csep/it_experiment/models/pymock.git
repo_hash: v0.1
Expand All @@ -19,7 +18,6 @@
n_sims: 100
mag_min: 3.5
seed: 23
build: venv
- Negbinom Mock:
giturl: https://git.gfz-potsdam.de/csep/it_experiment/models/pymock.git
repo_hash: v0.1
Expand All @@ -31,5 +29,4 @@
apply_mc_to_lambda: True
distribution: negbinom
seed: 23
build: venv
prefix: pymock
2 changes: 1 addition & 1 deletion floatcsep/environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def __init__(self, base_name: str, model_directory: str):
base_name (str): The base name, i.e., model name, for the conda environment.
model_directory (str): The directory containing the model files.
"""
self.base_name = base_name
self.base_name = base_name.replace(' ', '_')
self.model_directory = model_directory
self.env_name = self.generate_env_name()
self.package_manager = self.detect_package_manager()
Expand Down
4 changes: 2 additions & 2 deletions floatcsep/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def __init__(
self.func_kwargs = func_kwargs or {}

self.path = ModelTree(kwargs.get("workdir", os.getcwd()), model_path)
self.build = kwargs.get("build", "docker")
self.build = kwargs.get("build", None)
self.run_prefix = ""

if self.func:
Expand Down Expand Up @@ -474,7 +474,7 @@ def forecast_from_func(self, start_date: datetime, end_date: datetime, **kwargs)

self.prepare_args(start_date, end_date, **kwargs)
log.info(
f"Running {self.name} using {self.build}:"
f"Running {self.name} using {self.environment.__class__.__name__}:"
f" {timewindow2str([start_date, end_date])}"
)

Expand Down
1 change: 0 additions & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ pyproj
pyshp
pytest
pytest-cov
pytest-asyncio
pyyaml
requests
scipy
Expand Down
5 changes: 0 additions & 5 deletions tests/qa/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ def test_case_g(self, *args):
self.run_evaluation(cfg)
self.assertEqual(1, 1)

def test_case_h(self, *args):
cfg = self.get_runpath('h')
self.run_evaluation(cfg)
self.assertEqual(1, 1)


@patch.object(Experiment, "generate_report")
@patch.object(Experiment, "plot_forecasts")
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def test_argprep(self):
with open(os.path.join(model_path, "input", "args.txt"), "w") as args:
args.write("start_date = foo\nend_date = bar")

model = self.init_model("a", model_path, func="func")
model = self.init_model("a", model_path, func="func", build='docker')
start = datetime(2000, 1, 1)
end = datetime(2000, 1, 2)
model.stage([[start, end]])
Expand Down

0 comments on commit 5f59334

Please sign in to comment.