Skip to content

Commit

Permalink
updating docs and actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mayankchetan committed Dec 23, 2024
1 parent 4c76a0e commit 80bb3af
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 22 deletions.
41 changes: 32 additions & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ on:


jobs:
publish-to-test-pypi:
publish-to-pypi-test:
runs-on: ubuntu-latest

if: github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v3

Expand All @@ -42,16 +42,39 @@ jobs:
run: hatch publish -r test
working-directory: openfast_io

# - name: Publish to PyPI
# env:
# HATCH_INDEX_USER: __token__
# HATCH_INDEX_AUTH: ${{ secrets.PYPI_TOKEN }}
# run: hatch publish
# working-directory: openfast_io
publish-to-pypi:
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
cache: 'pip'

- name: Install Hatch
uses: pypa/hatch@install

- name: Install dependencies
run: pip install keyring[file]

- name: Build package
run: hatch build
working-directory: openfast_io

- name: Publish to PyPI
env:
HATCH_INDEX_USER: __token__
HATCH_INDEX_AUTH: ${{ secrets.PYPI_TOKEN }}
run: hatch publish
working-directory: openfast_io

docker-build-and-push:
runs-on: ubuntu-latest
timeout-minutes: 300
if: github.event_name == 'release'
timeout-minutes: 500
env:
DOCKERFILE_PATH: share/docker/Dockerfile
DOCKERHUB_REPOSITORY: nrel/openfast
Expand Down
22 changes: 17 additions & 5 deletions docs/source/install/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,29 @@ You can also build your own custom images using our `Dockerfile` or base your im
Install the ``openfast_io`` python wrapper
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The ``openfast_io`` python package is a wrapper comprising readers and writers for converting OpenFAST files to/from
python objects. You can install it with:
python objects.

.. code-block::
To use `openfast_io` as a library for incorporation into other scripts or tools, it is available via (assuming that you have already setup your python environment):

.. code-block:: bash
pip install openfast_io
or
These instructions are for interaction directly with the `openfast_io` source code.

1. Follow this step only if you have not cloned the OpenFAST repo:

.. code-block:: bash
git clone https://github.com/OpenFAST/OpenFAST.git
cd OpenFAST
.. code-block::
2. Assuming you are within the OpenFAST directory:

.. code-block:: bash
poetry add openfast_io
cd openfast_io
pip install -e .
For more information and installation options, see the `OpenFAST Python readme <https://github.com/OpenFAST/openfast/blob/main/openfast_python/README.md>`_.

Expand Down
41 changes: 34 additions & 7 deletions openfast_io/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,48 @@ This package is a python wrapper comprising readers and writers for converting O
was originally written for [WEIS](https://github.com/WISDEM/WEIS/tree/77a878d7989b8c1d07d2244135ccd308a193a924/weis/aeroelasticse) and has been ported over to OpenFAST to make it more widely accessible.

## Installation
Run either
Installation with [Anaconda](https://www.anaconda.com) is the recommended approach because of the ability to create self-contained environments suitable for testing and analysis.

### Installation as a "library"

To use `openfast_io` as a library for incorporation into other scripts or tools, it is available via (assuming that you have already setup your python environment):

```shell
pip install openfast_io
```
or
```shell
poetry add openfast_io
```

### Installation as an editable library

These instructions are for interaction directly with the `openfast_io` source code.

0. Follow this step only if you have not cloned the OpenFAST repo.
```shell
git clone https://github.com/OpenFAST/OpenFAST.git
cd OpenFAST
```

1. Assuming you are within the OpenFAST directory.
```shell
cd openfast_io
pip install -e .
```

2. To test `openfast_io`, OpenFAST must be compiled within the build folder, then run:

```shell
cd tests
pytest test_of_io_pytest.py
```

### Extra options
[ROSCO](https://github.com/NREL/ROSCO) can be installed as an optional dependency. Run either
```shell
pip install openfast_io[rosco]
```
or

## Development and testing
To contribute to the development of `openfast_io`, install additioal depemndancies using:

```shell
poetry add -E rosco openfast_io
pip install -e ".[all]"
```
2 changes: 1 addition & 1 deletion openfast_io/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "hatchling.build"
[project]
name = "openfast_io"
# dynamic = ["version"]
version = "4.0.0.b1"
version = "4.0.0"
description = "Readers and writers for OpenFAST files."
license = {file = "../LICENSE"}
authors = [
Expand Down

0 comments on commit 80bb3af

Please sign in to comment.