From 37088236114366f4242d98176330411e2660ee0c Mon Sep 17 00:00:00 2001 From: Nathan <95725385+treefern@users.noreply.github.com> Date: Wed, 18 Sep 2024 07:40:15 +0000 Subject: [PATCH] NPI-3501 bug fix for missed usage of old parameter name. Improved docstring and misc comment. --- gnssanalysis/filenames.py | 2 +- gnssanalysis/gn_io/common.py | 2 +- gnssanalysis/gn_io/nanu.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gnssanalysis/filenames.py b/gnssanalysis/filenames.py index 8de0644..0eb0d78 100644 --- a/gnssanalysis/filenames.py +++ b/gnssanalysis/filenames.py @@ -349,7 +349,7 @@ def nominal_span_string(span_seconds: float) -> str: # That is, if a span is longer than a day, then we will ignore any deviation from an # integer day that is smaller than an hour. But a time of 2 days, 3 hours and 30 # minutes will be reported as 27 hours. - # If this would result in more than 99 periods, we return the 00U invalid code instead. + # If this would result in a value above 99 in the determined unit, we return the 00U invalid code instead. # We ignore months, because they're a little weird and not overly helpful. if span_seconds >= sec_in_year: if (span_seconds % sec_in_year) < gn_const.SEC_IN_WEEK: diff --git a/gnssanalysis/gn_io/common.py b/gnssanalysis/gn_io/common.py index f043fa2..d30e274 100644 --- a/gnssanalysis/gn_io/common.py +++ b/gnssanalysis/gn_io/common.py @@ -20,7 +20,7 @@ def path2bytes(path_or_bytes: _Union[_Path, str, bytes]) -> bytes: Passes through bytes if given, thus one may not routinely leave it in the top of the specific file reading function and be able to call it with bytes or str path without additional modifications. - :param str path: input file path + :param Path | str | bytes path_or_bytes: input file path as a Path or string, or bytes object to pass through :return bytes: bytes object, decompressed if necessary :raise FileNotFoundError: path didn't resolve to a file :raise Exception: wrapped exception for all other exceptions raised diff --git a/gnssanalysis/gn_io/nanu.py b/gnssanalysis/gn_io/nanu.py index 47ad7ee..1e3513e 100644 --- a/gnssanalysis/gn_io/nanu.py +++ b/gnssanalysis/gn_io/nanu.py @@ -52,7 +52,7 @@ def read_nanu(path_or_bytes: _Union[str, bytes]) -> dict: :param _Union[str, bytes] path_or_bytes: path to nanu file or a bytes object :return dict: nanu values with parameter names as keys """ - nanu_bytes = _gn_io.common.path2bytes(path=path_or_bytes) + nanu_bytes = _gn_io.common.path2bytes(path_or_bytes) output_dict = {} output_dict["FILEPATH"] = path_or_bytes # TODO change to pathlib output_dict["NANU ID"] = nanu_path_to_id(path_or_bytes)