Skip to content

Commit

Permalink
Add defaults to validate_environment (#68)
Browse files Browse the repository at this point in the history
* Add defaults

* Update deps
  • Loading branch information
HCookie authored Dec 3, 2024
1 parent 06292f9 commit 97fa2a5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ classifiers = [
dynamic = [ "version" ]
dependencies = [
"anemoi-transform>=0.1",
"anemoi-utils[text]>=0.4.9",
"anemoi-utils[text,provenance]>=0.4.9",
"aniso8601",
"anytree",
"earthkit-data>=0.11.2",
Expand Down
8 changes: 7 additions & 1 deletion src/anemoi/inference/checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,13 @@ def default_namer(self, *args, **kwargs):
def report_error(self):
self._metadata.report_error()

def validate_environment(self, *, all_packages, on_difference, exempt_packages):
def validate_environment(
self,
*,
all_packages: bool = False,
on_difference: str = "warn",
exempt_packages: list[str] | None = None,
) -> bool:
return self._metadata.validate_environment(
all_packages=all_packages, on_difference=on_difference, exempt_packages=exempt_packages
)
Expand Down
2 changes: 1 addition & 1 deletion src/anemoi/inference/provenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@


def validate_environment(
metadata: Metadata,
metadata: "Metadata",
*,
all_packages: bool = False,
on_difference: Literal["warn", "error", "ignore"] = "warn",
Expand Down

0 comments on commit 97fa2a5

Please sign in to comment.