Skip to content
Merged
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
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@
"version_info": {
"current": release,
"versions": {
"main": "/main/",
"main": "/",
}
}
}

# Add any tags to the versions dictionary
import subprocess
try:
tags = subprocess.check_output(['git', 'tag', '-l', 'v*.*.*']).decode().strip().split('\n')
tags = subprocess.check_output(['git', 'tag', '-l', '"v*.*.*"']).decode().strip().split('\n')
for tag in tags:
if tag:
html_context["version_info"]["versions"][tag] = f"/{tag}/"
Expand Down
2 changes: 1 addition & 1 deletion engibench/problems/airfoil/pyopt_history.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ruff: noqa: D101,N999,D205,N803,N802,N806,FBT002,D416,SIM118,RET503,RET502,RET505,D212,ISC003,SLF001,C901,PLR0913,PLR0912,PLR0915,S110,BLE001,SIM102,PLR2004
# ruff: noqa: D101,D205,N803,N802,N806,FBT002,D416,SIM118,RET503,RET502,RET505,D212,ISC003,SLF001,C901,PLR0913,PLR0912,PLR0915,S110,BLE001,SIM102,PLR2004
"""This file is copy pasted from pyOptSparse: https://github.com/mdolab/pyoptsparse/blob/main/pyoptsparse/pyOpt_history.py.

It is used to read the history of an optimization run.
Expand Down
5 changes: 1 addition & 4 deletions engibench/problems/airfoil/v0.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from typing import Annotated, Any

from gymnasium import spaces
import matplotlib.pyplot as plt
import numpy as np
import numpy.typing as npt
import pandas as pd
Expand Down Expand Up @@ -532,8 +533,6 @@ def render(self, design: DesignType, *, open_window: bool = False, save: bool =
Returns:
Any: The rendered design.
"""
import matplotlib.pyplot as plt

fig, ax = plt.subplots()
coords = design["coords"]
alpha = design["angle_of_attack"]
Expand Down Expand Up @@ -561,8 +560,6 @@ def render_optisteps(self, optisteps_history: list[OptiStep], *, open_window: bo
Returns:
Any: Rendered optimization step history.
"""
import matplotlib.pyplot as plt

fig, ax = plt.subplots()
steps = np.array([step.step for step in optisteps_history])
objectives = np.array([step.obj_values[0][0] for step in optisteps_history])
Expand Down
2 changes: 1 addition & 1 deletion engibench/problems/beams2d/backend.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ruff: noqa: N806, N815, N816
# ruff: noqa: N806, N815
# Disabled variable name conventions

"""Beams 2D problem.
Expand Down
7 changes: 3 additions & 4 deletions engibench/problems/beams2d/v0.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ruff: noqa: N806, N815, N816
# ruff: noqa: N806
# Disabled variable name conventions

"""Beams 2D problem."""
Expand All @@ -9,8 +9,10 @@
from typing import Annotated, Any

from gymnasium import spaces
import matplotlib.pyplot as plt
import numpy as np
import numpy.typing as npt
import seaborn as sns

from engibench.constraint import bounded
from engibench.constraint import constraint
Expand Down Expand Up @@ -300,9 +302,6 @@ def render(self, design: np.ndarray, *, open_window: bool = False) -> Any:
Returns:
Any: The rendered design.
"""
import matplotlib.pyplot as plt
import seaborn as sns

fig, ax = plt.subplots(figsize=(8, 4))
sns.heatmap(design, cmap="coolwarm", ax=ax, vmin=0, vmax=1)

Expand Down
3 changes: 1 addition & 2 deletions engibench/problems/heatconduction2d/v0.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from typing import Annotated, Any

from gymnasium import spaces
import matplotlib.pyplot as plt
import numpy as np
import numpy.typing as npt

Expand Down Expand Up @@ -270,8 +271,6 @@ def render(self, design: npt.NDArray, *, open_window: bool = False) -> Any:
if design is None:
design = self.initialize_design()

import matplotlib.pyplot as plt

fig, ax = plt.subplots()

im = ax.imshow(design, "hot")
Expand Down
3 changes: 1 addition & 2 deletions engibench/problems/heatconduction3d/v0.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from typing import Annotated, Any

from gymnasium import spaces
import matplotlib.pyplot as plt
import numpy as np
import numpy.typing as npt

Expand Down Expand Up @@ -273,8 +274,6 @@ def render(self, design: npt.NDArray, *, open_window: bool = False) -> Any:
if design is None:
design = self.initialize_design()

import matplotlib.pyplot as plt

size = len(design) + 1

fig = plt.figure()
Expand Down
2 changes: 1 addition & 1 deletion engibench/problems/power_electronics/utils/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Set up the configuration for the Power Electronics problem."""
# ruff: noqa: N806, N815 # Upper case
# ruff: noqa: N815 # Upper case

from dataclasses import dataclass
from dataclasses import field
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Read from the log file to get the DcGain and Voltage Ripple values."""
# ruff: noqa: N806, N815 # Upper case
# ruff: noqa: N806 # Upper case

import numpy as np

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# ruff: noqa: N806, N815 # Upper case

"""Use the sweep_data to set config parameters."""

from engibench.problems.power_electronics.utils.config import Config
Expand Down
2 changes: 1 addition & 1 deletion engibench/problems/power_electronics/v0.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ruff: noqa: N806, N815
# ruff: noqa: N806


"""Power Electronics problem."""
Expand Down
Loading