Mhkit

Latest version: v0.9.0

Safety actively analyzes 706259 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 3

0.9.0

This release includes significant new features, enhancements, bug fixes, and updates to improve the functionality, performance, and compatibility of MHKiT.

New Features

Acoustics Module (349, 359)
- Introduced a new Acoustics module to MHKiT, providing comprehensive tools for processing and analyzing passive acoustic data from hydrophone recordings.
- Designed to facilitate compliance with the IEC-TS 62600-40 standard
- Supports hydrophone models such as SoundTrap and icListen, with functionality to read, calibrate, and process hydrophone data into acoustic metrics.
- Includes functionalities for:
- Reading hydrophone data.
- Performing spectral analyses.
- spectral density (SPSD)
- spectral density levels (SPSDL)
- Fractional octave bands (e.g., third-octave, decidecade)
- Sound Pressure Level (SPL)
- Applying calibrations.
- Calculating sound pressure levels.
- Visualizing results.
- Audio export
- To support users, an example notebook demonstrates the application of this module with workflows.

Strain Processing Example (358)
The Strain Processing example introduces a workflow for analyzing strain gauge data, particularly from tidal turbine blade testing. While the functions are not included as a formal MHKiT module due to the variability of test setups, this example notebook provides a detailed and practical framework for processing such data.

- Illustrates the calibration and processing of strain gauge data, showcasing a real-world application in tidal turbine testing.
- Designed to accommodate the variability in strain gauge testing setups, enabling users to adapt the workflow to their specific needs.
- Includes figures and explanations to contextualize the analysis and support data interpretation.
- Reference:
- Gunawan, B., Haulenbeek, K., Abdellatef, M., Streit, R., Lynn, E., Willis, M., Pendley, D., Gallegos-Patterson, D., Neary, V., Wosnik, M. (2024). Calibration Of Fiber Optic Rosette Sensors For Measuring Bending Moment On Tidal Turbine Blades. International Conference on Ocean Energy, Melbourne, Australia, September 17–19, 2024.

Enhancements and Improvements

Wave Resource Module Performance (352)
Optimizes the wave.resource module to improve performance and resolve issue 331 by transitioning from xarray.Dataset to xarray.DataArray for core functions. Handling edge cases robustly in pure numpy proved challenging, so the adoption of DataArray strikes a balance between performance and usability.
- Transitioning to DataArray provides a significant speed-up—up to 1000x faster for very large datasets compared to the previous Dataset implementation.
- While pure numpy would offer an additional 5-10x speed-up, DataArray ensures better usability and flexibility for both developers and users.
- Restores the speed of MHKiT’s wave resource functions to their previous state, making the module more efficient for users working with large datasets.
- Simplified input handling for `elevation_spectrum` and `surface_elevation` functions.

Surface Elevation Method Selection (340, 336)
- Enhanced `surface_elevation` function to handle spectra without a zero frequency index.
- Introduced an auto method for surface elevation calculations that selects the most suitable computation method based on the input spectrum:
- Automatically switches to `sum_of_sines` method when Inverse Fast Fourier Transform (IFFT) is not computable.
- Added warnings to inform users of method changes.
- Added an optional `frequency_dimension` parameter across all necessary wave.resource functions for better flexibility.

DOLfYN Cleaning Functions Update (354)
- Renamed and enhanced water depth calculation and surface interference removal functions for improved robustness.
- Added an optional frequency_dimension parameter to relevant wave.resource functions, including significant_wave_height and others, to improve compatibility with xarray formats and enhance input flexibility.
- Fixed issues identified in Issue 308 .

Reynolds Stress ADCP Estimation Notebook Improvements (326)
- Removed the `total_tke` function due to limitations of ADCP measurements in accurately estimating smaller turbulent scales and components of TKE.
- Clarified the assumptions required for ADCP measurements:
- Assumption of Homogeneity: Minimal vertical motion between beam measurements.
- Spatial Resolution: Turbulent scales smaller than the beam distance cannot be resolved.
- Expanded explanations of TKE shear production, emphasizing the limitations of ADCP-derived Reynolds stress and TKE estimations compared to point measurements from ADV and shear probes.
- Corrected heading rotation logic to prevent rotation beyond 360 degrees.
- Expanded the ADV notebook to cover all relevant functions, emphasizing the accuracy and reliability of ADV measurements for TKE components and Reynolds stress.

