diff --git a/autofit/mapper/model.py b/autofit/mapper/model.py index 480feb4a8..ffa12f513 100644 --- a/autofit/mapper/model.py +++ b/autofit/mapper/model.py @@ -423,8 +423,24 @@ def __len__(self): return len(self.values()) def as_model( - self, model_classes=tuple(), excluded_classes=tuple(), + self, + model_classes: Union[type, Iterable[type]] = tuple(), + excluded_classes: Union[type, Iterable[type]] = tuple(), ): + """ + Convert this instance to a model + + Parameters + ---------- + model_classes + The classes to convert to models + excluded_classes + The classes to exclude from conversion + + Returns + ------- + A model + """ from autofit.mapper.prior_model.abstract import AbstractPriorModel diff --git a/autofit/mapper/prior_model/abstract.py b/autofit/mapper/prior_model/abstract.py index 0f0aa44cf..9f337972b 100644 --- a/autofit/mapper/prior_model/abstract.py +++ b/autofit/mapper/prior_model/abstract.py @@ -1007,7 +1007,9 @@ def random_instance(self, ignore_prior_limits=False): @staticmethod @DynamicRecursionCache() def from_instance( - instance, model_classes=tuple(), exclude_classes=tuple(), + instance, + model_classes: Union[type, Iterable[type]] = tuple(), + exclude_classes: Union[type, Iterable[type]] = tuple(), ): """ Recursively create a prior object model from an object model. @@ -1015,6 +1017,9 @@ def from_instance( Parameters ---------- model_classes + A tuple of classes that should be converted to a prior model + exclude_classes + A tuple of classes that should not be converted to a prior model instance A dictionary, list, class instance or model instance Returns