Skip to content

Commit

Permalink
Merge 590f85d into 1643ab7
Browse files Browse the repository at this point in the history
  • Loading branch information
gbarter committed Feb 6, 2024
2 parents 1643ab7 + 590f85d commit 2b87946
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 30 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/CI_WEIS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macOS-latest", "windows-latest"]
os: ["ubuntu-latest", "macOS-latest"] #, "windows-latest"]
python-version: ["3.9","3.10","3.11"]

steps:
Expand All @@ -38,11 +38,16 @@ jobs:
environment-file: environment.yml
activate-environment: test
auto-activate-base: false

- name: Add dependencies windows specific
if: contains( matrix.os, 'windows')
run: |
conda install -y -c intel intel-openmp mkl
- name: Add dependencies ubuntu specific
if: false == contains( matrix.os, 'windows')
run: |
conda install -y petsc4py mpi4py openmpi pyoptsparse
conda install -y petsc4py mpi4py openmpi
- name: Add test packages
run: |
Expand All @@ -56,12 +61,24 @@ jobs:
# Install WEIS
- name: Install WEIS
run: |
pip install -e . -v
pip install -e .
# Debugging session
#- name: Setup tmate session
# if: contains( matrix.os, 'windows')
# uses: mxschmitt/action-tmate@v3

#- name: Show openfast environment
# run: |
# which -a openfast
# cd /c/Miniconda3/envs/test/Library/bin/
# ls *fast*.exe
# ls *fast*.dll
# openfast -h
# python -c "import ctypes; ctypes.cdll.LoadLibrary('openfastlib.dll')"
# ls *fast*.dll
# cd examples/03_NREL5MW_OC3_spar
# python weis_driver.py

# List the collected tests for debugging purposes
- name: List tests
Expand All @@ -75,7 +92,7 @@ jobs:
# Run coveralls
- name: Run coveralls
if: contains( matrix.os, 'ubuntu') && contains( matrix.python-version, '3.11')
if: contains( matrix.os, 'ubuntu') && contains( matrix.python-version, '3.10')
uses: coverallsapp/github-action@v2
# This also works, https://github.com/AndreMiras/coveralls-python-action
#uses: AndreMiras/coveralls-python-action@develop
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The core WEIS modules are:

## Installation

