Skip to content

Commit

Permalink
Migrate to RTD and Codecov and update package version to 0.4.0 (#34)
Browse files Browse the repository at this point in the history
* Updated version from 0.3.2 to 0.4.0

* Updated setup.py

* Moved docs to MDO Lab sphinx theme

* Updated badge on docs from travis to GHA

* Switched from coveralls to codecov

* Added sphinx_mdolab_theme for GHA

* Stopped sphinx's complaining

* Changed codecov-action version to try to get coverage upload to work

* Added .codecov.yml

* Tried adding XML output of coverage report

* Removed XML coverage file format

* Added doc build status badges

* Added docs requirements file

* Updated documentation link in README

* Moved sphinx_mdolab_theme from .[docs] to .[testing]

* Added CODECOV_TOKEN for uploading to codecov

* Trying with token and XML

* Updated readme and docs index page

* Fixed typo in docstring

* Final (hopefully) small changes to docstrings

* Moved OpenAeroStruct install to setup.py instead of in GHA workflow

* Added OpenAeroStruct to [testing] install (and limited OpenMDAO to 3.10.0 in [testing] for OAS

* Removed openmdao==3.10 from [testing] since pip automatically handles it!

* Trying curl for all OS in GHA

* Doc/docstring edits to address more of Neil's comments

* Added OpenMDAO-style citation to OAS-related classes

* Removed NOTE: from description of docstrings
  • Loading branch information
eytanadler committed Jan 27, 2022
1 parent 697fb9c commit a512c84
Show file tree
Hide file tree
Showing 9 changed files with 166 additions and 144 deletions.
25 changes: 8 additions & 17 deletions .github/workflows/openconcept.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,7 @@ jobs:
run: |
pip install coverage pytest-cov sphinx_rtd_theme
pip install .[testing]
- name: Install OpenAeroStruct
run: |
pip install git+https://github.com/mdolab/OpenAeroStruct.git@master
- if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
name: Download engine deck surrogate model data Ubuntu/macOS
run: |
wget http://umich.edu/~mdolaboratory/repo_files/openconcept/engine_kriging_surrogate_model.tar.gz
- if: ${{ matrix.os == 'windows-latest' }}
name: Download engine deck surrogate model data Windows
- name: Download engine deck surrogate model
run: |
curl -L -o engine_kriging_surrogate_model.tar.gz http://umich.edu/~mdolaboratory/repo_files/openconcept/engine_kriging_surrogate_model.tar.gz
- name: Move engine deck files to appropriate location
Expand All @@ -50,11 +42,10 @@ jobs:
mv n3* ./openconcept/components/empirical_data/n+3
- name: Build and Test
run: |
python -m pytest --cov-config .coveragerc --cov=openconcept
- name: Push to Coveralls
if: ${{ matrix.os == 'ubuntu-latest' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pip install coveralls
coveralls --service=github --rcfile=.coveragerc
python -m pytest --cov-config=.coveragerc --cov=openconcept --cov-report=xml
- name: Upload coverage to Codecov
if: ${{ matrix.os == 'ubuntu-latest'}}
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ openconcept/.coverage
scratch/
*.out
*.zip
*.npy
.DS_Store
8 changes: 5 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import openmdao
import openconcept

from sphinx_mdolab_theme.config import *

sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath('./_exts'))
Expand Down Expand Up @@ -184,9 +186,8 @@ def patched_parse(self):

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

project = 'openconcept'
copyright = '2018, Benjamin J. Brelje'
author = 'Benjamin J. Brelje'
project = 'OpenConcept'
author = 'Benjamin J. Brelje and Eytan J. Adler'

import openconcept
# The short X.Y version
Expand Down Expand Up @@ -360,6 +361,7 @@ def patched_parse(self):
# os.rename('_srcdocs_native/modules.rst','_srcdocs_native/index.rst')
# openmdao way
packages = ['analysis',
'analysis.openaerostruct',
'analysis.atmospherics',
'analysis.performance',
'components',
Expand Down
75 changes: 35 additions & 40 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,10 @@
OpenConcept
===========

.. image:: https://travis-ci.org/mdolab/openconcept.svg?branch=master
:target: https://travis-ci.org/mdolab/openconcept
:alt: Linux Status

.. image:: https://ci.appveyor.com/api/projects/status/tn4hv14w5xlree4t/branch/master?svg=true
:target: https://ci.appveyor.com/project/bbrelje/openconcept/branch/master
:alt: Windows Status

.. image:: https://coveralls.io/repos/github/mdolab/openconcept/badge.svg
:target: https://coveralls.io/github/mdolab/openconcept
:alt: Coverage Status

.. image:: https://readthedocs.org/projects/openconcept/badge/?version=latest
:target: https://openconcept.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status


OpenConcept is a new toolkit for the conceptual design of aircraft.
OpenConcept is a toolkit for the conceptual design of aircraft.
It is open source (GitHub: https://github.com/mdolab/openconcept) and MIT licensed.
OpenConcept was developed in order to model and optimize aircraft with electric propulsion at low computational cost.
The tools are built on top of NASA Glenn's `OpenMDAO <http://openmdao.org/>`_ framework, which in turn is written in Python.
The tools are built on top of NASA Glenn's `OpenMDAO <http://openmdao.org/>`__ framework, which in turn is written in Python.

The following charts show more than 250 individually optimized hybrid-electric light twin aircraft (similar to a King Air C90GT).
Optimizing hundreds of configurations can be done in a couple of hours on a standard laptop computer.
Expand All @@ -40,44 +23,56 @@ Accurate, efficient derivatives enable the use of Newton nonlinear equation solu
---------------
Getting Started
---------------
1. Clone the repo to disk (`git clone https://github.com/mdolab/openconcept`)
2. If you use Anaconda, create a virtual environment using the environment.yml file (`conda env create environment.yml`) and then activate it using `conda activate openconcept`.
3. If you wish to install OpenConcept in your Python distribution, run `python setup.py install`.
4. Run `python examples\TBM850.py` to test OpenConcept on a single-engine turboprop aircraft (the TBM 850)
5. Look at the `examples\aircraft data\TBM850.py` folder to play with the assumptions / config / geometry and see the effects on the output result

1. Clone the repo to disk (``git clone https://github.com/mdolab/openconcept``)
2. Navigate to the root ``openconcept`` folder
3. Run ``pip install -e .`` to install the package (the ``-e`` can be omitted if not editing the source)
4. Navigate to the ``examples`` folder
5. Run ``python TBM850.py`` to test OpenConcept on a single-engine turboprop aircraft (the TBM 850)
6. Look at the ``examples/aircraft data/TBM850.py`` file to play with the assumptions / config / geometry and see the effects on the output result

------------
Dependencies
------------
This toolkit requires the use of OpenMDAO 3.0.0 or later due to backward-incompatible changes.
However, 2.8+ can be used with very minor keyword argument changes to OpenMDAO components
This toolkit requires the use of `OpenMDAO <https://openmdao.org>`__ 3.10.0 or later due to backward-incompatible changes. OpenMDAO requires a recent NumPy and SciPy.
If you'd like to use the OpenAeroStruct features of OpenConcept, OpenMDAO 3.10 is required because that is the newest version supported by OpenAeroStruct at the time of writing this.
Python 3.8 is recommended since it is the version with which the code is tested, but newer Python versions will likely work as well.

---------------
Please Cite Us!
---------------

Please cite this software by reference to the conference paper:

*Plaintext:*
Please cite this software by reference to the `conference paper <https://www.researchgate.net/publication/326263660_Development_of_a_Conceptual_Design_Model_for_Aircraft_Electric_Propulsion_with_Efficient_Gradients>`__:

Benjamin J. Brelje and Joaquim R.R.A. Martins.
"Development of a Conceptual Design Model for Aircraft Electric Propulsion with Efficient Gradients",
2018 AIAA/IEEE Electric Aircraft Technologies Symposium,
AIAA Propulsion and Energy Forum, (AIAA 2018-4979) DOI: TBD

*Bibtex:*
AIAA Propulsion and Energy Forum, (AIAA 2018-4979) DOI: 10.2514/6.2018-4979

::

@inproceedings{Brelje2018,
Address = {{C}incinnati,~{OH}},
Author = {Benjamin J. Brelje and Joaquim R. R. A. Martins},
Booktitle = {2018 AIAA/IEEE Electric Aircraft Technologies Symposium},
Month = jul,
Title = {Development of a Conceptual Design Model for Aircraft Electric Propulsion with Efficient Gradients},
Year = 2018,
Number = {AIAA-2018-4979},
address = {{C}incinnati,~{OH}},
author = {Benjamin J. Brelje and Joaquim R. R. A. Martins},
booktitle = {2018 AIAA/IEEE Electric Aircraft Technologies Symposium},
month = {July},
title = {Development of a Conceptual Design Model for Aircraft Electric Propulsion with Efficient Gradients},
year = {2018},
doi = {10.2514/6.2018-4979}
}

If using the integrated OpenAeroStruct VLM or aerostructural aerodynamic models, please cite the following `conference paper <https://www.researchgate.net/publication/357559489_Aerostructural_wing_design_optimization_considering_full_mission_analysis>`__:

Eytan J. Adler and Joaquim R.R.A. Martins, "Aerostructural wing design optimization considering full mission analysis", 2022 AIAA SciTech Forum, San Diego, CA, January 2022. DOI: 10.2514/6.2022-0382

::

@inproceedings{Adler2022a,
author = {Eytan J. Adler and Joaquim R. R. A. Martins},
title = {Aerostructural wing design optimization considering full mission analysis},
booktitle = {AIAA SciTech Forum},
doi = {10.2514/6.2022-0382},
month = {January},
year = {2022}
}

------------
Expand Down
2 changes: 1 addition & 1 deletion openconcept/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.3.2'
__version__ = '0.4.0'
105 changes: 59 additions & 46 deletions openconcept/analysis/openaerostruct/aerostructural.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
"""
This work was the basis of the following paper.
Please cite it if you use this for your own publication!
@InProceedings{Adler2022a,
author = {Eytan J. Adler and Joaquim R. R. A. Martins},
title = {Aerostructural wing design optimization considering full mission analysis},
booktitle = {AIAA SciTech Forum},
doi = {10.2514/6.2022-0382},
month = {January},
year = {2022}
}
Eytan Adler (Jan 2022)
"""

from __future__ import division

import numpy as np
Expand Down Expand Up @@ -50,6 +34,17 @@
# Utitilty for vector manipulation
from openconcept.utilities.math.combine_split_comp import VectorConcatenateComp

CITATION = """
@InProceedings{Adler2022a,
author = {Eytan J. Adler and Joaquim R. R. A. Martins},
title = {Aerostructural wing design optimization considering full mission analysis},
booktitle = {AIAA SciTech Forum},
doi = {10.2514/6.2022-0382},
month = {January},
year = {2022}
}
"""


class OASAerostructDragPolar(om.Group):
"""
Expand All @@ -60,11 +55,13 @@ class OASAerostructDragPolar(om.Group):
This component cannot currently handle fuel loads on the wing,
nor can it handle point loads applied to the structure.
NOTE: the spanwise variables (twist, toverc, skin/spar thickness) are ordered
starting at the tip and moving to the root; a twist of [-1, 0, 1] would
have a tip twist of -1 deg and root twist of 1 deg
Notes
-----
The spanwise variables (twist, toverc, skin/spar thickness) are ordered
starting at the tip and moving to the root; a twist of [-1, 0, 1] would
have a tip twist of -1 deg and root twist of 1 deg
NOTE: set the OMP_NUM_THREADS environment variable to 1 for much better parallel training performance!
Set the OMP_NUM_THREADS environment variable to 1 for much better parallel training performance!
Inputs
------
Expand Down Expand Up @@ -102,10 +99,10 @@ class OASAerostructDragPolar(om.Group):
drag coefficient computed by OpenAeroStruct (scalar, dimensionless)
fltcond|TempIncrement : float
Temperature increment for non-standard day (scalar, degC)
NOTE: fltcond|TempIncrement is a scalar in this component but a vector in OC.
This will be the case for the forseeable future because of the way the
OASDataGen component is set up. To make it work, TempIncrement would
need to be an input to the surrogate, which is not worth the extra
NOTE: fltcond|TempIncrement is a scalar in this component but a vector in OC. \
This will be the case for the forseeable future because of the way the \
OASDataGen component is set up. To make it work, TempIncrement would \
need to be an input to the surrogate, which is not worth the extra \
training cost (at minimum a 2x increase).
Outputs
Expand Down Expand Up @@ -152,6 +149,10 @@ class OASAerostructDragPolar(om.Group):
is limited to adjusting the input parameters to this component.
"""

def __init__(self, **kwargs):
super().__init__(**kwargs)
self.cite = CITATION

def initialize(self):
self.options.declare("num_nodes", default=1, desc="Number of analysis points to run")
self.options.declare("num_x", default=3, desc="Number of streamwise mesh points")
Expand Down Expand Up @@ -260,9 +261,11 @@ class OASDataGen(om.ExplicitComponent):
planform geometry by the inputs. This component will only recalculate
the lift and drag grid when the planform shape changes.
NOTE: the spanwise variables (twist, toverc, skin/spar thickness) are ordered
starting at the tip and moving to the root; a twist of [-1, 0, 1] would
have a tip twist of -1 deg and root twist of 1 deg
Notes
-----
The spanwise variables (twist, toverc, skin/spar thickness) are ordered
starting at the tip and moving to the root; a twist of [-1, 0, 1] would
have a tip twist of -1 deg and root twist of 1 deg
Inputs
------
Expand Down Expand Up @@ -336,6 +339,10 @@ class OASDataGen(om.ExplicitComponent):
Difference in input variable above which to regenerate the training data.
"""

def __init__(self, **kwargs):
super().__init__(**kwargs)
self.cite = CITATION

def initialize(self):
self.options.declare("num_x", default=3, desc="Number of streamwise mesh points")
self.options.declare("num_y", default=7, desc="Number of spanwise (half wing) mesh points")
Expand Down Expand Up @@ -757,9 +764,11 @@ class Aerostruct(om.Group):
This component currently does not support distributed fuel loads
or point loads added to the structure.
NOTE: the spanwise variables (twist, toverc, skin/spar thickness) are ordered
starting at the tip and moving to the root; a twist of [-1, 0, 1] would
have a tip twist of -1 deg and root twist of 1 deg
Notes
-----
The spanwise variables (twist, toverc, skin/spar thickness) are ordered
starting at the tip and moving to the root; a twist of [-1, 0, 1] would
have a tip twist of -1 deg and root twist of 1 deg
Inputs
------
Expand Down Expand Up @@ -827,6 +836,10 @@ class Aerostruct(om.Group):
is limited to adjusting the input parameters to this component.
"""

def __init__(self, **kwargs):
super().__init__(**kwargs)
self.cite = CITATION

def initialize(self):
self.options.declare("num_x", default=3, desc="Number of streamwise mesh points")
self.options.declare("num_y", default=7, desc="Number of spanwise (half wing) mesh points")
Expand Down Expand Up @@ -1292,18 +1305,14 @@ def setup(self):

class OASAerostructDragPolarExact(om.Group):
"""
WARNING WARNING WARNING
----------------------------------------------------------------------
This component is far more computationally expensive than the
OASAerostructDragPolar component, which uses a surrogate. For missions
with many flight segments, many num_nodes, or wing models with high
num_x and num_y values this component will result in a system that
returns a memory error when solved with a DirectSolver linear solver
because the Jacobian is too large to be factorized. Unless you know
what you're doing, this component should not be used (use
OASAerostructDragPolar instead).
----------------------------------------------------------------------
WARNING WARNING WARNING
.. warning:: This component is far more computationally expensive than the
OASAerostructDragPolar component, which uses a surrogate. For missions
with many flight segments, many num_nodes, or wing models with high
num_x and num_y values this component will result in a system that
returns a memory error when solved with a DirectSolver linear solver
because the Jacobian is too large to be factorized. Unless you know
what you're doing, this component should not be used (use
OASAerostructDragPolar instead).
Drag polar and wing weight estimate generated using OpenAeroStruct's
aerostructural analysis capabilities directly, without a surrogate in the loop.
Expand Down Expand Up @@ -1344,10 +1353,10 @@ class OASAerostructDragPolarExact(om.Group):
drag coefficient computed by OpenAeroStruct (scalar, dimensionless)
fltcond|TempIncrement : float
Temperature increment for non-standard day (scalar, degC)
NOTE: fltcond|TempIncrement is a scalar in this component but a vector in OC.
This will be the case for the forseeable future because of the way the
OASDataGen component is set up. To make it work, TempIncrement would
need to be an input to the surrogate, which is not worth the extra
NOTE: fltcond|TempIncrement is a scalar in this component but a vector in OC. \
This will be the case for the forseeable future because of the way the \
OASDataGen component is set up. To make it work, TempIncrement would \
need to be an input to the surrogate, which is not worth the extra \
training cost (at minimum a 2x increase).
Outputs
Expand Down Expand Up @@ -1388,6 +1397,10 @@ class OASAerostructDragPolarExact(om.Group):
is limited to adjusting the input parameters to this component.
"""

def __init__(self, **kwargs):
super().__init__(**kwargs)
self.cite = CITATION

def initialize(self):
self.options.declare("num_nodes", default=1, desc="Number of analysis points to run")
self.options.declare("num_x", default=3, desc="Number of streamwise mesh points")
Expand Down

0 comments on commit a512c84

Please sign in to comment.