Skip to content

Commit

Permalink
Add relevant comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmundt committed Apr 9, 2024
1 parent 7268a95 commit 9b4fd6f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyomo/contrib/solver/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ class SolverBase(abc.ABC):

def __init__(self, **kwds) -> None:
# We allow the user and/or developer to name the solver something else,
# if they really desire. Otherwise it defaults to the class name (all lowercase)
# if they really desire.
# Otherwise it defaults to the name defined when the solver was registered
# in the SolverFactory or the class name (all lowercase), whichever is
# applicable
if "name" in kwds:
self.name = kwds.pop('name')
elif not hasattr(self, 'name'):
Expand Down
1 change: 1 addition & 0 deletions pyomo/contrib/solver/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class LegacySolver(LegacySolverWrapper, cls):
LegacySolver
)

# Preserve the preferred name, as registered in the Factory
cls.name = name
return cls

Expand Down

0 comments on commit 9b4fd6f

Please sign in to comment.