Skip to content

Conversation

@ssolson
Copy link
Contributor

@ssolson ssolson commented Apr 1, 2025

This PR adds pylint enforcement to the MHKiT river module.
Additionally this PR adds type hints to the river module functions.
Part of #275

ssolson and others added 20 commits December 11, 2024 08:22
This PR updates our git workflow to use `main` as the MHKiT default
branch :
- 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
@ssolson ssolson added the Clean Up Improve code consistency and readability label Apr 1, 2025
@ssolson ssolson self-assigned this Apr 1, 2025
@ssolson ssolson changed the base branch from main to develop April 1, 2025 16:27
@ssolson ssolson marked this pull request as ready for review April 14, 2025 20:01
Copy link
Contributor

@akeeste akeeste left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ssolson, this looks great!

My one minor request is that we remove the module names from top-level docstrings, otherwise the API docs will format a bit strangely (the duplicate description in the image would be removed when the API docs are updated). I added suggestions where I caught them.

image

Are there any functional changes in the two notebooks?

Comment on lines 2 to 7
performance.py
Computes device metrics such as equivalent diameter, tip speed ratio,
and capture area. Calculations are based on IEC TS 62600-300:2019 ED1.
"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the equivalent description in our docs that will be replaced by the performance module docstring. Is any of this information necessary here? Seems like the sentences clarifying turbine types could move to each function's doc string

"The performance submodule contains functions to compute equivalent diameter and capture area for circular, ducted, rectangular, adn multiple circular devices. A circular device is a vertical axis water turbine (VAWT). A rectangular device is a horizontal axis water turbine. A ducted device is an enclosed VAWT. A multiple-circular devices is a device with multiple VAWTs per device. The performance module also includes functions for calculating a turbine coeffcient of power and tip speed ratio."

Copy link
Contributor Author

@ssolson ssolson Apr 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this information should be here including the functions although I have removed them short term because I decided to punt the discussion until later so we could form a strategy around the autodocs.

Here is the standard: https://peps.python.org/pep-0257/#multi-line-docstrings

The docstring for a module should generally list the classes, exceptions and functions (and any other objects) that are exported by the module, with a one-line summary of each. (These summaries generally give less detail than the summary line in the object's docstring.) The docstring for a package (i.e., the docstring of the package's init.py module) should also list the modules and subpackages exported by the package.

This is useful because a user should be able to call help on a module and know what functions are available.
E.g:

>>> import x; help(x)

The response should inform the user what they have imported and what functions are available.

@ssolson
Copy link
Contributor Author

ssolson commented Apr 21, 2025

Thanks @ssolson, this looks great!

My one minor request is that we remove the module names from top-level docstrings, otherwise the API docs will format a bit strangely (the duplicate description in the image would be removed when the API docs are updated). I added suggestions where I caught them.

Done.

Are there any functional changes in the two notebooks?

No functional notebook changes.

@akeeste akeeste self-requested a review April 21, 2025 16:37
Copy link
Contributor

@akeeste akeeste left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ssolson this looks good to me

@ssolson ssolson merged commit 2420620 into MHKiT-Software:develop Apr 21, 2025
43 checks passed
@ssolson ssolson deleted the lint-river branch May 20, 2025 14:24
akeeste pushed a commit to akeeste/MHKiT-Python that referenced this pull request Sep 30, 2025
This PR adds pylint enforcement to the MHKiT river module. 
Additionally this PR adds type hints to the river module functions.
Part of MHKiT-Software#275
@akeeste akeeste mentioned this pull request Sep 30, 2025
akeeste added a commit that referenced this pull request Sep 30, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Clean Up Improve code consistency and readability river module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants