Skip to content

Commit

Permalink
remove unsupported optimization approaches and leftover wisdem refere… (
Browse files Browse the repository at this point in the history
#37)

* remove unsupported optimization approaches and leftover wisdem references

* update changelog
  • Loading branch information
jaredthomas68 authored Nov 1, 2024
1 parent 9894d83 commit 3807e3b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 29 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
- Replaces the git ProFAST installation with a PyPI installation.
- Removed dependence on external electrolyzer repo
- Updated CI to use conda environments with reproducible environment artifacts
- Rename logger from "wisdem/weis" to "greenheart"
- Remove unsupported optimization algorithms

## v0.1.2 [28 October 2024]

Expand Down
28 changes: 0 additions & 28 deletions greenheart/tools/optimization/gc_PoseOptimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,6 @@ def __init__(self, config: GreenHeartSimulationConfig):

self.config = config

self.nlopt_methods = [
"GN_DIRECT",
"GN_DIRECT_L",
"GN_DIRECT_L_NOSCAL",
"GN_ORIG_DIRECT",
"GN_ORIG_DIRECT_L",
"GN_AGS",
"GN_ISRES",
"LN_COBYLA",
"LD_MMA",
"LD_CCSAQ",
"LD_SLSQP",
]

self.scipy_methods = [
"SLSQP",
"Nelder-Mead",
Expand Down Expand Up @@ -265,20 +251,6 @@ def set_driver(self, opt_prob):
]
opt_prob = self._set_optimizer_properties(opt_prob, options_keys)

elif opt_options["solver"] in self.nlopt_methods:
try:
from wisdem.optimization_drivers.nlopt_driver import NLoptDriver
except:
raise ImportError(
"You requested an optimization method from NLopt, but need to first install NLopt to use this method."
)

opt_prob.driver = NLoptDriver()
opt_prob.driver.options["optimizer"] = opt_options["solver"]
options_keys = ["tol", "xtol", "max_iter", "max_time", "numgen"]
mapped_keys = {"max_iter": "maxiter", "max_time": "maxtime"}
opt_prob = self._set_optimizer_properties(opt_prob, options_keys, mapped_keys=mapped_keys)

else:
raise ValueError(f"The {self.config.greenheart_config['opt_options']['driver']['optimization']['solver']} optimizer is not yet supported!")

Expand Down
2 changes: 1 addition & 1 deletion greenheart/tools/optimization/gc_run_greenheart.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def run_greenheart(config:GreenHeartSimulationConfig, overridden_values=None, ru
os.makedirs(folder_output, exist_ok=True)

# create logger
logger = logging.getLogger("wisdem/weis")
logger = logging.getLogger("greenheart")
logger.setLevel(logging.INFO)

# create handlers
Expand Down

0 comments on commit 3807e3b

Please sign in to comment.