Skip to content

Commit

Permalink
Add back in logic for if there is no name attr
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmundt committed Apr 9, 2024
1 parent 9bf6531 commit 7268a95
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pyomo/contrib/solver/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
from typing import Sequence, Dict, Optional, Mapping, NoReturn, List, Tuple
import os

from pyomo.core.base.constraint import Constraint, _GeneralConstraintData
from pyomo.core.base.var import Var, _GeneralVarData
from pyomo.core.base.constraint import _GeneralConstraintData
from pyomo.core.base.var import _GeneralVarData
from pyomo.core.base.param import _ParamData
from pyomo.core.base.block import _BlockData
from pyomo.core.base.objective import Objective, _GeneralObjectiveData
Expand Down Expand Up @@ -62,6 +62,8 @@ def __init__(self, **kwds) -> None:
# if they really desire. Otherwise it defaults to the class name (all lowercase)
if "name" in kwds:
self.name = kwds.pop('name')
elif not hasattr(self, 'name'):
self.name = type(self).__name__.lower()
self.config = self.CONFIG(value=kwds)

#
Expand Down

0 comments on commit 7268a95

Please sign in to comment.