Skip to content
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

Add WEIS file readers and writers #2188

Merged
merged 45 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
fcd7072
FEA: Add python package outline
cortadocodes Apr 15, 2024
cd71f90
REF: Rename python distribution/package to `openfast_python` / `openf…
cortadocodes Apr 23, 2024
e9686da
FEA: Move OpenFAST readers/writers over from WEIS
cortadocodes Apr 23, 2024
2d982e2
DEP: Add `pcrunch` dependency
cortadocodes Apr 23, 2024
b69eca5
REF: Update import paths from `weis` to `openfast`
cortadocodes Apr 23, 2024
85dea15
DOC: Add contributors from WEIS to `authors` in `pyproject.toml`
cortadocodes Apr 25, 2024
b24b761
DOC: Add brief explanation of `openfast` package to sub-readme
cortadocodes Apr 25, 2024
a6f969b
OPS: Fix format for authors names/emails
cortadocodes May 1, 2024
621cb1d
TST: Copy test from WEIS
cortadocodes May 7, 2024
ec3053d
OPS: Move `pyproject.toml` to top level
cortadocodes May 7, 2024
aef01d6
OPS: Publish `openfast` package to PyPI on release
cortadocodes May 7, 2024
41704f5
TST: Add test data for `openfast` python package
cortadocodes May 7, 2024
84018ad
REF: Remove extra python files
cortadocodes May 7, 2024
2b207fd
DOC: Adjust readme wording
cortadocodes May 7, 2024
aa4d61e
DOC: Use link to specific git ref instead of `main` branch in readme
cortadocodes May 7, 2024
5e42c91
OPS: Add note about not relying on the `octue-openfast` package
cortadocodes May 20, 2024
ac25cfe
OPS: Allow workflow dispatch of `deploy` workflow
cortadocodes May 20, 2024
0e3c682
MRG: Merge pull request #3 from octue/add-weis-readers-and-writers
cortadocodes May 20, 2024
c8f1452
WIP: Temporarily change name of python package
cortadocodes May 20, 2024
2dbc227
Deleting files related to running OpenFAST, Restructuring to be IO re…
mayankchetan May 20, 2024
2f6ea23
setting ROSCO as optional, removing lin
mayankchetan May 20, 2024
9abdea0
updating the test files before move to r-test
mayankchetan May 20, 2024
2a91ef3
removing rosco and pcrunch as deps
mayankchetan May 20, 2024
9a15c8f
OpenFAST Output & Lin reader
mayankchetan May 20, 2024
52d3e9b
Adding Oputput reader to test
mayankchetan May 20, 2024
000b6aa
Pointing test to one r-test case, removing test_data
mayankchetan May 20, 2024
6063a0f
Changing library name to openfast_io
mayankchetan May 20, 2024
e340482
OPS: Move poetry files into distribution root and rename package
cortadocodes May 21, 2024
b485088
MRG: Merge pull request #5 from octue/fix-openfast-python-packaging
cortadocodes May 21, 2024
0012ca8
MRG: Merge pull request #4 from mayankchetan/add-weis-readers-and-wri…
cortadocodes May 21, 2024
e2940cb
MRG: Merge branch 'main' into add-weis-readers-and-writers
cortadocodes May 21, 2024
2c8869e
REF: Rename package to `openfast_io`
cortadocodes May 21, 2024
e0690ba
DEP: Add `rosco` as optional dependency
cortadocodes May 21, 2024
9b68701
DOC: Add installation instructions to python package readme
cortadocodes May 21, 2024
6639d23
DOC: Fix docker commands for GHCR images
cortadocodes May 21, 2024
6ec0f6c
DOC: Add python package installation to docs
cortadocodes May 21, 2024
7ebb340
DOC: Update python package readme
cortadocodes May 21, 2024
a7caafa
WIP: Temporarily rename python package
cortadocodes May 21, 2024
c6832ca
OPS: Set working directory for python package build and publish
cortadocodes May 21, 2024
fa027f4
WIP: Temporarily change python package version
cortadocodes May 21, 2024
4e6e298
FIX: Update python package import paths
cortadocodes May 21, 2024
d3676d3
WIP: Increment temporary version number
cortadocodes May 21, 2024
62c117c
replaced references to weis within code.
mayankchetan May 21, 2024
fee1bc4
added Apache-2.0 license to pyproject.toml
mayankchetan May 21, 2024
f6fd0c4
MRG: Merge pull request #6 from mayankchetan/add-weis-readers-and-wri…
cortadocodes May 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,16 +1,41 @@
# This workflow builds an OpenFAST docker image for the linux/amd64 and linux/aarch64 architectures on merge into
# `main` from a release candidate branch. The image is tagged both with "latest" and the version extracted from the
# release candidate branch's name (e.g. "rc-3.5.3") before being pushed to the `nrel/openfast` repository. The build
# cache is stored in GitHub actions.
name: build-docker-image-automatic
# This workflow uploads the `openfast` python package to PyPI before building an OpenFAST docker image for the
# linux/amd64 and linux/aarch64 architectures on release. The image is tagged both with "latest" and the version
# extracted from the release candidate branch's name (e.g. "rc-3.5.3") before being pushed to the `nrel/openfast`
# repository. The build cache is stored in GitHub actions.
name: deploy

on:
workflow_dispatch:

release:
types:
- released

jobs:
build-and-push:
publish-to-pypi:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install Poetry
uses: snok/install-poetry@v1.3.4

- name: Build a binary wheel and a source tarball
run: poetry build
working-directory: openfast_python

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@v1.8.14
with:
packages-dir: openfast_python/dist


docker-build-and-push:
runs-on: ubuntu-latest
timeout-minutes: 300
env:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ vs-build/
.fortls
.devcontainer
.idea
.env

# backup files
*.asv
Expand Down
27 changes: 25 additions & 2 deletions docs/source/install/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ code,** refer to the table in the :ref:`download_binaries` or :ref:`use_docker`
sections and read the corresponding documentation for specific instructions.
For instructions on compiling, see :ref:`compile_from_source`.

To manipulate OpenFAST files using python, see :ref:`python_wrapper`.


.. _download_binaries:

Download binaries
Expand Down Expand Up @@ -193,13 +196,13 @@ To pull and run with local files:

.. code-block:: shell

docker run --rm -it --volume=/path/to/files:/files ghcr.io/OpenFAST/openfast:latest openfast /files/main.fst
docker run --rm -it --volume=/path/to/files:/files ghcr.io/openfast/openfast:latest openfast /files/main.fst

For running the container interactively:

.. code-block:: shell

docker run --rm -it --volume=/path/to/files:/files ghcr.io/OpenFAST/openfast:latest /bin/bash
docker run --rm -it --volume=/path/to/files:/files ghcr.io/openfast/openfast:latest /bin/bash


Build your own images
Expand All @@ -208,6 +211,26 @@ You can also build your own custom images using our `Dockerfile` or base your im
`here <https://github.com/OpenFAST/openfast/blob/main/share/docker/README.md>`_ for more information on this.


.. _python_wrapper

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:

.. code-block::

pip install openfast_io

or

.. code-block::

poetry add openfast_io

For more information and installation options, see `here <https://github.com/OpenFAST/openfast/blob/main/openfast_python/README.md>`_.


.. _compile_from_source:

Compile from source
Expand Down
27 changes: 27 additions & 0 deletions openfast_python/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# OpenFAST python readers/writers

> [!CAUTION]
> The `openfast_io` package on PyPI is currently called `octue-openfast` but will soon be renamed.

This package is a python wrapper comprising readers and writers for converting OpenFAST files to/from python objects. It
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
```shell
pip install openfast_io
```
or
```shell
poetry add openfast_io
```

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