-
Notifications
You must be signed in to change notification settings - Fork 9
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-3669 Migrate SP3 transform and trim, introduce minimal SP3 creation utility script #63
NPI-3669 Migrate SP3 transform and trim, introduce minimal SP3 creation utility script #63
Conversation
…r codebase), add more trimming options, introduce utility script for making minimal SP3 files, primarily intended for unit tests
It turns out the approach taken to store the SV counts in the header, isn't currently compatible with the way we merge header attributes when combining DataFrames. |
…() including new functionality to take first n epochs
…date test_file_creation_util.py
After this PR is merged, we should make another dev release (probably |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As always, great PR. I've just chucked in a couple comments to extend the doc-strings for the new functions coming in. After that I think this is good to go in
@@ -226,6 +228,65 @@ def remove_offline_sats(sp3_df: _pd.DataFrame, df_friendly_name: str = ""): | |||
return sp3_df | |||
|
|||
|
|||
def filter_by_svs( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very useful function and I've tested it now on a sample SP3 file - works great!
…future work, added check for incompatible arg combination to trim_df()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple minor things to fix up with docStrings
gnssanalysis/gn_io/sp3.py
Outdated
def sp3_hlm_trans( | ||
a: _pd.DataFrame, | ||
b: _pd.DataFrame, | ||
) -> tuple[_pd.DataFrame, list]: | ||
""" | ||
Rotates sp3_b into sp3_a. | ||
|
||
:param DataFrame a: The sp3_a DataFrame. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DataFrame
--> _pd.DataFrame
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I changed this one to be more generic because that seemed more readable (given the renamed import is an internal thing). If it's parsed by an IDE I can see that backfiring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In other parts of the code, we have pandas.DataFrame
. We should standardise on one format for docstrings. One of:
DataFrame
pandas.DataFrame
_pd.DataFrame
(looks non-standard for human use but may have the benefit of being resolvable in our context by an IDE.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These have now been updated to fit the convention applied to the majority of code in this codebase, which is using the imported module name, e.g. _pd.DataFrame
…PR comments - similar fixes to parallel pr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks for pushing those changes through - I think it is good to go in now 👍
Also adds an additional SP3 trimming option, on top of what existed in the original version.
The new utility script is primarily intended for making minimal SP3 files for unit tests.
Speaking of unit tests:
filter_by_svs()
: test now donetransform_sp3()
: not practical to unit test. It's a wrapper for file read (including parse) / transform / write (including generate), so we should test the parse, generate and various transforming functions in isolation.