-
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-3388 Pandas deprecation fixes and improved SP3 rendering capability (moon orbit capability 🌚 ) #72
Conversation
…s-deprecation-fixes
…er. Failed on previous attempt but pulled it off this time.
…improve clarity and allow reuse
…ues, reducing conversion steps for output formatting
…for each sp3 epoch
…ing, thanks to updated formatting approach. Add some helpful comments and placeholders from an old stash.
…ed crash on pipeline
…no difference to crash
…n test crashing during sp3 write
…his was missed before
…formatting. This is why the values had initially been misaligned
…frame index while reading an sp3 file with velocities. I have never seen this in practice, but demonstrated it in testing.
Further update made to address misalignment of values with full width enabled. It turns out the nodata strings needed updating. |
…ation about why a test including gen_sp3_content() does not use a mock file for input.
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.
This is awesome, I've just tested this against the unit-tests and all deprecations warnings are now gone (from what I can see). Very happy for this to go in 👍
This PR has been a while in the making. 😅
The motivation for this work, was fixing deprecation issues which would prevent upgrading to Pandas 3.
One of these issues required changing the way
gen_sp3_content()
renders values within each epoch.We previously found and replaced
NaN
s with string nodata values, within theDataFrame
itself. This represented double-handling and is also not allowable in Pandas 3 as it mixed datatypes within a column (we were putting a string nodata value in a numeric column when we found aNaN
or+/-inf
).We how handle formatting of
inf
andNaN
values at the point of rendering, usingStyler
'sformat()
,hide()
, andto_string()
functions. This means less double-handling and should improve performance and code clarity. ✨Switching to
Styler
also had an unexpected bonus 🎉 :Styler
'sto_string()
has adelimiter
parameter, and setting this to an empty string allows us to disable padding between columns (which had previously been a bugbear).This change in turn allows us to format position and clock values at the correct width, removing a known limitation in the SP3 rendering code.
Now we can output a file with an orbit as large as that of the moon. 🌚 But we'd probably never need to.