Open dengzq1234 opened 1 year ago
I noticed the following lines which contains data type error in regards to properties fetching in https://github.com/etetoolkit/ete/blob/LayoutBarplot/ete4/smartview/renderer/layouts/staple_layouts.py
1) line 57
prop = node.props.get(p) if type(prop) in [int, float]: vals[metric][1] = min(minval, prop) vals[metric][2] = max(maxval, prop) elif prop is None or prop == "": return else: uniqvals.add(prop)
prop will be string at the first place when fetch from the node, so I would suggest:
prop
string
prop = node.props.get(p) try: prop = float(prop) # prop by default is string if type(prop) in [int, float]: vals[metric][1] = min(minval, prop) vals[metric][2] = max(maxval, prop) elif prop is None or prop == "": return else: uniqvals.add(prop) except: pass
2) line 109 the same issue,
return node.props.get(self.size_prop, 0) / maxval * self.width
should be:
return float(node.props.get(self.size_prop, 0)) / maxval * self.width
I noticed the following lines which contains data type error in regards to properties fetching in https://github.com/etetoolkit/ete/blob/LayoutBarplot/ete4/smartview/renderer/layouts/staple_layouts.py
1) line 57
prop
will bestring
at the first place when fetch from the node, so I would suggest:2) line 109 the same issue,
should be: