Skip to content

Commit

Permalink
Skip processing non-parameterized classes in setup_param
Browse files Browse the repository at this point in the history
Easy 5-10% speedup in creating Parameterized objects
  • Loading branch information
philippjfr committed Apr 7, 2016
1 parent 1f94abc commit 8d5bf11
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions param/parameterized.py
Expand Up @@ -1392,6 +1392,8 @@ def _setup_params(self,**params):
# a later-overridden parent class's parameter)
params_to_instantiate = {}
for class_ in classlist(type(self)):
if not issubclass(class_, Parameterized):
continue
for (k,v) in class_.__dict__.items():
# (avoid replacing name with the default of None)
if isinstance(v,Parameter) and v.instantiate and k!="name":
Expand Down

0 comments on commit 8d5bf11

Please sign in to comment.