Skip to content

Commit

Permalink
fixed bug in transform_featurepoints where feature IDs are converted …
Browse files Browse the repository at this point in the history
…to floats and causes statistic calculation to fail
  • Loading branch information
kukulies committed Nov 7, 2023
1 parent 80ef32c commit 09adaf2
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 50 deletions.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tobac/utils/bulk_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ def get_statistics(
Dictionary with function(s) to apply over each region as values and the name of the respective statistics as keys
default is to just count the number of cells associated with each feature and write it to the feature dataframe
index: None | list[int], optional (default: None)
list of indexes of regions in labels to apply function to. If None, will
default to all integers between the minimum and the maximum value in labels
list of indices of regions in labels to apply function to. If None, will
default to all integer feature labels in labels
default: None | float, optional (default: None)
default value to return in a region that has no values
id_column: str, optional (default: "feature")
Expand Down
3 changes: 3 additions & 0 deletions tobac/utils/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,9 @@ def transform_feature_points(
"Dropping feature numbers: " + str(removed_features.values), UserWarning
)

# make sure that feature points are converted back to int64
ret_features['feature'] = ret_features.feature.astype(int)

return ret_features


Expand Down

0 comments on commit 09adaf2

Please sign in to comment.