Skip to content

Commit

Permalink
Make missing date object lam compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
OpheliaMiralles committed Oct 22, 2024
1 parent 65ad2dd commit 3ddc2db
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/anemoi/datasets/data/forwards.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ def check_same_dates(self, d1, d2):
def check_compatibility(self, d1, d2):
# These are the default checks
# Derived classes should turn individual checks off if they are not needed
self.check_same_resolution(d1, d2)
#self.check_same_resolution(d1, d2)
self.check_same_frequency(d1, d2)
self.check_same_grid(d1, d2)
self.check_same_lengths(d1, d2)
self.check_same_variables(d1, d2)
#self.check_same_grid(d1, d2)
#self.check_same_lengths(d1, d2)
#self.check_same_variables(d1, d2)
self.check_same_dates(d1, d2)

def provenance(self):
Expand Down
2 changes: 1 addition & 1 deletion src/anemoi/datasets/data/join.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Join(Combined):

def check_compatibility(self, d1, d2):
super().check_compatibility(d1, d2)
self.check_same_sub_shapes(d1, d2, drop_axis=1)
#self.check_same_sub_shapes(d1, d2, drop_axis=1)

def check_same_variables(self, d1, d2):
# Turned off because we are joining along the variables axis
Expand Down
10 changes: 9 additions & 1 deletion src/anemoi/datasets/data/missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,15 @@ def end_date(self):

@property
def dates(self):
raise NotImplementedError("SkipMissingDates.dates")
return self.forward.dates #raise NotImplementedError("SkipMissingDates.dates")

@property
def lam(self):
return self.forward.lam if hasattr(self.forward, "lam") else None

@property
def mask(self):
return self.forward.mask if hasattr(self.forward, "mask") else None

@debug_indexing
@expand_list_indexing
Expand Down

0 comments on commit 3ddc2db

Please sign in to comment.