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

Add ungrouped function from deprecated class to model class #448

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
9 changes: 9 additions & 0 deletions nucleus/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from .async_job import AsyncJob
from .constants import (
ANNOTATIONS_KEY
METADATA_KEY,
MODEL_TAGS_KEY,
MODEL_TRAINED_SLICE_IDS_KEY,
Expand All @@ -18,6 +19,7 @@
PolygonPrediction,
SegmentationPrediction,
)
from nucleus.utils import format_prediction_response


class Model:
Expand Down Expand Up @@ -343,3 +345,10 @@ def remove_trained_slice_ids(self, slide_ids: List[str]):
)

return response.json()
def ungrouped_export(self, model_run_id):
json_response = self._client.make_request(
payload={},
route=f"modelRun/{model_run_id}/ungrouped",
requests_command=requests.get,
)
return format_prediction_response({ANNOTATIONS_KEY: json_response})
Comment on lines +348 to +354
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets name this something a bit better. I'm not sure why the endpoint was originally named ungrouped, but this method could be called export_by_model_run_id or something like that