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

NPI-3501 bug fix for issue introduced with improved input checks #55

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
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
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
Loading