Skip to content

Commit

Permalink
Merge pull request #34 from axiom-data-science/fix_errpr
Browse files Browse the repository at this point in the history
output file error fix
  • Loading branch information
kthyng authored Nov 14, 2024
2 parents 4ac521c + 71d36e6 commit 40d4e12
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions particle_tracking_manager/the_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ class ParticleTrackingManager:
seed_seafloor: bool
output_file: str
output_format: str
output_file_initial: Optional[str]

def __init__(
self,
Expand Down Expand Up @@ -223,6 +224,8 @@ def __init__(
self.__dict__["has_run_seeding"] = False
self.__dict__["has_run"] = False

self.output_file_initial = None

# Set all attributes which will trigger some checks and changes in __setattr__
# these will also update "value" in the config dict
for key in sig.parameters.keys():
Expand Down Expand Up @@ -383,9 +386,10 @@ def __setattr__(self, name: str, value) -> None:
)

# make new attribute for initial output file
self.output_file_initial = str(
pathlib.Path(f"{output_file}_initial").with_suffix(".nc")
)
if self.output_file_initial is None:
self.output_file_initial = str(
pathlib.Path(f"{output_file}_initial").with_suffix(".nc")
)

if self.output_format is not None:
if self.output_format == "netcdf":
Expand Down

0 comments on commit 40d4e12

Please sign in to comment.