Skip to content

Commit

Permalink
Merge pull request #108 from WISDEM/develop
Browse files Browse the repository at this point in the history
Minor release for EAB
  • Loading branch information
gbarter authored May 18, 2021
2 parents 59851a0 + a69b200 commit 1e4dbf6
Show file tree
Hide file tree
Showing 616 changed files with 241,652 additions and 62,486 deletions.
57 changes: 38 additions & 19 deletions .github/workflows/CI_WEIS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,59 +16,78 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
# https://github.com/marketplace/actions/setup-miniconda

# This is the more official way to do miniconda, but it messes with the GitHub worker environment and shell quite a bit
#- uses: conda-incubator/setup-miniconda@v2
# # https://github.com/marketplace/actions/setup-miniconda
# with:
# #miniconda-version: "latest"
# channels: conda-forge
# auto-update-conda: true
# python-version: 3.8
# environment-file: environment.yml

# This is a less official, but more lightweight way to do miniconda
- uses: s-weigand/setup-conda@v1
# https://github.com/marketplace/actions/setup-conda
with:
miniconda-version: "latest"
channels: conda-forge
auto-update-conda: true
update-conda: true
python-version: 3.8
environment-file: environment.yml
conda-channels: conda-forge
activate-conda: true
- run: conda env update -n base --file environment.yml

#- name: Show custom environment
# shell: bash
# run: |
# cat $GITHUB_ENV
# printenv

# Install dependencies of WEIS specific to ubuntu
- name: Add dependencies ubuntu specific
if: false == contains( matrix.os, 'windows')
shell: pwsh # putting in a shell command makes for compile linking problems later
# (if you use the shell here, cannot use 'compiler' package, but mpi only seems to work with it)
shell: bash
# (if you use the shell here, cannot use 'compiler' package otherwise get link problems to system libraries
# Mpi only seems to work with the shell command though, so instead rely on system compilers
run: |
conda install -y petsc4py mpi4py openmpi==4.0.5
conda install -y petsc4py mpi4py openmpi
python -c "import platform; print(platform.node())"
# Install dependencies of WISDEM specific to windows
- name: Add dependencies windows specific
if: contains( matrix.os, 'windows')
run: |
conda install -y m2w64-toolchain libpython
# Debugging session
#- name: Setup tmate session
# uses: mxschmitt/action-tmate@v3

# Install WISDEM
- name: Install WEIS
shell: pwsh
shell: bash
run: |
python setup.py develop
# List the collected tests for debugging purposes
- name: List tests
shell: pwsh
shell: bash
run: |
pytest weis --collect-only
# Run all tests within WEIS, but not computationally expensive examples
- name: Run tests within WEIS
shell: pwsh
shell: bash
run: |
pytest weis --cov-config=.coverageac --cov=weis
# Debugging session
#- name: Setup tmate session
# uses: mxschmitt/action-tmate@v3

# Run coveralls
- name: Run coveralls
if: contains( matrix.os, 'ubuntu')
# This also works, https://github.com/AndreMiras/coveralls-python-action
#uses: AndreMiras/coveralls-python-action@develop
shell: pwsh
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coveralls --service=github
coveralls --service=github
69 changes: 44 additions & 25 deletions .github/workflows/run_exhaustive_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,41 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
# https://github.com/marketplace/actions/setup-miniconda

# This is the more official way to do miniconda, but it messes with the GitHub worker environment and shell quite a bit
#- uses: conda-incubator/setup-miniconda@v2
# # https://github.com/marketplace/actions/setup-miniconda
# with:
# #miniconda-version: "latest"
# channels: conda-forge
# auto-update-conda: true
# python-version: 3.8
# environment-file: environment.yml

# This is a less official, but more lightweight way to do miniconda
- uses: s-weigand/setup-conda@v1
# https://github.com/marketplace/actions/setup-conda
with:
miniconda-version: "latest"
channels: conda-forge
auto-update-conda: true
update-conda: true
python-version: 3.8
environment-file: environment.yml
conda-channels: conda-forge
activate-conda: true
- run: conda env update -n base --file environment.yml

