-
Notifications
You must be signed in to change notification settings - Fork 1.7k
data: plumb experiment ID through runs and scalars #2580
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,11 +93,11 @@ def frontend_metadata(self): | |
| element_name='tf-scalar-dashboard', | ||
| ) | ||
|
|
||
| def index_impl(self): | ||
| def index_impl(self, experiment=None): | ||
| """Return {runName: {tagName: {displayName: ..., description: ...}}}.""" | ||
| if self._data_provider: | ||
| mapping = self._data_provider.list_scalars( | ||
| experiment_id=None, # experiment support not yet implemented | ||
| experiment_id=experiment, | ||
| plugin_name=metadata.PLUGIN_NAME, | ||
| ) | ||
| result = {run: {} for run in mapping} | ||
|
|
@@ -155,7 +155,7 @@ def scalars_impl(self, tag, run, experiment, output_format): | |
| # logic. | ||
| SAMPLE_COUNT = 1000 | ||
| all_scalars = self._data_provider.read_scalars( | ||
| experiment_id=None, # experiment support not yet implemented | ||
| experiment_id=experiment, | ||
| plugin_name=metadata.PLUGIN_NAME, | ||
| downsample=SAMPLE_COUNT, | ||
| run_tag_filter=provider.RunTagFilter(runs=[run], tags=[tag]), | ||
|
|
@@ -224,7 +224,8 @@ def _get_value(self, scalar_data_blob, dtype_enum): | |
|
|
||
| @wrappers.Request.application | ||
| def tags_route(self, request): | ||
| index = self.index_impl() | ||
| experiment = request.args.get('experiment', '') | ||
| index = self.index_impl(experiment=experiment) | ||
| return http_util.Respond(request, index, 'application/json') | ||
|
|
||
| @wrappers.Request.application | ||
|
|
@@ -233,7 +234,7 @@ def scalars_route(self, request): | |
| # TODO: return HTTP status code for malformed requests | ||
| tag = request.args.get('tag') | ||
| run = request.args.get('run') | ||
| experiment = request.args.get('experiment') | ||
| experiment = request.args.get('experiment', '') | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any particular reason to have this default to empty instead of None?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The experiment ID is required for any calls to the data provider API |
||
| output_format = request.args.get('format') | ||
| (body, mime_type) = self.scalars_impl(tag, run, experiment, output_format) | ||
| return http_util.Respond(request, body, mime_type) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This machinery is unrelated; I’ll remove it in a future change.
I didn’t want to reuse it because it assumes some things about both
inputs (e.g.,
type ExperimentId = number) and outputs (the output ofthe
/experiment_runsroute is not just a list of string names) thatmay not be what we want.