Skip to content

Commit

Permalink
Merge pull request #55 from GeoscienceAustralia/NPI-3501-bug-fix-for-…
Browse files Browse the repository at this point in the history
…better-input-checks

NPI-3501 bug fix for issue introduced with improved input checks
  • Loading branch information
ronaldmaj authored Sep 20, 2024
2 parents a5f90ff + 3708823 commit bd9c1e8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gnssanalysis/filenames.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion gnssanalysis/gn_io/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gnssanalysis/gn_io/nanu.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bd9c1e8

Please sign in to comment.