Skip to content

Commit

Permalink
Allow componnet lineage with no binning
Browse files Browse the repository at this point in the history
  • Loading branch information
dachengx committed Jul 31, 2024
1 parent 099e9c6 commit ec696e5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions appletree/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,15 +570,20 @@ def new_component(self, llh_name: Optional[str] = None, pass_binning: bool = Tru

@property
def lineage(self):
return {
**{
"rate_name": self.rate_name,
"norm_type": self.norm_type,
bins_dict = dict()
if getattr(self, "bins", None) or getattr(self, "bins_type", None):
bins_dict = {
"bins": (
tuple(b.tolist() for b in self.bins) if self.bins is not None else self.bins
),
"bins_type": self.bins_type,
}
return {
**{
"rate_name": self.rate_name,
"norm_type": self.norm_type,
"code": self.code,
**bins_dict,
},
**{
"instances": dict(
Expand Down

0 comments on commit ec696e5

Please sign in to comment.