diff --git a/docs/whats_new.md b/docs/whats_new.md index 2a38359..0739206 100644 --- a/docs/whats_new.md +++ b/docs/whats_new.md @@ -1,5 +1,9 @@ # What's New +## Unreleased + +* Suffix for parquet file format is now ".parquet" instead of ".parq". + ## v0.11.1 (February 4, 2025) * Move known model hard-wired model times into the class so they are refreshed each time the library is read. diff --git a/particle_tracking_manager/the_manager.py b/particle_tracking_manager/the_manager.py index 712eadb..0aac27b 100644 --- a/particle_tracking_manager/the_manager.py +++ b/particle_tracking_manager/the_manager.py @@ -213,7 +213,7 @@ def __init__( 2021, 8, 31, 19, 0, 0 ) self.__dict__["ciofs_operational_end_time"] = ( - pd.Timestamp.now() + pd.Timedelta("48H") + pd.Timestamp.now() + pd.Timedelta("48h") ).to_pydatetime() self.__dict__["ciofs_end_time"] = datetime.datetime(2023, 1, 1, 0, 0, 0) self.__dict__["nwgoa_end_time"] = datetime.datetime(2009, 1, 1, 0, 0, 0) @@ -253,7 +253,9 @@ def __init__( output_file = f"output-results_{datetime.datetime.now():%Y-%m-%dT%H%M:%SZ}" # want output_file to not include any suffix - output_file = output_file.rstrip(".nc").rstrip(".parq") + output_file = ( + output_file.replace(".nc", "").replace(".parquet", "").replace(".parq", "") + ) ## set up log for this simulation # Create a file handler @@ -476,7 +478,7 @@ def __setattr__(self, name: str, value) -> None: output_file = str(pathlib.Path(output_file).with_suffix(".nc")) elif self.output_format == "parquet": output_file = str( - pathlib.Path(output_file).with_suffix(".parq") + pathlib.Path(output_file).with_suffix(".parquet") ) else: raise ValueError( diff --git a/tests/test_manager.py b/tests/test_manager.py index 964e1d2..f96646b 100644 --- a/tests/test_manager.py +++ b/tests/test_manager.py @@ -405,6 +405,9 @@ def test_log_name(): m = ptm.OpenDriftModel(output_file="newtest.parq") assert m.logfile_name == "newtest.log" + m = ptm.OpenDriftModel(output_file="newtest.parquet") + assert m.logfile_name == "newtest.log" + if __name__ == "__main__": unittest.main() diff --git a/tests/test_opendrift.py b/tests/test_opendrift.py index 909a2b0..bc17452 100644 --- a/tests/test_opendrift.py +++ b/tests/test_opendrift.py @@ -326,7 +326,7 @@ def test_output_file(): """make sure output file is parquet if output_format is parquet""" m = OpenDriftModel(output_format="parquet") - assert m.output_file.endswith(".parq") + assert m.output_file.endswith(".parquet") m = OpenDriftModel(output_format="netcdf") assert m.output_file.endswith(".nc")