You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, EasyList drops those kwargs, as EasyList overrides get_all_variables to only recurse into ModelBase items, not simple sequences and bare descriptors are dropped.
This might be as simple as adding this snippet to EasyList.get_all_variables()
for item in self._data:
if isinstance(item, DescriptorBase):
all_vars.append(item)
elif isinstance(item, ModelBase):
all_vars.extend(item.get_all_variables())
Yes, I believe that is all we need to add, except it should be DescriptorNumber, not DescriptorBase ;)
This might be as simple as adding this snippet to EasyList.get_all_variables()
for item in self._data:
if isinstance(item, DescriptorBase):
all_vars.append(item)
elif isinstance(item, ModelBase):
all_vars.extend(item.get_all_variables())
Yes, I believe that is all we need to add, except it should be DescriptorNumber, not DescriptorBase ;)
Nope.
DescriptorBase matches ModelBase. ModelBase already tests isinstance(attr, DescriptorBase). EasyList overrides it and declares the same return type, so it should respond in the same way a ModelBase would. This EasyList override should NOT be stricter than the method it overrides.
Also, the fitting filter is applied anyway get_all_parameters() keeps only Parameter instances, and get_fittable_parameters and get_free_parameters go even deeper. So using DescriptorBase costs nothing here and would be more consistent.
get_fit_parameters will still return only Parameters.
Huh, you're right.
On another note though, do we even use DescriptorStrings and DescriptorBools anywhere at the moment? I don't really know where I would use them myself . . .
But yes, DescriptorBase it is :)
Activity
rozyczko commentedon Sep 15, 2026
This might be as simple as adding this snippet to
EasyList.get_all_variables()damskii9992 commentedon Sep 16, 2026
Yes, I believe that is all we need to add, except it should be DescriptorNumber, not DescriptorBase ;)
rozyczko commentedon Sep 16, 2026
Nope.
DescriptorBase matches ModelBase. ModelBase already tests
isinstance(attr, DescriptorBase). EasyList overrides it and declares the same return type, so it should respond in the same way a ModelBase would. This EasyList override should NOT be stricter than the method it overrides.Also, the fitting filter is applied anyway get_all_parameters() keeps only Parameter instances, and get_fittable_parameters and get_free_parameters go even deeper. So using DescriptorBase costs nothing here and would be more consistent.
get_fit_parameters will still return only Parameters.
damskii9992 commentedon Sep 21, 2026
Huh, you're right.
On another note though, do we even use
DescriptorStringsandDescriptorBoolsanywhere at the moment? I don't really know where I would use them myself . . .But yes,
DescriptorBaseit is :)Addressed #307: Fix EasyList to accept a list of parameters
rozyczko commentedon Sep 22, 2026
Fixed in 922b2a3