Skip to content

Commit

Permalink
improve composite_branches property with decorator and doc string
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdicaprio committed Mar 28, 2024
1 parent 2b87e6e commit 88caeed
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion nzshm_model/logic_tree/logic_tree_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,15 @@ def composite_branches_fn(self, filtered=True) -> Generator[CompositeBranch, Non
composite_branch.weight = reduce(mul, weights, 1.0)
yield composite_branch

composite_branches = property(composite_branches_fn)
@property
def composite_branches(self) -> Generator[CompositeBranch, None, None]:
"""
Yields all composite (combined) branches of the branch_sets enforcing correlations.
Returns:
composite_branches: the CompositeBranches of the combined logic tree BranchSets
"""
return self.composite_branches_fn()

@classmethod
def from_json(cls, json_path: Union[Path, str]) -> 'LogicTree':
Expand Down

0 comments on commit 88caeed

Please sign in to comment.