Skip to content

Commit

Permalink
Merge pull request #91 from dengzq1234/main
Browse files Browse the repository at this point in the history
allow comparing in datatype None
  • Loading branch information
dengzq1234 authored Aug 29, 2024
2 parents 3f35366 + 46de27b commit 18d8e35
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion treeprofiler/layouts/staple_layouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def set_node_style(self, node):
tooltip += f'<b>{node.name}</b><br>'
if self.heatmap_prop:
tooltip += f'<br>{self.heatmap_prop}: {heatmap_num}<br>'

gradient_color = self.value_color.get(heatmap_num)

if gradient_color:
Expand Down
3 changes: 1 addition & 2 deletions treeprofiler/src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def counter_call(node, internal_prop, leaf_prop, datatype, operator_string, righ

def call(node, prop, datatype, operator_string, right_value):
num_operators = [ '<', '<=', '>', '>=' ]
if datatype == str:
if datatype == str or datatype is None:
if operator_string in num_operators:
return False
elif operator_string == 'contains':
Expand All @@ -107,7 +107,6 @@ def call(node, prop, datatype, operator_string, right_value):
return left_value in right_value
else:
left_value = node.props.get(prop)

if left_value:
return operator_dict[operator_string](left_value, right_value)

Expand Down

0 comments on commit 18d8e35

Please sign in to comment.