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

Sp3 changes + unittesting #32

Merged
merged 30 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
fe3b989
testing new sp3reading
seballgeyer Jul 4, 2024
29be020
chore: mostly formating, extract read block sp3
seballgeyer Jul 18, 2024
0b56e60
Merge branch 'main' into sp3Changes Manual resolution in sp3
seballgeyer Jul 18, 2024
a10301a
fix: post merge fix
seballgeyer Jul 18, 2024
0c68aaf
chore: Handle file not found and generic exceptions in path2bytes fun…
seballgeyer Jul 18, 2024
bb07e60
feat: Add unit tests for GPSDate class
seballgeyer Jul 18, 2024
0c54473
chore: updating test_aux
seballgeyer Jul 18, 2024
948837a
refactor: Signature to use square brackets for tuple annotation
seballgeyer Jul 18, 2024
8401b57
chore: Refactor code to use float64 dtype for rotation matrix in gn_t…
seballgeyer Jul 18, 2024
8edaade
add: pipeline CICD unittesting
seballgeyer Jul 18, 2024
1518b1c
fix: quote
seballgeyer Jul 18, 2024
5c82dd6
fix: more dependencies
seballgeyer Jul 18, 2024
d89290d
fix: even more pip install
seballgeyer Jul 18, 2024
de7507e
fix: more pip packages
seballgeyer Jul 18, 2024
f46e274
test: adding some of my easy unittest for read sp3.
seballgeyer Jul 19, 2024
19e6834
clean: removing print statement
seballgeyer Jul 19, 2024
ce2b885
add: extra small unittest
seballgeyer Jul 22, 2024
eb74bb5
doc: adding doc
seballgeyer Jul 22, 2024
9523322
Merge remote-tracking branch 'origin/sp3Changes' into sp3Changes
seballgeyer Jul 22, 2024
fefbaba
fix: typo in type hint
seballgeyer Jul 22, 2024
e7a4747
doc: more doc and type hints.
seballgeyer Jul 22, 2024
0820e59
doc: more docs.
seballgeyer Jul 22, 2024
59c04f8
refac: reducing size of read_sp3.
seballgeyer Jul 24, 2024
a8bcf60
add: implementation of the requirements.txt file.
seballgeyer Jul 24, 2024
1631d32
fix: sp3 veloctity determination.
seballgeyer Jul 24, 2024
fe81af2
review: answering comments
seballgeyer Jul 24, 2024
9e96872
temp changes for Eugene
seballgeyer Jul 25, 2024
0f9fc27
fix: WIP better temporary solution, just fail if velocities are in SP3
seballgeyer Jul 25, 2024
f8e6493
fix: handling of velocities in SP3
seballgeyer Jul 25, 2024
1dc5be6
review: answering comment.
seballgeyer Jul 25, 2024
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
21 changes: 21 additions & 0 deletions .github/workflows/python-cicd-units.yaml
seballgeyer marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Python CICD pipelines - Unittesting

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
seballgeyer marked this conversation as resolved.
Show resolved Hide resolved
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install boto3 click hatanaka matplotlib numpy pandas plotext==4.2 plotly pymongo pytest scipy tqdm unlzw3 typing_extensions
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This duplicates specification of our requirements. It's not as simple as just pointing at requirements.txt though, as there isn't one.

Requirements are specified in setup.py, though that could be modified to read them from a requirements.txt file for consistency... I prototyped that idea and it works, but it's hacky because I have to handle possible commenting. Time for me to read about the differences between setup.py and requirements.txt and how to do this properly...

- name: Run tests
run: |
python -m unittest discover -s tests -v
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ __pycache__
.vscode
.idea
# Other files
scratch
scratch/
21 changes: 14 additions & 7 deletions gnssanalysis/gn_io/common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Base functions for file reading"""

import base64 as _base64
import gzip as _gzip
import hashlib as _hashlib
Expand Down Expand Up @@ -27,13 +28,19 @@ def path2bytes(path: _Union[_Path, str, bytes]) -> bytes:

if isinstance(path, _Path):
path = path.as_posix()

if path.endswith(".Z"):
databytes = _lzw2bytes(path)
elif path.endswith(".gz"):
databytes = _gz2bytes(path)
else:
databytes = _txt2bytes(path)
try:
if path.endswith(".Z"):
databytes = _lzw2bytes(path)
elif path.endswith(".gz"):
databytes = _gz2bytes(path)
else:
databytes = _txt2bytes(path)
except FileNotFoundError:
_logging.error(f"File {path} not found. Returning empty bytes.")
return None
except Exception as e:
_logging.error(f"Error reading file {path} with error {e}. Returning empty bytes.")
return None
return databytes


Expand Down
Loading
Loading