Skip to content

Commit

Permalink
Add helpful comment. Refactor a bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
bmd3k committed Aug 24, 2023
1 parent 7cedb8f commit 6991ec7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
21 changes: 10 additions & 11 deletions tensorboard/plugins/hparams/get_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,27 @@ def __init__(
self._request_context = request_context
self._backend_context = backend_context
self._experiment_id = experiment_id
self._request = request
self._include_metrics = (
# Metrics are included by default if include_metrics is not
# specified in the request.
not request.HasField("include_metrics")
or request.include_metrics
)

def run(self):
"""Handles the request specified on construction.
Returns:
An Experiment object.
"""
experiment_id = self._experiment_id
include_metrics = (
not self._request.HasField("include_metrics")
or self._request.include_metrics
)

return self._backend_context.experiment_from_metadata(
self._request_context,
experiment_id,
include_metrics,
self._experiment_id,
self._include_metrics,
self._backend_context.hparams_metadata(
self._request_context, experiment_id
self._request_context, self._experiment_id
),
self._backend_context.hparams_from_data_provider(
self._request_context, experiment_id
self._request_context, self._experiment_id
),
)
2 changes: 2 additions & 0 deletions tensorboard/plugins/hparams/list_session_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def __init__(
self._experiment_id = experiment_id
self._request = request
self._include_metrics = (
# Metrics are included by default if include_metrics is not
# specified in the request.
not self._request.HasField("include_metrics")
or self._request.include_metrics
)
Expand Down

0 comments on commit 6991ec7

Please sign in to comment.