Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rhayes777 committed Mar 6, 2023
1 parent 2f0d3da commit 8bbf30d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
18 changes: 17 additions & 1 deletion autofit/mapper/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 6 additions & 1 deletion autofit/mapper/prior_model/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,14 +1007,19 @@ 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.
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
Expand Down

0 comments on commit 8bbf30d

Please sign in to comment.