Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

output file error fix #34

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading