MHKiT-Python is a Python package designed for marine renewable energy applications to assist in data processing and visualization. The software package include functionality for:
- Data processing
- Data visualization
- Data quality control
- Resource assessment
- Device performance
- Device loads
MHKiT-Python documentation includes overview information, installation instructions, API documentation, and examples. See the MHKiT documentation for more information.
MHKiT-Python requires Python (3.8, 3.9, 3.10, 3.11) along with several Python package dependencies. MHKiT-Python can be installed from PyPI using the command:
pip install mhkit
See installation instructions for more information.
MHKiT-Python is copyright through the National Renewable Energy Laboratory, Pacific Northwest National Laboratory, and Sandia National Laboratories. The software is distributed under the Revised BSD License. See copyright and license for more information.
The GitHub platform has the Issues feature that is used to track ideas, feedback, tasks, and/or bugs. To submit an Issue, follow the steps below. More information about GitHub Issues can be found here
- Navigate to the MHKiT-Python main page
- 2.Under the repository name (upper left), click Issues.
- Click New Issue.
- If the Issue is a bug, use the Bug report template and click Get started, otherwise click on the Open a blank issue link.
- Provide a Title and description for the issue. Be sure the title is relevant to the issue and that the description is clear and provided with sufficient detail.
- When you're finished, click Submit new issue. The developers will follow-up once the issue is addressed.
The GitHub platform has the Fork feature that facilitates code modification and contributions. A fork is a new repository that shares code and visibility settings with the original upstream repository. To fork MHKiT-Python, follow the steps below. More information about GitHub Forks can be found here
- Navigate to the MHKiT-Python main page
- Under the repository name (upper left), click Fork.
- Select an owner for the forked repository.
- Specify a name for the fork. By default, forks are named the same as their upstream repositories.
- Add a description of your fork (optional).
- Choose whether to copy only the default branch or all branches to the new fork. You will only need copy the default branch to contribute to MHKiT-Python.
- When you're finished, click Create fork. You will now have a fork of the MHKiT-Python repository.
The GitHub platform has the branch feature that facilitates code contributions and collaboration amongst developers. A branch isolates development work without affecting other branches in the repository. Each repository has one default branch, and can have multiple other branches. To create a branch of your forked MHKiT-Python repository, follow the steps below. More information about GitHub branches can be found here
- Navigate to your fork of MHKiT-Python (see instructions above)
- Above the list of files, click Branches.
- Click New Branch.
- Enter a name for the branch. Be sure to select MHKiT-Software/MHKiT-Python:master as the source.
- Click Create branch. You will now have a branch on your fork of MHKiT-Python that you can use to work with the code base.
The GitHub platform has the pull request feature that allows you to propose changes to a repository such as MHKiT-Python. The pull request will allow the repository administrators to evaluate the pull request. To create a pull request for MHKiT-Python repository, follow the steps below. More information about GitHub pull requests can be found here
- Navigate to the MHKiT-Python main page
- Above the list of files, click Pull request.
- On the compare page, click Compare accross forks.
- In the "base branch" drop-down menu, select the branch of the upstream repository you'd like to merge changes into.
- In the "head fork" drop-down menu, select your fork, then use the "compare branch" drop-down menu to select the branch you made your changes in.
- Type a title and description for your pull request.
- If you want to allow anyone with push access to the upstream repository to make changes to your pull request, select Allow edits from maintainers.
- To create a pull request that is ready for review, click Create Pull Request. To create a draft pull request, use the drop-down and select Create Draft Pull Request, then click Draft Pull Request. More information about draft pull requests can be found here
- MHKiT-Python adminstrators will review your pull request and contact you if needed.
MHKiT adheres to the "black" code formatting standard to maintain a consistent and readable code style. Developers contributing to MHKiT have several options to ensure their code meets this standard:
-
Manual Formatting with Black: Install the 'black' formatter and run it manually from the terminal to format your code. This can be done by executing a command like
black [file or directory]
. -
IDE Extension: If you are using an Integrated Development Environment (IDE) like Visual Studio Code (VS Code), you can install the 'black' formatter as an extension. This allows for automatic formatting of code within the IDE.
-
Pre-Commit Hook: Enable the pre-commit hook in your development environment. This automatically formats your code with 'black' each time you make a commit, ensuring that all committed code conforms to the formatting standard.
For detailed instructions on installing and using 'black', please refer to the Black Documentation. This resource provides comprehensive guidance on installation, usage, and configuration of the formatter.