Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 12 additions & 0 deletions .github/workflows/format-and-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Format and Lint

on:
push:
branches: [main]
tags:
- v*.*.*
pull_request:

jobs:
pre-commit:
uses: mdolab/.github/.github/workflows/format-and-lint.yaml@ruffConfig
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@
doc/_build

# VS code configurations
*.vscode
*.vscode

# pre-commit/ruff configuration
.pre-commit-config.yaml
ruff.toml
5 changes: 1 addition & 4 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,10 @@ All rights reserved.
______________________________________________________________________________

baseClasses is licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License. You may obtain a copy of the License at:\
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
______________________________________________________________________________

University of Michigan's Multidisciplinary Design Optimization Laboratory (MDO Lab)\
College of Engineering, Aerospace Engineering Department\
http://mdolab.engin.umich.edu/
______________________________________________________________________________



2 changes: 1 addition & 1 deletion baseclasses/problems/pyAero_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ def addDV(
Examples
--------
>>> # Add alpha variable with typical bounds
>>> ap.addDV('alpha', value=2.5, lower=0.0, upper=10.0, scale=0.1)
>>> ap.addDV("alpha", value=2.5, lower=0.0, upper=10.0, scale=0.1)
"""

if (key not in self.allVarFuncs) and (key not in self.possibleBCDVs):
Expand Down
2 changes: 1 addition & 1 deletion baseclasses/problems/pyFieldPerformance_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def addDV(self, key, value=None, lower=None, upper=None, scale=1.0, name=None, d
Examples
--------
>>> # Add alpha variable with typical bounds
>>> fpp.addDV('TOW', value=250000, lower=0.0, upper=300000.0, scale=0.1)
>>> fpp.addDV("TOW", value=250000, lower=0.0, upper=300000.0, scale=0.1)
"""

# First check if we are allowed to add the DV:
Expand Down
2 changes: 1 addition & 1 deletion baseclasses/problems/pyMission_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ def addDV(self, paramKey, lower=-1e20, upper=1e20, scale=1.0, name=None):
Examples
--------
>>> # Add initMach variable with typical bounds
>>> seg.addDV('initMach', value=0.75, lower=0.0, upper=1.0, scale=1.0)
>>> seg.addDV("initMach", value=0.75, lower=0.0, upper=1.0, scale=1.0)
"""

# First check if we are allowed to add the DV:
Expand Down
2 changes: 1 addition & 1 deletion baseclasses/problems/pyStruct_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class StructProblem:

Examples
--------
>>> sp = StructProblem('lc0', loadFile='loads.txt')
>>> sp = StructProblem("lc0", loadFile="loads.txt")
"""

def __init__(self, name, loadFile=None, loadFactor=None, evalFuncs=None):
Expand Down
6 changes: 3 additions & 3 deletions baseclasses/problems/pyWeight_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def setSurface(self, surf):
>>> surf = CFDsolver.getTriangulatedMeshSurface()
>>> wp.setSurface(surf)
>>> # Or using a pyGeo surface object:
>>> surf = pyGeo('iges',fileName='wing.igs')
>>> surf = pyGeo("iges", fileName="wing.igs")
>>> wp.setSurface(surf)

"""
Expand Down Expand Up @@ -643,8 +643,8 @@ def addDV(
Examples
--------
>>> # Add W variable with typical bounds
>>> fuelCase.addDV('fuelFraction', value=0.5, lower=0.0, upper=1.0, scale=0.1)
>>> fuelCase.addDV('reserveFraction', value=0.1, lower=0.0, upper=1.0, scale=0.1)
>>> fuelCase.addDV("fuelFraction", value=0.5, lower=0.0, upper=1.0, scale=0.1)
>>> fuelCase.addDV("reserveFraction", value=0.1, lower=0.0, upper=1.0, scale=0.1)
"""

# First check if we are allowed to add the DV:
Expand Down
7 changes: 4 additions & 3 deletions baseclasses/solvers/BaseSolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(
name,
category,
defaultOptions={},
options={},
options=None,
immutableOptions=set(),
deprecatedOptions={},
comm=None,
Expand Down Expand Up @@ -87,8 +87,9 @@ def __init__(
else:
self.setOption(key, optionValue)

for key in options:
self.setOption(key, options[key])
if options is not None:
for key in options:
self.setOption(key, options[key])

self.solverCreated = True

Expand Down
2 changes: 1 addition & 1 deletion baseclasses/solvers/pyAero_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ def setSurfaceCoordinates(self, coordinates, groupName=None):

self._updateGeomInfo = True
if self.mesh is None:
raise Error("Cannot set new surface coordinate locations without a mesh" "warping object present.")
raise Error("Cannot set new surface coordinate locations without a meshwarping object present.")

# First get the surface coordinates of the meshFamily in case
# the groupName is a subset, those values will remain unchanged.
Expand Down
2 changes: 1 addition & 1 deletion doc/regression_example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ Then, when running ``testflo`` we can specify to run all of the training functio

Normally, when ``testflo`` is run, it looks for all functions that begin with ``test_``.
The ``-m`` flag allows us to specify a different prefix.
In this case, by using the ``train_`` prefix on all of the training functions we can run them all at once with the above command.
In this case, by using the ``train_`` prefix on all of the training functions we can run them all at once with the above command.
Once the reference files are created, just calling ``testflo`` will run all the regression tests.
Loading