Skip to content

Commit

Permalink
update variables
Browse files Browse the repository at this point in the history
  • Loading branch information
b8raoult committed Oct 25, 2024
1 parent 1cd2642 commit 8d9e071
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/anemoi/transform/variables/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,7 @@ def level(self):
@abstractmethod
def is_constant_in_time(self):
pass

@property
def grib_keys(self):
raise NotImplementedError(f"Method `grib_keys` not implemented for {self.__class__.__name__}")
8 changes: 8 additions & 0 deletions src/anemoi/transform/variables/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ def is_from_input(self):
def is_computed_forcing(self):
return self.data.get("computed_forcing", False)

@property
def is_accumulation(self):
return self.data.get("process") == "accumulation"

@property
def grib_keys(self):
return self.data.get("mars", {})


class VariableFromDict(VariableFromMarsVocabulary):
"""A variable that is defined by a user provided dictionary."""
Expand Down

0 comments on commit 8d9e071

Please sign in to comment.