Type Handling Improvements (348)
- Fixed a bug in wave performance Mean Annual Energy Production (MAEP) matrix calculation (Issue 339).
- Improved type handling between `Datasets` and `DataArrays`, enhancing function robustness.

NOAA Request Function Update (332)
- Fixed imprecise error handling in `mhkit.tidal.io.noaa.request_noaa_data` to ensure meaningful and actionable error messages.
- Enhanced functionality to support additional NOAA data request parameters (e.g., `datum`) for variables such as water level, water temperature, and salinity.
- Fixed Issue 223.

Bug Fixes

Numpy 2.0 Compatibility (333)
- Made MHKiT compatible with Numpy 2.0.

Flow Duration Curve Plot Bug Fix (365)
- Fixed a bug in the flow duration curve plotting function related to matplotlib >= 3.8.
- Corrected the `sortby` assignment to use the correct value.

Matplotlib Version Compatibility (345, 365)
- Removed the matplotlib version check previously required for versions < 3.8.0.
- Ensured compatibility with matplotlib >= 3.8.

Python 3.12 Support (351)
- Added support for Python 3.12.

Documentation Build Warnings Fix (360)
- Fixed minor spacing and formatting issues in the documentation that were causing warnings during the build process.



Testing and Continuous Integration Updates

GitHub Actions Enhancements (330, 350, 357)
- **Notebook Testing**: Added a GitHub Action to test example notebooks as part of the Continuous Deployment (CD) pipeline.
- Implemented a timeout feature to fail notebooks that exceed a specified execution time.
- **PyLint Enforcement**: Made the `utils` module PyLint compatible and enforced this compatibility via GitHub Actions.
- **Testing Environment Consistency**: Updated the GitHub Actions testing environment to use the conda `environment.yml` file for consistency.
- **Pylint Settings Update**: Updated Pylint settings and disabled specific warnings as necessary.

Wind Toolkit Tests Optimization (338)
- Optimized the Wind Toolkit tests, reducing test runtime from over 3.5 hours to approximately 2 hours by modifying the test data and aligning it with cached data used in the notebooks.
- Replaced test data with smaller, representative datasets, improving efficiency without sacrificing robustness.
- Ensured consistent use of cached data between hindcast tests and notebooks to minimize redundant API requests and reduce reliance on live NREL server calls.

MacOS Tests Fix (362)
- Adjusted test tolerances to fix failing tests on MacOS systems.

Documentation and Examples

Updated Examples and Notebooks (352, 359, 358)
- Updated Jupyter notebooks for the new Acoustics module.
- Fixed typos and updated examples in notebooks, including the Pacwave and CDIP examples.
- Enhanced strain processing example with additional figures and context.

Other Changes

MHKiT Version Update (346, 363)
- Bumped MHKiT version to 0.9.0.
- Updated the README to include `conda-forge` in the conda install command for easier installation.

Folium Map Updates (350)
- Updated `folium` map calls in the Pacwave example to align with the latest `folium` API changes.

Use main as the MHKiT default branch (367 )

- Many modern projects use `main` as the default branch, aligning with the GitHub recommendation and broader conventions.
- There is some non-linear history in the previous rebase causing issues between `develop` & `master`
- `main` was created from the current develop branch creating a 1-to-1 liner history between develop and the new main branch

0.8.2

MHKiT v0.8.2, includes bug fixes caused by the latest version of matplotlib. in the example notebooks and fixes the dependencies to requirements updates prior to Numpy 2.0.0.

Fixes MHKIT v0.8.1 runtime issues (345) requiring matplotlib >3.8.0.
- https://github.com/MHKiT-Software/MHKiT-Python/pull/345

Adds ipython notebook tests and drops support for python < 3.10. Additionally improvements were made to the wind toolkit tests taking the testing time from > 4 hours to roughly 2 hours
- https://github.com/MHKiT-Software/MHKiT-Python/pull/330
- https://github.com/MHKiT-Software/MHKiT-Python/pull/338

Improved ADCP TKE example notebook discussion & removal of ADCP TKE function
- https://github.com/MHKiT-Software/MHKiT-Python/pull/326

