-
Notifications
You must be signed in to change notification settings - Fork 48
Lint river module #389
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
Lint river module #389
Conversation
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
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.
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.
Are there any functional changes in the two notebooks?
mhkit/river/performance.py
Outdated
| 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. | ||
| """ |
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 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."
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.
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.
Done.
No functional notebook changes. |
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.
Thanks @ssolson this looks good to me
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
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 adds pylint enforcement to the MHKiT river module.
Additionally this PR adds type hints to the river module functions.
Part of #275