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
9 changes: 3 additions & 6 deletions cloud/aws/cloudformation/FOQUS_SLM_instance_in_subnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
from awacs.aws import Allow, Statement, Principal, Policy, Action
from awacs.sts import AssumeRole


# Globals
# bucket_name:
# used by instance cloud-init scripts to grab installers, etc
Expand All @@ -76,11 +75,9 @@ def _create_template(
"""returns Template instance"""
t = Template()
t.add_version("2010-09-09")
t.add_description(
"""Template to create SLM instance and bind to
t.add_description("""Template to create SLM instance and bind to
passed in Network Interface\
"""
)
""")

keyname_param = t.add_parameter(
Parameter(
Expand Down Expand Up @@ -398,7 +395,7 @@ def main():
usage="USAGE: %prog [vpc_id] [subnet_id] [internet_gateway_id] [network_interface_id] [allocation_id]",
description=main.__doc__,
)
(options, args) = op.parse_args()
options, args = op.parse_args()
# if len(args) != 1: usage()
# command = args[0]
# Ref(VPC)
Expand Down
1 change: 1 addition & 0 deletions cloud/aws/foqus_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
Joshua Boverhof, Lawrence Berkeley National Lab

"""

import os, sys
import traceback
import win32api
Expand Down
1 change: 0 additions & 1 deletion docs/source/_repopath.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from sphinx.application import Sphinx as SphinxApp
from sphinx.roles import EmphasizedLiteral


_logger = logging.getLogger(f"sphinx.ext.{__name__}")


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,6 @@ def interpolate(npts, XX, oid):
else:
if y in labels:
index = labels.index(y)
(nSamples, inputVectors, nInputs) = getInputData(infileName)
nSamples, inputVectors, nInputs = getInputData(infileName)
result = interpolate(nSamples, inputVectors, index)
genOutputFile(outfileName, result)
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,6 @@ def interpolate(npts, XX, oid):
else:
if y in labels:
index = labels.index(y)
(nSamples, inputVectors, nInputs) = getInputData(infileName)
nSamples, inputVectors, nInputs = getInputData(infileName)
result = interpolate(nSamples, inputVectors, index)
genOutputFile(outfileName, result)
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import pickle
from types import SimpleNamespace


# Example follows the sequence below:
# 1) Code at end of file to import data and create model
# 2) Call create_model() to define inputs and outputs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import pickle
from types import SimpleNamespace


# Example follows the sequence below:
# 1) Code at end of file to import data and create model
# 2) Call create_model() to define inputs and outputs
Expand Down
1 change: 1 addition & 0 deletions foqus_lib/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"""
Joshua Boverhof, Lawrence Berkeley National Labs, 2024
"""

import os, shutil, logging

# from foqus_lib.framework.session.session import generalSettings as FoqusSettings
Expand Down
1 change: 1 addition & 0 deletions foqus_lib/framework/foqusException/foqusException.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

John Eslick, Carnegie Mellon University, 2014
"""

import traceback


Expand Down
2 changes: 1 addition & 1 deletion foqus_lib/framework/foqusOptions/option.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# "https://github.com/CCSI-Toolset/FOQUS".
#################################################################################
"""option.py

This is an options class for FOQUS, mainly used for optimization and surrogate
model plugins.

Expand Down
2 changes: 1 addition & 1 deletion foqus_lib/framework/graph/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -1877,7 +1877,7 @@ def sear(depth, prevY):
# rows of A are cycles and columns of A are edges
# 1 if a edge is in a cycle 0 otherwise
[A, cycles, cycleEdges] = self.cycleEdgeMatrix() #
(nr, nc) = A.shape
nr, nc = A.shape
if nr == 0: # no cycles no tear edges and we are done
return [[[]], 0, 0]
# There are cycles so find tear edges.
Expand Down
1 change: 0 additions & 1 deletion foqus_lib/framework/listen/listen.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
John Eslick, Carnegie Mellon University, 2014
"""


import copy
import logging
import threading
Expand Down
2 changes: 1 addition & 1 deletion foqus_lib/framework/ml_ai_models/mlaiSearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# respectively. This file is also available online at the URL
# "https://github.com/CCSI-Toolset/FOQUS".
#################################################################################
""" mlaiSearch.py
"""mlaiSearch.py

* This class looks for ml_ai model files and creates a list containing the
NN model names.
Expand Down
3 changes: 2 additions & 1 deletion foqus_lib/framework/optimizer/BFGS.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# respectively. This file is also available online at the URL
# "https://github.com/CCSI-Toolset/FOQUS".
#################################################################################
""" #FOQUS_OPT_PLUGIN
"""#FOQUS_OPT_PLUGIN

Optimization plugins need to have the string "#FOQUS_OPT_PLUGIN" near the
beginning of the file (see pluginSearch.plugins() for exact character count of
Expand All @@ -23,6 +23,7 @@

John Eslick, Carnegie Mellon University, 2014
"""

import logging
import math
import time
Expand Down
3 changes: 2 additions & 1 deletion foqus_lib/framework/optimizer/NLopt.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# respectively. This file is also available online at the URL
# "https://github.com/CCSI-Toolset/FOQUS".
#################################################################################
""" #FOQUS_OPT_PLUGIN
"""#FOQUS_OPT_PLUGIN

Optimization plugins need to have the string "#FOQUS_OPT_PLUGIN" near the
beginning of the file (see pluginSearch.plugins() for exact character count of
Expand All @@ -25,6 +25,7 @@

John Eslick, Carnegie Mellon University, 2014
"""

import logging
import math
import time # Some of these things are left over from CMA-ES
Expand Down
2 changes: 1 addition & 1 deletion foqus_lib/framework/optimizer/OptCMA.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# respectively. This file is also available online at the URL
# "https://github.com/CCSI-Toolset/FOQUS".
#################################################################################
""" #FOQUS_OPT_PLUGIN
"""#FOQUS_OPT_PLUGIN

Optimization plugins need to have the string "#FOQUS_OPT_PLUGIN" near the
beginning of the file (see pluginSearch.plugins() for exact character count of
Expand Down
3 changes: 2 additions & 1 deletion foqus_lib/framework/optimizer/PSUADE.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
# respectively. This file is also available online at the URL
# "https://github.com/CCSI-Toolset/FOQUS".
#################################################################################
""" #FOQUS_OPT_PLUGIN
"""#FOQUS_OPT_PLUGIN

Optimization plugins need to have the string "#FOQUS_OPT_PLUGIN" near the
beginning of the file (see pluginSearch.plugins() for exact character count of
text). They also need to have a .py extension and inherit the optimization class.

"""

import logging

#
Expand Down
2 changes: 1 addition & 1 deletion foqus_lib/framework/optimizer/SLSQP.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# respectively. This file is also available online at the URL
# "https://github.com/CCSI-Toolset/FOQUS".
#################################################################################
""" #FOQUS_OPT_PLUGIN
"""#FOQUS_OPT_PLUGIN

Optimization plugins need to have the string "#FOQUS_OPT_PLUGIN" near the
beginning of the file (see pluginSearch.plugins() for exact character count of
Expand Down
6 changes: 4 additions & 2 deletions foqus_lib/framework/optimizer/SM_Optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# respectively. This file is also available online at the URL
# "https://github.com/CCSI-Toolset/FOQUS".
#################################################################################
""" #FOQUS_OPT_PLUGIN
"""#FOQUS_OPT_PLUGIN

Optimization plugins need to have the string "#FOQUS_OPT_PLUGIN" near the
beginning of the file (see pluginSearch.plugins() for exact character count of
Expand Down Expand Up @@ -101,9 +101,11 @@ def __init__(self, dat=None):
optimization.__init__(self, dat) # base class __init__

# Description of the optimization
self.methodDescription = "This solver provides the option to perform mathematical \
self.methodDescription = (
"This solver provides the option to perform mathematical \
optimization based on surrogate models developed for the FOQUS \
flowsheet"
)
self.available = packages_available # If plugin is available
self.description = "Optimization Solver" # Short description
self.mp = False # Can evaluate objectives in parallel?
Expand Down
2 changes: 1 addition & 1 deletion foqus_lib/framework/optimizer/Sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# respectively. This file is also available online at the URL
# "https://github.com/CCSI-Toolset/FOQUS".
#################################################################################
""" #FOQUS_OPT_PLUGIN
"""#FOQUS_OPT_PLUGIN

Optimization plugins need to have the string "#FOQUS_OPT_PLUGIN" near the
beginning of the file (see pluginSearch.plugins() for exact character count of
Expand Down
2 changes: 1 addition & 1 deletion foqus_lib/framework/optimizer/Snobfit.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# respectively. This file is also available online at the URL
# "https://github.com/CCSI-Toolset/FOQUS".
#################################################################################
""" #FOQUS_OPT_PLUGIN
"""#FOQUS_OPT_PLUGIN

Optimization plugins need to have the string "#FOQUS_OPT_PLUGIN" near the
beginning of the file (see pluginSearch.plugins() for exact character count of
Expand Down
4 changes: 2 additions & 2 deletions foqus_lib/framework/optimizer/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def calculateObj(self, svlist, nsamples=1):
# This is just some error that was caught usually
# means failed to converge.
fail[i] = True
(x, f) = self.get_at_dicts(x, f)
x, f = self.get_at_dicts(x, f)
if self.objtype == self.OBJ_TYPE_EVAL:
(
res[obj_index],
Expand Down Expand Up @@ -474,7 +474,7 @@ def calculateObjVector(self, svlist, nsamples=1):
# This is just some error that was caught usually
# means failed to converge.
fail[i] = True
(xvector, fvector) = self.get_at_dicts(xvector, fvector)
xvector, fvector = self.get_at_dicts(xvector, fvector)
if self.objtype == self.OBJ_TYPE_EVAL:
(
res[obj_index],
Expand Down
2 changes: 1 addition & 1 deletion foqus_lib/framework/plugins/pluginSearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# respectively. This file is also available online at the URL
# "https://github.com/CCSI-Toolset/FOQUS".
#################################################################################
""" pluginSearch.py
"""pluginSearch.py

* This class looks for plugins and creates a dictionary containing.
the plugin models. Plugin objects can be instantiated elsewhere.
Expand Down
2 changes: 1 addition & 1 deletion foqus_lib/framework/sampleResults/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def row_to_flow(self, fs, row, filtered=True):
_log.debug("Row to flowsheet, table row {} dataframe index {}".format(row, idx))
for col in self.columns:
try:
(io_type, node, var) = col.split(".", 2)
io_type, node, var = col.split(".", 2)
except ValueError:
# this would happen for cols with less than two .'s and is
# totally fine
Expand Down
1 change: 1 addition & 0 deletions foqus_lib/framework/sampleResults/test/results_s3_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
John Eslick, Carnegie Mellon University, 2014
See LICENSE.md for license and copyright details.
"""

import json
import logging

Expand Down
2 changes: 1 addition & 1 deletion foqus_lib/framework/sdoe/nusf_dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def criterion(
rand_gen = np.random.default_rng(rand_seed)

def step(
mwr_tuple: Tuple[int, List[int], np.ndarray, Union[np.ndarray, None]]
mwr_tuple: Tuple[int, List[int], np.ndarray, Union[np.ndarray, None]],
) -> Dict:
mwr, rands, cand_np, hist_np = mwr_tuple

Expand Down
1 change: 1 addition & 0 deletions foqus_lib/framework/sdoe/test/test_irsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

See LICENSE.md for license and copyright details.
"""

from importlib import resources
from unittest import result

Expand Down
1 change: 1 addition & 0 deletions foqus_lib/framework/session/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

John Eslick, Carnegie Mellon University, 2014
"""

import collections
import copy
import json
Expand Down
1 change: 1 addition & 0 deletions foqus_lib/framework/sim/process_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Joshua Boverhof, Lawrence Berkeley National Lab

"""

import logging

import psutil
Expand Down
3 changes: 2 additions & 1 deletion foqus_lib/framework/sim/turbineConfiguration.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# respectively. This file is also available online at the URL
# "https://github.com/CCSI-Toolset/FOQUS".
#################################################################################
""" turbineConfiguration.py
"""turbineConfiguration.py

* This class contains Turbine configuration profiles and functions for
interacting with Turbine
Expand All @@ -21,6 +21,7 @@

John Eslick, Carnegie Mellon University, 2014
"""

import configparser
import importlib
import json
Expand Down
1 change: 1 addition & 0 deletions foqus_lib/framework/sim/turbineLiteDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

John Eslick, Carnegie Mellon University, 2014
"""

import os
import os.path
import threading
Expand Down
1 change: 1 addition & 0 deletions foqus_lib/framework/sintervectorize/SinterFileVectorize.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
to include vector variables.

"""

import ast
import copy
import json
Expand Down
3 changes: 2 additions & 1 deletion foqus_lib/framework/surrogate/ACOSSO.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# respectively. This file is also available online at the URL
# "https://github.com/CCSI-Toolset/FOQUS".
#################################################################################
""" #FOQUS_SURROGATE_PLUGIN
"""#FOQUS_SURROGATE_PLUGIN

Surrogate plugins need to have the string "#FOQUS_SURROGATE_PLUGIN" near the
beginning of the file (see pluginSearch.plugins() for exact character count of
Expand All @@ -25,6 +25,7 @@

John Eslick, Carnegie Mellon University, 2014
"""

import json
import logging
import os
Expand Down
3 changes: 1 addition & 2 deletions foqus_lib/framework/surrogate/ALAMO.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# respectively. This file is also available online at the URL
# "https://github.com/CCSI-Toolset/FOQUS".
#################################################################################
""" #FOQUS_SURROGATE_PLUGIN
"""#FOQUS_SURROGATE_PLUGIN

Surrogate plugins need to have the string "#FOQUS_SURROGATE_PLUGIN" near the
beginning of the file (see pluginSearch.plugins() for exact character count of
Expand All @@ -30,7 +30,6 @@

"""


import copy
import logging
import math
Expand Down
2 changes: 1 addition & 1 deletion foqus_lib/framework/surrogate/BSS-ANOVA.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# respectively. This file is also available online at the URL
# "https://github.com/CCSI-Toolset/FOQUS".
#################################################################################
""" #FOQUS_SURROGATE_PLUGIN
"""#FOQUS_SURROGATE_PLUGIN

Surrogate plugins need to have the string "#FOQUS_SURROGATE_PLUGIN" near the
beginning of the file (see pluginSearch.plugins() for exact character count of
Expand Down
Loading
Loading