Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
b8raoult committed May 9, 2024
1 parent 1c3b8e3 commit f5777cc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/ai_models/outputs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ def write(self, data, *args, check=False, **kwargs):


class HindcastReLabel:
def __init__(self, owner, output, hindcast_reference_year, hind_cast_reference_date, **kwargs):
def __init__(self, owner, output, hindcast_reference_year=None, hindcast_reference_date=None, **kwargs):
self.owner = owner
self.output = output
self.hindcast_reference_year = int(hindcast_reference_year) if hindcast_reference_year else None
self.hind_cast_reference_date = int(hind_cast_reference_date) if hind_cast_reference_date else None
assert self.hindcast_reference_year is not None or self.hind_cast_reference_date is not None
self.hindcast_reference_date = int(hindcast_reference_date) if hindcast_reference_date else None
assert self.hindcast_reference_year is not None or self.hindcast_reference_date is not None

def write(self, *args, **kwargs):
if "hdate" in kwargs:
Expand All @@ -100,8 +100,8 @@ def write(self, *args, **kwargs):
if hdate is not None:
# Input was a hindcast
referenceDate = (
self.hind_cast_reference_date
if self.hind_cast_reference_date is not None
self.hindcast_reference_date
if self.hindcast_reference_date is not None
else self.hindcast_reference_year * 10000 + date % 10000
)
assert date == referenceDate, (
Expand All @@ -114,8 +114,8 @@ def write(self, *args, **kwargs):
kwargs["hdate"] = hdate
else:
referenceDate = (
self.hind_cast_reference_date
if self.hind_cast_reference_date is not None
self.hindcast_reference_date
if self.hindcast_reference_date is not None
else self.hindcast_reference_year * 10000 + date % 10000
)
kwargs["referenceDate"] = referenceDate
Expand Down

0 comments on commit f5777cc

Please sign in to comment.