-
Notifications
You must be signed in to change notification settings - Fork 76
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
Set time arrays explicitly to datetime64[ns] in parsers; remove ZarrCombine & duplicate / old ping_time stuff [all tests ci] #1117
Set time arrays explicitly to datetime64[ns] in parsers; remove ZarrCombine & duplicate / old ping_time stuff [all tests ci] #1117
Conversation
…nce new run-time warning
Codecov Report
@@ Coverage Diff @@
## dev #1117 +/- ##
==========================================
+ Coverage 78.27% 80.40% +2.12%
==========================================
Files 65 64 -1
Lines 6265 6037 -228
==========================================
- Hits 4904 4854 -50
+ Misses 1361 1183 -178
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
…ence new run-time warning
@leewujung let's see if the CI's all pass. Based on a limited EK80 test I ran, all the ek80 warnings are gone. But I'm puzzled why changing this "[ms]" occurrence below results in an error: echopype/echopype/convert/parse_base.py Lines 117 to 119 in cd52645
Please take a look at both the changes I made and whether any more changes need to be made. |
@emiliom: so for that timestamp setting issue related to |
for more information, see https://pre-commit.ci
I ran all the convert tests locally, and there is one test failing
@emiliom : do you know what this is? I don't remember anything about it and haven't tried to look into that file, but it seems that there's a duplicated ping_time and it gets correctly automatically (??) and then the original timestamps are preserved in the Provenance group? |
Hmm. I've confirmed the test failure locally. I've been looking into it and making some headway in understanding the problem. But I'm also puzzled that in this PR, the test CI's for 3.9 and 3.10 are displayed as successful, but when you actually drill in to the test details (eg, https://github.com/OSOceanAcoustics/echopype/actions/runs/5843062232/job/15844826484?pr=1117#step:14:490), the error is actually there! I specifically added the |
Ok, I think I know what's going on. What I was able to trace include the following:
In terms of actions, my thoughts are:
Also, I am still not sure why the two I'll next look into the various |
Some more messing around revealed the different timestamps resulted from Using the file in
These values do not have practical differences, and we can make the test pass by either using index-based selection or doing The puzzling results of duplicated timestamp
I decided to dig deeper into where the timestamp came from (in echopype/echopype/convert/utils/ek_date_conversion.py Lines 26 to 56 in 6b734eb
Taking the value returned by this function, the following illustrates what's going on: Even though these are not really of practical difference, it seems that the change we're making here to change to using @emiliom : I'll change all the tests to just grab the first ping time based on index, and wait for you to chime in here before any further actions. |
…set to isel for ping_time instead of actual timestamp values
…esolution to ns eliminated the previous identification of duplicates
…e Provenance variable
Thanks @leewujung ! I reviewed the issues, and came to agreement with your recommendations. I opened a new issue, #1122, to give more visibility to the larger changes we're talking about here, for future reference. I tried to do the removal of With respect to the deletion of the Regarding the impact of dt_str = '2001-01-01T00:00:00.923654'
np.datetime64(dt_str, 's')
Out[27]: numpy.datetime64('2001-01-01T00:00:00')
np.datetime64(dt_str, 'ms')
Out[28]: numpy.datetime64('2001-01-01T00:00:00.923')
np.datetime64(dt_str, 'ns')
Out[29]: numpy.datetime64('2001-01-01T00:00:00.923654000') Previously, with "ms", the original, finer resolution would've been clipped to "ms", then reset to "ns" with zero padding (+/- floating point error) in the backend to adhere to the Pandas < 2.0 limitation. |
This is now ready to merge. |
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, I think we can merge this now!
We're now getting these run-time warnings on
open_raw
:There don't seem to be any actual, negative consequences, but it's off-putting and unnecessarily concerning to users. For EK80, there are about 20 of these warnings being generated!
The warnings are likely resulting from the unppinning of Pandas, which now results in Pandas 2 being used.
The solution is to recast or explicitly set every parsed time array to datetime64[ns], in the parsers.