Skip to content

Commit

Permalink
Update transfer_function_kernel.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kujaku11 committed Jan 18, 2025
1 parent bf85ce9 commit fe2ad47
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions aurora/pipelines/transfer_function_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,13 @@ def apply_clock_zero(self, dec_level_config):
def all_fcs_already_exist(self) -> bool:
"""Return true of all FCs needed to process data already exist in the mth5s"""
if self.kernel_dataset.df["fc"].isna().any():
self.check_if_fcs_already_exist()
has_fcs = self.check_if_fcs_already_exist()
if not has_fcs:
self.kernel_dataset.df["fc"] = self.kernel_dataset.df[
"fc"
].fillna(False)

# these should all be booleans now
print(self.kernel_dataset.df["fc"])
assert not self.kernel_dataset.df["fc"].isna().any()

return self.kernel_dataset.df.fc.all()
Expand Down Expand Up @@ -242,10 +245,12 @@ def check_if_fcs_already_exist(self):
if self.dataset_df["fc"].all():
msg = "All fc_levels already exist"
msg += "Skip time series processing is OK"
logger.info(msg)
return True
else:
msg = f"Some, but not all fc_levels already exist = {self.dataset_df['fc']}"
logger.info(msg)
return True
logger.info(msg)
return False
else:
msg = "FC levels not present"
logger.info(msg)
Expand Down

0 comments on commit fe2ad47

Please sign in to comment.