-
Notifications
You must be signed in to change notification settings - Fork 48
Configure specific warnings #401
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
Conversation
… strings is deprecated.
…ead_csv is deprecated.
…read_csv is deprecated.
…ll be removed in a future version. To retain the old behavior, explicitly call `result.infer_objects(copy=False)`. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`
…tamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC)
|
With regards to There are two places we use this: |
… is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC)
|
The tests are largely passing now except for an issue with the runner being overloaded and not working. The ADCP TRTS notebook was taking longer to run (limit was 20 minutes) so I bumped the limit up to 40 minutes to check the time required and it's back down to 18 now so not sure what was going on there. Either way it's working now and has a similar run time as previously. |
| ######### IMPORTANT ######### | ||
| # Note the use of `utcfromtimestamp` here, rather than `fromtimestamp` | ||
| # This is CRITICAL! See the difference between those functions here: | ||
| # https://docs.python.org/3/library/datetime.html#datetime.datetime.fromtimestamp | ||
| # Long story short: `fromtimestamp` used system-specific timezone | ||
| # info to calculate the datetime object, but returns a | ||
| # timezone-agnostic object. | ||
| if offset_hr != 0: | ||
| delta = timedelta(hours=offset_hr) | ||
| time = [datetime.utcfromtimestamp(t) + delta for t in ep_time] | ||
| time = [ | ||
| datetime.fromtimestamp(t, timezone.utc).replace(tzinfo=None) + delta | ||
| for t in ep_time | ||
| ] | ||
| else: | ||
| time = [datetime.utcfromtimestamp(t) for t in ep_time] | ||
| time = [ | ||
| datetime.fromtimestamp(t, timezone.utc).replace(tzinfo=None) | ||
| for t in ep_time | ||
| ] |
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.
@jmcvey3 can you review this solution to using datetime.utcfromtimestamp()? I don't know the timeline on deprecation but we'll have to move away from this eventually
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.
@akeeste Yeah we discovered a long time ago that using the "fromtimestamp" function returns a different result depending on what timezone your local machine is running in. Using "utcfromtimestamp" was the only way to guarantee that the epoch time in seconds (what those return) is always the same value.
I think your solution here will work
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.
Got it, thanks @jmcvey3. I saw the same behavior when fromtimestamp is used without a timezone argument. Using it with timezone.utc however gives an identical datetime as utcfromtimestamp but with timezone metadata. I scrub tzinfo from the output to match exactly what utcfromtimestamp returns.
This reverts commit c04d121.
This PR removes the ignore all future warnings added when some packages were suggesting updating to numpy 2.0 but mhkit needed other packages to update before that could happen. --------- Co-authored-by: akeeste <[email protected]>
v1.0.0 # MHKiT v1.0.0 ## New Features * Sound Exposure Level by @jmcvey3 in #388 * Add discharge function to MHKiT by @jmcvey3 in #385 ## Functionality enhancements * Fix for corrupted Nortek files by @jmcvey3 in #372 * Update integral length scale function by @jmcvey3 in #376 * Fix ever-changing RDI RiverPro depth bin ranges by @jmcvey3 in #378 * Allow clean functions to handle _avg variables by @jmcvey3 in #377 * IEC TS 62600 updates by @akeeste in #382 * MLER explanation updates/corrections by @rgcoe in #393 * Improve Nortek2 index file creator functions by @jmcvey3 in #397 * Read Sentinel V specific data packets by @jmcvey3 in #396 * Short list of VMDAS updates by @jmcvey3 in #405 * Allow user to specify universal Kolmogorov constant for TKE dissipation rate function by @jmcvey3 in #406 * Nortek Dual Profile Dataset Rotation by @jmcvey3 in #414 ## Source code improvements * Lint Tidal by @ssolson in #386 * Lint river module by @ssolson in #389 * Lint hindcast by @ssolson in #398 * Modernize Package Configuration by @ssolson in #400 * Configure specific warnings by @ssolson in #401 ## Bug fixes * Avoid failing to scan very large files by @jmcvey3 in #371 * Acoustics SPL bugfix by @jmcvey3 in #379 * DOLfYN/RDI: Set `fs` to NaN when typical calculation methods yield error (#408) by @simmsa in #409 ## Testing and Continuous Integration Updates * Fix Jupyter Notebook tests running Python 3.13 by @ssolson in #380 * CI Test Clean Up: Mock USGS, Acoustic Tolerances by @ssolson in #404 * Speed up tests with concurrency checks to prevent duplicate workflows on PRs from develop into main or from main into develop by @akeeste * Define MPLBACKEND to decrease intermittent matplotlib errors in tests by @akeeste ## Documentation and Examples * Add WEC-Sim power performance example by @akeeste in #395 * Update dolfyn function docstrings and associated notebooks by @jmcvey3 in #412 * Update examples by @akeeste in #417 * Update installation instructions in README.md by @akeeste * Adjust acoustics test tolerances by @akeeste in #420 **Full Changelog**: v0.9.0...v1.0.0
This PR removes the ignore all future warnings added when some packages were suggesting updating to numpy 2.0 but mhkit needed other packages to update before that could happen.