Skip to content

Commit

Permalink
Update installation instructions for developers (#21)
Browse files Browse the repository at this point in the history
* Incomplete

* Develop instructions included; reordering.

* Ruff bugfix on importing find_packages.
  • Loading branch information
misi9170 authored Dec 20, 2023
1 parent a94c650 commit 8c78cab
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 26 deletions.
23 changes: 1 addition & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,4 @@ WHOC controllers will also call on design tools such as
[FLORIS](https://github.com/NREL/floris).

Documentation for WHOC can be found on
[nrel.github.io](https://nrel.github.io/wind-hybrid-open-controller/intro.html)

## Code development
To contribute to WHOC, please consider forking the main github repository,
with the [main repo](https://github.com/NREL/wind-hybrid-open-controller) as an
upstream remote. To submit a new feature or bug fix, create a new branch
in your fork and submit a pull request back to the `develop` branch in the
main repo. The pull request will be reviewed by other WHOC developers and
merged (using "squash and merge") into the `develop` branch. Periodically,
the `develop` branch will be merged into the `main` branch and a version
number will be assigned.

Unless an existing controller or interface exist to suit your needs, most
users will need to generate:
- A new interface class inheriting from `InterfaceBase`
- A new controller class, implementing the desired control algorithm and
inheriting from `ControllerBase`

Additionally, if you'd like to contribute to this base repository, please
include in your pull request:
- Unit tests for the implemented controller
- Possibly unit tests for the implemented interface, if needed
[nrel.github.io](https://nrel.github.io/wind-hybrid-open-controller/intro.html)
3 changes: 2 additions & 1 deletion docs/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
format: jb-book
root: intro
parts:
- caption: Installation
- caption: General information
chapters:
- file: install_instructions
- file: code_development
- caption: Controllers
chapters:
- file: controllers
Expand Down
23 changes: 23 additions & 0 deletions docs/code_development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Code development
To contribute to WHOC, please consider forking the main github repository,
with the [NREL repo](https://github.com/NREL/wind-hybrid-open-controller) as an
upstream remote. See the [Installation instructions](install_instructions)
for details about how to set up your repository as a developer.

To submit a new feature or bug fix, create a new branch
in your fork and submit a pull request back to the `develop` branch in the
main repo. The pull request will be reviewed by other WHOC maintainers and
merged (using "squash and merge") into the `develop` branch. Periodically,
the `develop` branch will be merged into the `main` branch and a version
number will be assigned.

Unless an existing controller or interface exist to suit your needs, most
users will need to generate:
- A new interface class inheriting from `InterfaceBase`
- A new controller class, implementing the desired control algorithm and
inheriting from `ControllerBase`

Additionally, if you'd like to contribute to this base repository, please
include in your pull request:
- Unit tests for the implemented controller
- Possibly unit tests for the implemented interface, if needed
42 changes: 41 additions & 1 deletion docs/install_instructions.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,46 @@
# Installation

WHOC is _not_ designed to be used as a stand-alone package. Most likely,
you'll want to add WHOC to an existing conda environment that contains your
simulation testbed, such as [Hercules](https://github.com/NREL/hercules).
For example, see the [Hercules installation instuctions](\
https://nrel.github.io/hercules/install_instructions.html) for how to set up
an appropriate conda environment.

## General users

If you intend to use WHOC, but not contribute, the following lines should
be sufficient to install WHOC (presumably, after activating your conda
environment):

```
git clone https://github.com/NREL/wind-hybrid-open-controller
pip install -e wind-hybrid-open-controller
pip install wind-hybrid-open-controller/
```

## Developers

If you intend to contribute to WHOC, we request that your fork the WHOC
repository on github. You can then install WHOC (again, assuming you have
already activated your conda environment) according to:

```
git clone https://github.com/your-github-id/wind-hybrid-open-controller
pip install -e wind-hybrid-open-controller/
```
To contribute back to the base repository
https://github.com/NREL/wind-hybrid-open-controller, please do the following:
- Create a branch from the base repository's `develop` branch on your fork
containing your code changes (e.g. `your-github-id:feature/your-new-feature`)
- Open a pull request into the base repository's `NREL:develop` branch, and provide
a description of the new/updated capabilities
- The maintainers will review your pull request and provide feedback before
possibly merging the pull request (via the "squash and merge" method) into the
`NREL:develop` branch
- At the next release, `NREL:develop` will be merged into `NREL:main`, and your changes
contributions will appear there

For more information on what your pull request should contain, see
[Code development](code_development.md).


4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import os
from pathlib import Path

from setuptools import find_packages, setup
from setuptools import setup

# Package meta-data.
NAME = "whoc"
Expand Down Expand Up @@ -101,7 +101,7 @@
python_requires=REQUIRES_PYTHON,
url=URL,
# package_dir={"": "hercules"},
packages=["whoc"], #find_packages(exclude=["tests", "*.tests", "*.tests.*", "tests.*"]),
packages=["whoc"], # find_packages(exclude=["tests", "*.tests", "*.tests.*", "tests.*"]),
# If your package is a single module, use this instead of 'packages':
# py_modules=['mypackage'],
# entry_points={
Expand Down

0 comments on commit 8c78cab

Please sign in to comment.