#- name: Show custom environment
# shell: bash
# run: |
# cat $GITHUB_ENV
# printenv

# Install dependencies of WEIS specific to ubuntu
- name: Add dependencies ubuntu specific
if: false == contains( matrix.os, 'windows')
shell: pwsh # putting in a shell command makes for compile linking problems later
# (if you use the shell here, cannot use 'compiler' package, but mpi only seems to work with it)
shell: bash
# (if you use the shell here, cannot use 'compiler' package otherwise get link problems to system libraries
# Mpi only seems to work with the shell command though, so instead rely on system compilers
run: |
conda install -y petsc4py mpi4py openmpi==4.0.5
conda install -y petsc4py mpi4py openmpi
python -c "import platform; print(platform.node())"
# Install dependencies of WISDEM specific to windows
Expand All @@ -40,40 +59,40 @@ jobs:
run: |
conda install -y m2w64-toolchain libpython
# Debugging session
#- name: Setup tmate session
# uses: mxschmitt/action-tmate@v3

# Install WISDEM
- name: Install WEIS
shell: pwsh
shell: bash
run: |
python setup.py develop
# Debugging session
#- name: Setup tmate session
# uses: mxschmitt/action-tmate@v3

# Run all examples
- name: Run tests within WEIS
shell: pwsh
shell: bash
run: |
cd weis/test
pytest run_examples.py
python run_examples.py
# Run scripts within rotor_opt folder with MPI
- name: Run parallel examples rotor optimization
shell: pwsh
shell: bash
run: |
cd examples/05_IEA-3.4-130-RWT
mpirun -np 2 python weis_driver.py
# Run scripts within control_opt folder, with and without MPI
- name: Run examples control optimization
shell: pwsh
run: |
cd examples/02_control_opt
mpirun -np 2 python runOptimization.py
# Run scripts within dac folder
# - name: Run examples distributed aerodynamic control
# run: |
# cd examples/dac_flaps
# python dac_driver.py


# Run scripts within design of experiments folder
- name: Run examples design of experiments
shell: bash
run: |
cd examples/09_design_of_experiments
mpirun -n 2 --bind-to core python DOE_openfast.py
python postprocess_results.py
4 changes: 4 additions & 0 deletions MoorPy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

*.pyc
__pycache__
MoorPy.egg-info
22 changes: 22 additions & 0 deletions MoorPy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# MoorPy

MoorPy is a design-oriented mooring system library for Python based around a quasi-static modeling approach.

### Prerequisites

- Python 3

### Installation

For development use:

run ```python setup.py develop``` or ```pip install -e .``` from the command line in the main MoorPy directory.

For non-development use:

run ```python setup.py``` or ```pip install .``` from the command line in the main MoorPy directory.


## Documentation

TBD
20 changes: 20 additions & 0 deletions MoorPy/docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
65 changes: 65 additions & 0 deletions MoorPy/docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('..'))

import moorpy


# -- Project information -----------------------------------------------------

project = 'MoorPy'
copyright = '2021, NREL'
author = 'NREL'

# The full version, including alpha/beta/rc tags
release = '0.9.0'


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon'
]

napoleon_include_init_with_doc = True

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
#html_theme = 'alabaster'
#html_theme = 'default'
html_theme = 'sphinx_rtd_theme' # need to run pip install sphinx_rtd_theme to use locally
html_theme_options = {
'style_nav_header_background': 'slateblue'
}


# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
#html_static_path = ['_static']
30 changes: 30 additions & 0 deletions MoorPy/docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.. MoorPy documentation master file, created by
sphinx-quickstart on Mon Nov 16 09:07:50 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
MoorPy
============================================

A mooring system visualizer and quasi-static modeler written in Python.

MoorPy is an open-source quasi-static mooring system model that can be used for a variety of mooring system applications



.. toctree::
:maxdepth: 2
:caption: Contents:


.. automodule:: moorpy
:members:
:member-order: bysource


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
35 changes: 35 additions & 0 deletions MoorPy/docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
Loading

0 comments on commit 1e4dbf6

Please sign in to comment.