Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only list computable plot columns if there are other numeric columns #1634

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## 1.29.10

### Improvements

- Only list computable plot columns if there are other numeric columns ([#1634](../../pull/1634))

## 1.29.9

### Bug Fixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1128,13 +1128,14 @@ def computeSelectorAxis(record, data, row):
return computeSelectorAxis

if not self._datacolumns:
for key in self.computeColumns:
title = self.commonColumns[key]
self._ensureColumn(
columns, key, title, 'compute', computeGetData,
computeSelector(key), computeLength)
columns[key]['count'] = 1
columns[key]['min'] = columns[key]['max'] = 0
if len([col for col in columns.values() if col['type'] == 'number']) >= 2:
for key in self.computeColumns:
title = self.commonColumns[key]
self._ensureColumn(
columns, key, title, 'compute', computeGetData,
computeSelector(key), computeLength)
columns[key]['count'] = 1
columns[key]['min'] = columns[key]['max'] = 0
return 0
if self._compute is None or not len(self._requiredColumns & self.computeColumns):
return 0
Expand Down
4 changes: 2 additions & 2 deletions girder_annotation/test_annotation/test_annotations_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ def testPlottableEndpoints(self, server, admin):
},
)
assert utilities.respStatus(resp) == 200
assert len(resp.json) == 5
assert len(resp.json) == 2

resp = server.request(
path=f'/annotation/item/{itemSrc["_id"]}/plot/list',
Expand All @@ -877,7 +877,7 @@ def testPlottableEndpoints(self, server, admin):
},
)
assert utilities.respStatus(resp) == 200
assert len(resp.json) >= 8
assert len(resp.json) >= 5

resp = server.request(
path=f'/annotation/item/{itemSrc["_id"]}/plot/data',
Expand Down