Skip to content

Commit

Permalink
fix bug in previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Stölzner committed Oct 30, 2023
1 parent 570eded commit f5912c7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/qp/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,14 @@ def _build_data_dict(md_table, data_table):
data_dict[col] = col_data
return data_dict

def _make_scipy_wrapped_class(self, class_name, scipy_class):
def _make_scipy_wrapped_class(self, class_name, scipy_class, ctor_param):
"""Build a qp class from a scipy class"""
# pylint: disable=protected-access
override_dict = dict(name=class_name,
version=0,
freeze=Pdf_gen_wrap._my_freeze,
_other_init=scipy_class.__init__)
_other_init=scipy_class.__init__,
_ctor_param=ctor_param)
the_class = type(class_name, (Pdf_gen_wrap, scipy_class), override_dict)
self.add_class(the_class)

Expand All @@ -72,7 +73,7 @@ def _load_scipy_classes(self):
for name in names:
attr = getattr(sps, name)
if isinstance(attr, sps.rv_continuous):
self._make_scipy_wrapped_class(name, type(attr))
self._make_scipy_wrapped_class(name, type(attr), attr._updated_ctor_param())

def add_class(self, the_class):
"""Add a class to the factory
Expand Down

0 comments on commit f5912c7

Please sign in to comment.