Skip to content

Commit

Permalink
use properties
Browse files Browse the repository at this point in the history
  • Loading branch information
b8raoult committed Oct 16, 2024
1 parent a355ad3 commit ecbd0e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/anemoi/transform/variables/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ def __eq__(self, other) -> bool:
return False
return self.name == other.name

@property
@abstractmethod
def is_pressure_level(self):
pass

@property
@abstractmethod
def level(self):
pass
2 changes: 2 additions & 0 deletions src/anemoi/transform/variables/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ def __init__(self, name, data: dict) -> None:
super().__init__(name)
self.data = data

@property
def is_pressure_level(self):
return self.data.get("levtype", None) == "pl"

@property
def level(self):
return self.data.get("levelist", None)

Expand Down

0 comments on commit ecbd0e5

Please sign in to comment.