On laptop and personal computers, 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. WEIS requires [Anaconda 64-bit](https://www.anaconda.com/distribution/). However, the `conda` command has begun to show its age and we now recommend the one-for-one replacement with the [Miniforge3 distribution](https://github.com/conda-forge/miniforge?tab=readme-ov-file#miniforge3), which is much more lightweight and more easily solves for the package dependencies. WEIS is currently supported on Linux, Mac, and Windows (natively or with the Linux sub-system (WSL)).
On laptop and personal computers, 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. WEIS requires [Anaconda 64-bit](https://www.anaconda.com/distribution/). However, the `conda` command has begun to show its age and we now recommend the one-for-one replacement with the [Miniforge3 distribution](https://github.com/conda-forge/miniforge?tab=readme-ov-file#miniforge3), which is much more lightweight and more easily solves for the package dependencies. Sometimes, using `mamba` in place of `conda` with this distribution speeds up the installation process. WEIS is currently supported on Linux, MAC and Windows Sub-system for Linux (WSL). Installing WEIS on native Windows is not yet supported, but planned in 2024.

The installation instructions below use the environment name, "weis-env," but any name is acceptable. For those working behind company firewalls, you may have to change the conda authentication with `conda config --set ssl_verify no`. Proxy servers can also be set with `conda config --set proxy_servers.http http://id:pw@address:port` and `conda config --set proxy_servers.https https://id:pw@address:port`.

Expand All @@ -44,12 +44,12 @@ The installation instructions below use the environment name, "weis-env," but an
module purge
module load conda

1. Setup and activate the Anaconda environment from a command prompt:
1. Setup and activate the Anaconda environment from a prompt (WSL terminal on Windows or Terminal.app on Mac)

conda config --add channels conda-forge
conda env create --name weis-env -f https://raw.githubusercontent.com/WISDEM/WEIS/develop/environment.yml
conda activate weis-env # (if this does not work, try source activate weis-env)
conda install -y petsc4py mpi4py pyoptsparse # (Mac / Linux only)
conda install -y petsc4py mpi4py # (Mac / Linux only)


2. Clone the repository and install the software
Expand All @@ -69,7 +69,7 @@ The installation instructions below use the environment name, "weis-env," but an

## Developer guide

If you plan to contribute code to WEIS, please first consult the [developer guide](https://weis.readthedocs.io/en/latest/how_to_contribute_code.html). You are also likely to want to install some of the compiled WEIS dependencies (OpenFAST or WISDEM or pyHAMS or ROSCO) from a local copy instead of relying on the conda packages.
If you plan to contribute code to WEIS, please first consult the [developer guide](https://weis.readthedocs.io/en/latest/how_to_contribute_code.html).

## Feedback

Expand Down
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ dependencies:
- pyDOE3
- pygments
- pyhams
- pyoptsparse
- python-json-logger
- pyzmq
- qdldl-python
Expand Down
10 changes: 3 additions & 7 deletions weis/dtqpy/solver/DTQPy_SOLVER.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,16 @@
Primary Contributor: Daniel R. Herber (danielrherber on Github)
"""
from weis.dtqpy.solver.DTQPy_SOLVER_osqp import DTQPy_SOLVER_osqp
PYOPT = True
try:
from weis.dtqpy.solver.DTQPy_SOLVER_ipopt import DTQPy_SOLVER_ipopt
from weis.dtqpy.solver.DTQPy_SOLVER_slsqp import DTQPy_SOLVER_slsqp
except Exception:
PYOPT = False
from weis.dtqpy.solver.DTQPy_SOLVER_ipopt import DTQPy_SOLVER_ipopt
from weis.dtqpy.solver.DTQPy_SOLVER_slsqp import DTQPy_SOLVER_slsqp

def DTQPy_SOLVER(H,f,A,b,Aeq,beq,lb,ub,internal,opts):


displevel = opts.general.displevel

# osqp
if opts.solver.function == 'osqp' or not PYOPT:
if opts.solver.function == 'osqp':
X,F,intrnal,opts = DTQPy_SOLVER_osqp(H,f,A,b,Aeq,beq,lb,ub,internal,opts)

elif opts.solver.function == 'ipopt':
Expand Down
12 changes: 5 additions & 7 deletions weis/dtqpy/solver/DTQPy_SOLVER_ipopt.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@
Contributor: Athul Krishna Sundarrajan (AthulKrishnaSundarrajan on Github)
Primary Contributor: Daniel R. Herber (danielrherber on Github)
"""

# import pyoptsparse
from pyoptsparse import IPOPT, Optimization
from scipy import sparse


import argparse
import numpy as np

PYOPT = True
try:
from pyoptsparse import IPOPT, Optimization
except Exception:
PYOPT = False
import numpy as np


def DTQPy_SOLVER_ipopt(H,f,A,b,Aeq,beq,lb,ub,internal,opts):
Expand Down
14 changes: 6 additions & 8 deletions weis/dtqpy/solver/DTQPy_SOLVER_slsqp.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@
Contributor: Athul Krishna Sundarrajan (AthulKrishnaSundarrajan on Github)
Primary Contributor: Daniel R. Herber (danielrherber on Github)
"""

# import pyoptsparse
from pyoptsparse import OPT, Optimization
from scipy import sparse


import argparse

import numpy as np
# import pyoptsparse
PYOPT = True
try:
from pyoptsparse import OPT, Optimization
except Exception:
PYOPT = False


def DTQPy_SOLVER_slsqp(H,f,A,b,Aeq,beq,lb,ub,internal,opts):
Expand Down Expand Up @@ -142,4 +140,4 @@ def Sens(self,xdict,funcs):
F = sol.fStar

# return
return X,F,internal,opts
return X,F,internal,opts

0 comments on commit 2b87946

Please sign in to comment.