Updated the `surface_elevation` calculation method to default to `sum_of_sines` when zero frequency is absent
- https://github.com/MHKiT-Software/MHKiT-Python/pull/340

Improved NOAA requests function issue https://github.com/MHKiT-Software/MHKiT-Python/issues/223
- https://github.com/MHKiT-Software/MHKiT-Python/pull/332

0.8.1

MHKiT v0.8.1, includes bug fixes in the example notebooks and fixes the dependencies to requirements updates prior to Numpy 2.0.0.

Fixes MHKIT v0.8.0 installation issues (334) by fixing the dependencies.
- https://github.com/MHKiT-Software/MHKiT-Python/pull/335

Fixes bugs in MHKiT example notebooks
- https://github.com/MHKiT-Software/MHKiT-Python/pull/327

0.8.0

We're excited to announce the release of MHKiT v0.8.0, which brings a host of new features, enhancements, and bug fixes across various modules, ensuring compatibility with Python 3.10 and 3.11, and introducing full xarray support for more flexible data handling. Significant updates in the Wave and DOLfYN modules improve functionality and extend capabilities.

Python 3.10 & 3.11 Support
MHKiT now supports python 3.10 and 3.11. Support for 3.12 will follow in the next minor update.
- https://github.com/MHKiT-Software/MHKiT-Python/pull/240


Wave Module
Enhancements:
**Automatic Threshold Calculation for Peaks-Over-Threshold**: We've introduced a new feature that automatically calculates the "best" threshold for identifying significant wave events. This method, originally developed by Neary, V. S., et al. in their 2020 study, has now been translated from Matlab to Python, enhancing our existing peaks-over-threshold functionality.

**Wave Heights Analysis**: A new function, `wave_heights`, has been added to extract the heights of individual waves from a time series. This function uses zero up-crossing analysis to accurately measure wave heights, improving upon our previous methods which only provided the maximum value between up-crossings.

**Enhanced Zero Crossing Analysis**: Building on the above, the zero crossing code previously embedded in `global_peaks` has been isolated into a helper function. This modular approach not only refines the codebase but also supports new functionalities such as calculating wave heights, zero crossing periods, and identifying crests.

Bug Fixes:
**Contour Sampling Error in Wave Contours**: A bug identified in `mhkit.wave.contours.samples_contour` has been resolved. The issue occurred when period samples defined using the maximum period resulted in values outside the interpolation range of the contour data. This was corrected by ensuring that all sampling points are within the interpolation range and adjusting the contour data selection process accordingly.

- https://github.com/MHKiT-Software/MHKiT-Python/pull/268
- https://github.com/MHKiT-Software/MHKiT-Python/pull/252
- https://github.com/MHKiT-Software/MHKiT-Python/pull/278


Xarray Support
MHKiT functions now fully support the use of xarray for passing and returning data.

- https://github.com/MHKiT-Software/MHKiT-Python/pull/279
- https://github.com/MHKiT-Software/MHKiT-Python/pull/282
- https://github.com/MHKiT-Software/MHKiT-Python/pull/285
- https://github.com/MHKiT-Software/MHKiT-Python/pull/302
- https://github.com/MHKiT-Software/MHKiT-Python/pull/310


DOLfYN

Thanks to the many user contributions and users of MHKiT the DOLFYN module include a significant number of enhancements and bug fixes.

Enhancements:
**Altimeter Support**: Enhanced the Nortek Signature Reader to add capability for reading ADCP dual profile configurations.

**Data Handling Improvements**: Introduced logic to skip messy header data that can accumulate during measurements collected via Nortek software on PCs and Macs.

**Instrument Noise Subtraction**: Added a function to subtract instrument noise from turbulence intensity estimation using RMS calculations, providing results that differ by approximately 1% from the existing standard deviation-based "I" property.

**Improved File Handling**: Updates for RDI files to handle changing "number of cells" and variable "cell sizes," which are now bin-averaged into the largest cell size.

Bug Fixes:
**Power Spectra Calculation**: Fixed a bug where a given noise value was not being subtracted from the power spectra, and noise was inadvertently added as an input to dissipation rate calculations.

**Improved Header Handling**: Allowed RDI reader to skip junk headers effectively.

**Nortek Reader C Types Update**: Adjusted C types in the Nortek reader to handle below-zero water temperatures and to allow pitch and roll values to go negative.


