Skip to content

Commit

Permalink
Changes to example notebook and environment.yml addressing #18,#21,#22,
Browse files Browse the repository at this point in the history
…#23; fix bug caught by pre-commit in cstar_case.py
  • Loading branch information
“Dafydd committed Aug 16, 2024
1 parent 138d609 commit 24cca5f
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 74,211 deletions.
4 changes: 2 additions & 2 deletions ci/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ dependencies:
- compilers
- netcdf-fortran
- mpich
- nco
- ncview
- xarray
- netCDF4
45 changes: 0 additions & 45 deletions cstar_ocean/.pre-commit-config.yaml

This file was deleted.

20 changes: 12 additions & 8 deletions cstar_ocean/cstar_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,13 @@ def persist(self, filename: str):

# Add start date to valid_date_range if it exists
if self.valid_start_date is not None:
bp_dict["registry_attrs"].setdefault("valid_date_range", {})["start_date"] = str(self.valid_start_date)
bp_dict["registry_attrs"].setdefault("valid_date_range", {})[
"start_date"
] = str(self.valid_start_date)
if self.valid_end_date is not None:
bp_dict["registry_attrs"].setdefault("valid_date_range", {})["end_date"] = str(self.valid_end_date)
bp_dict["registry_attrs"].setdefault("valid_date_range", {})["end_date"] = (
str(self.valid_end_date)
)

bp_dict["components"] = []

Expand Down Expand Up @@ -577,12 +581,12 @@ def persist(self, filename: str):
# Create a dictionary of file_info for each dataset file:
if "files" not in input_dataset_info[dct_key].keys():
input_dataset_info[dct_key]["files"] = []
file_info={"source":ind.source,"hash":ind.file_hash}
if hasattr(ind,"start_date"):
file_info["start_date"]=ind.start_date
if hasattr(ind,"end_date"):
file_info["end_date"]=ind.end_date
file_info = {"source": ind.source, "hash": ind.file_hash}
if hasattr(ind, "start_date"):
file_info["start_date"] = str(ind.start_date)
if hasattr(ind, "end_date"):
file_info["end_date"] = str(ind.end_date)

input_dataset_info[dct_key]["files"].append(file_info)

component_info["input_datasets"] = input_dataset_info
Expand Down
Loading

0 comments on commit 24cca5f

Please sign in to comment.