Skip to content

Commit

Permalink
use empty string instead of None
Browse files Browse the repository at this point in the history
  • Loading branch information
ewu63 committed Apr 23, 2024
1 parent 44a9ed2 commit 864c561
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
4 changes: 1 addition & 3 deletions pyoptsparse/pyALPSO/pyALPSO.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,7 @@ def objconfunc(x):
self.optProb.comm.bcast(-1, root=0)

# Store Results
sol_inform = {}
sol_inform["value"] = None
sol_inform["text"] = None
sol_inform = {"value": "", "text": ""}

# Create the optimization solution
sol = self._createSolution(optTime, sol_inform, opt_f, opt_x)
Expand Down
4 changes: 1 addition & 3 deletions pyoptsparse/pyCONMIN/pyCONMIN.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,7 @@ def cnmngrad(n1, n2, x, f, g, ct, df, a, ic, nac):
self.optProb.comm.bcast(-1, root=0)

# Store Results
sol_inform = {}
sol_inform["value"] = None
sol_inform["text"] = None
sol_inform = {"value": "", "text": ""}

# Create the optimization solution
sol = self._createSolution(optTime, sol_inform, ff, xs)
Expand Down
4 changes: 1 addition & 3 deletions pyoptsparse/pyNSGA2/pyNSGA2.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,7 @@ def objconfunc(nreal, nobj, ncon, x, f, g):
self.optProb.comm.bcast(-1, root=0)

# Store Results
sol_inform = {}
sol_inform["value"] = None
sol_inform["text"] = None
sol_inform = {"value": "", "text": ""}

xstar = [0.0] * n
for i in range(n):
Expand Down
4 changes: 1 addition & 3 deletions pyoptsparse/pyParOpt/ParOpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,7 @@ def evalObjConGradient(self, x, g, A):
# Create the optimization solution. Note that the signs on the multipliers
# are switch since ParOpt uses a formulation with c(x) >= 0, while pyOpt
# uses g(x) = -c(x) <= 0. Therefore the multipliers are reversed.
sol_inform = {}
sol_inform["value"] = None
sol_inform["text"] = None
sol_inform = {"value": "", "text": ""}

# If number of constraints is zero, ParOpt returns z as None.
# Thus if there is no constraints, should pass an empty list
Expand Down

0 comments on commit 864c561

Please sign in to comment.