forked from MHKiT-Software/MHKiT-Python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.md
More file actions
149 lines (107 loc) · 9.16 KB
/
README.md
File metadata and controls
149 lines (107 loc) · 9.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#  MHKiT-Python
<p align="left">
<a href=https://github.com/MHKiT-Software/MHKiT-Python/actions/workflows/main.yml>
<img src="https://github.com/MHKiT-Software/MHKiT-Python/actions/workflows/main.yml/badge.svg">
</a>
<a href=https://coveralls.io/github/MHKiT-Software/MHKiT-Python?branch=main>
<img src="https://coveralls.io/repos/github/MHKiT-Software/MHKiT-Python/badge.svg?branch=main">
</a>
<a href=https://pepy.tech/project/mhkit>
<img src="https://pepy.tech/badge/mhkit">
</a>
<a href=https://doi.org/10.5281/zenodo.3924683>
<img src="https://zenodo.org/badge/DOI/10.5281/zenodo.3924683.svg">
</a>
</p>
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
## Documentation
MHKiT-Python documentation includes overview information, installation instructions, API documentation, and examples.
See the [MHKiT documentation](https://mhkit-software.github.io/MHKiT) for more information.
## Installation
[MHKiT-Python](https://github.com/MHKiT-Software/MHKiT-Python) requires [Python (3.10-3.12)](https://www.python.org/).
It is recommended to use the [Anaconda Python Distribution](https://www.anaconda.com/distribution/) (a fully featured Python installer with a GUI)
or [Miniconda](https://docs.anaconda.com/miniconda/#quick-command-line-install) (a lightweight installer with the ``conda`` command line utility).
Both will include most of MHKiT-Python's package dependencies.
MHKiT can be installed several ways:
### Option 1: Install from Python
This option is recommended as a fast installation for MHKiT-Python users.
To install MHKiT-Python using ``conda``, in an Anaconda Prompt:
```bash
conda install -c conda-forge mhkit
```
### Option 2: Clone Repository from GitHub
This option is recommended for MHKiT-Python users who want access to example notebooks and developers.
Download and install your preferred version of [git](https://git-scm.com/).
To clone MHKiT-Python:
```bash
git clone https://github.com/MHKiT-Software/MHKiT-Python
cd MHKiT-Python
```
To install a local, editable version of MHKiT-Python using [pip](https://pip.pypa.io/en/stable/):
```bash
pip install -e .["all"]
```
An [environment YAML file](https://github.com/MHKiT-Software/MHKiT-Python/blob/main/environment.yml) is also provided that can create the base environment required by MHKiT.
MHKiT can then be installed into that environment using any of the provided methods.
### Option 3: Module-specific Install from Python
A slim version of MHKiT-Python can be installed to reduce the number of dependencies and potential conflicts with other software.
This installation utilizes pip's optional dependencies installation.
To install a single MHKiT module, e.g. the wave module, and its dependencies, use:
pip install mhkit["wave"]
Note that ``pip install mhkit`` only installs the base MHKiT dependencies and not the entire software.
To install all MHKiT dependencies use:
pip install mhkit["all"]
See [installation instructions](https://mhkit-software.github.io/MHKiT/installation.html) for more information.
## Copyright and license
MHKiT-Python is copyright through the National Laboratory of the Rockies,
Pacific Northwest National Laboratory, and Sandia National Laboratories.
The software is distributed under the Revised BSD License.
See [copyright and license](LICENSE.md) for more information.
## Issues
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](https://docs.github.com/en/issues/tracking-your-work-with-issues/about-issues)
1. Navigate to the [MHKiT-Python main page](https://github.com/MHKiT-Software/MHKiT-Python)
2. 2.Under the repository name (upper left), click **Issues**.
3. Click **New Issue**.
4. If the Issue is a bug, use the **Bug report** template and click **Get started**, otherwise click on the **Open a blank issue** link.
5. 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.
6. When you're finished, click **Submit new issue**. The developers will follow-up once the issue is addressed.
## Creating a fork
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](https://docs.github.com/en/get-started/quickstart/fork-a-repo)
1. Navigate to the [MHKiT-Python main page](https://github.com/MHKiT-Software/MHKiT-Python)
2. Under the repository name (upper left), click **Fork**.
3. Select an owner for the forked repository.
4. Specify a name for the fork. By default, forks are named the same as their upstream repositories.
5. Add a description of your fork (optional).
6. 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.
7. When you're finished, click **Create fork**. You will now have a fork of the MHKiT-Python repository.
## Creating a branch
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](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches)
1. Navigate to your fork of MHKiT-Python (see instructions above)
2. Above the list of files, click **Branches**.
3. Click **New Branch**.
4. Enter a name for the branch. Be sure to select **MHKiT-Software/MHKiT-Python:main** as the source.
5. 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.
## Creating a pull request
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](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request)
1. Navigate to the [MHKiT-Python main page](https://github.com/MHKiT-Software/MHKiT-Python)
2. Above the list of files, click **Pull request**.
3. On the compare page, click **Compare accross forks**.
4. In the "base branch" drop-down menu, select the branch of the upstream repository you'd like to merge changes into.
5. 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.
6. Type a title and description for your pull request.
7. 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**.
8. 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](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests#draft-pull-requests)
9. MHKiT-Python adminstrators will review your pull request and contact you if needed.
## Code Formatting in MHKiT
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:
1. **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]`.
2. **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.
3. **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](https://black.readthedocs.io/en/stable/). This resource provides comprehensive guidance on installation, usage, and configuration of the formatter.