- https://github.com/MHKiT-Software/MHKiT-Python/pull/280
- https://github.com/MHKiT-Software/MHKiT-Python/pull/289
- https://github.com/MHKiT-Software/MHKiT-Python/pull/290
- https://github.com/MHKiT-Software/MHKiT-Python/pull/292
- https://github.com/MHKiT-Software/MHKiT-Python/pull/293
- https://github.com/MHKiT-Software/MHKiT-Python/pull/294
- https://github.com/MHKiT-Software/MHKiT-Python/pull/299


River & Tidal: D3D
Added limits to `variable_interpolation` and added 3 array input capability to `create_points`
- https://github.com/MHKiT-Software/MHKiT-Python/pull/271

Developer Experience
Black formatting
Black formatting is now enforced on all MHKiT files. This ensures consistent formatting across the MHKiT package.
- https://github.com/MHKiT-Software/MHKiT-Python/pull/281

Linting & Type Hints
MHKiT is in the process of enforcing pylint and adding type hints to all functions. Currently this has been achieved and is enforced in the Loads and Power modules.
- https://github.com/MHKiT-Software/MHKiT-Python/pull/288
- https://github.com/MHKiT-Software/MHKiT-Python/pull/296

CI/CD
This release introduces significant reduction in testing time for development. This is achieved by reducing the number of tests for pulls against the develop branch and only running hindcast test when changes are made to it. A bug in the hindcast CI was fixed which only ran on changes to the hindcast tests instead of the hindcast module. Additionally the wave and wind hindcast needed to be separated in 2 jobs due to the excessive time taken to run a wind cache. This created a number of follow on PRs around solidifying the logic of these job. A special case for Python 3.8, pip, and Mac OS was added to use homebrew to install NetCDF and HDF5 to get tests to pass.
- https://github.com/MHKiT-Software/MHKiT-Python/pull/241
- https://github.com/MHKiT-Software/MHKiT-Python/pull/270
- https://github.com/MHKiT-Software/MHKiT-Python/pull/306
- https://github.com/MHKiT-Software/MHKiT-Python/pull/311
- https://github.com/MHKiT-Software/MHKiT-Python/pull/317
- https://github.com/MHKiT-Software/MHKiT-Python/pull/318
- https://github.com/MHKiT-Software/MHKiT-Python/pull/319
- https://github.com/MHKiT-Software/MHKiT-Python/pull/320
- https://github.com/MHKiT-Software/MHKiT-Python/pull/324

Clean Up
MHKiT fixed an implementation error where functions used assert instead of built in errors for type and value checking. Additionally these PRs removed unused files, fixed typos, and created an argument which allows users to run CDIP API calls silently.
- https://github.com/MHKiT-Software/MHKiT-Python/pull/276
- https://github.com/MHKiT-Software/MHKiT-Python/pull/272
- https://github.com/MHKiT-Software/MHKiT-Python/pull/273

0.7.0.1

0.7.0

This release introduces exciting new features and improvements to the MHKiT package:

- **Mooring Module**: We are pleased to introduce the new mooring module. This addition primarily supports outputs from MoorDyn. Within this module, users can:
- Import data
- Calculate lay length
- Visualize mooring line movements in 2D and 3D with graphical animations.

Accompanying this module is an example notebook to guide users on its functionalities.

- **Dolfyn Module Revamp**: The Dolfyn module has been overhauled. Enhancements include:
- Turbulence calculation capability
- Performance measures for tidal power as outlined in IEC/TS 6200-200.

- **New Contributions**: A big shoutout to our community member, mbruggs, for adding the ability to compute surface elevation using IFFT.

- **NDBC Buoy Metadata**: Users can now fetch NDBC buoy metadata directly through MHKiT.

- **Delft3D Module Update**: Stay up to date with support for the latest Delft3D NetCDF format.

**Additions**
- 235
- 232
- 236
- 250
- 239
- 248

**Bug Fixes**
- 226
- 238

**Meta/Minor Changes**
- 220
- 243
- 225
- 231
- 224

Thank you to all of the contributers who helpped with this release:
mbruggs Graham-EGI castillocesar jmcvey3 hivanov-nrel browniea cmichelenstrofer akeeste maxwelllevin rpauly18 ssolson

Page 1 of 3

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.