Skip to content
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: 0 additions & 6 deletions tensorboard/backend/application_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ def testPluginsListing(self):
'remove_dom': False,
'tab_name': 'foo',
'disable_reload': False,
'use_data_selector': False,
},
'bar': {
'enabled': False,
Expand All @@ -193,7 +192,6 @@ def testPluginsListing(self):
'tab_name': 'bar',
'remove_dom': False,
'disable_reload': False,
'use_data_selector': False,
},
'baz': {
'enabled': True,
Expand All @@ -204,7 +202,6 @@ def testPluginsListing(self):
'tab_name': 'baz',
'remove_dom': False,
'disable_reload': False,
'use_data_selector': False,
},
}
)
Expand Down Expand Up @@ -269,7 +266,6 @@ def testPluginsListing(self):
'remove_dom': False,
'tab_name': 'foo',
'disable_reload': False,
'use_data_selector': False,
},
'bar': {
'enabled': False,
Expand All @@ -280,7 +276,6 @@ def testPluginsListing(self):
'tab_name': 'bar',
'remove_dom': False,
'disable_reload': False,
'use_data_selector': False,
},
'baz': {
'enabled': True,
Expand All @@ -291,7 +286,6 @@ def testPluginsListing(self):
'tab_name': 'baz',
'remove_dom': False,
'disable_reload': False,
'use_data_selector': False,
},
}
)
Expand Down
1 change: 0 additions & 1 deletion tensorboard/components/tf_categorization_utils/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ tf_web_library(
deps = [
"//tensorboard/components/tf_backend",
"//tensorboard/components/tf_dashboard_common",
"//tensorboard/components/tf_data_selector:type",
"//tensorboard/components/tf_imports:lodash",
"//tensorboard/components/tf_imports:polymer",
"//tensorboard/components/tf_storage",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,87 +138,6 @@ export function categorizeTags(
}));
}

/**
* Creates grouping of the data based on selection from tf-data-selector. It
* groups data by prefixes of tag names and by tag names. Each group contains
* series, a tuple of experiment name and run name.
*/
export function categorizeSelection(
selection: tf_data_selector.Selection[], pluginName: string):
SeriesCategory[] {
const tagToSeries = new Map<string, Series[]>();
// `tagToSearchSeries` contains subset of `tagToSeries`. tagRegex in each
// selection can omit series from a tag category.
const tagToSearchSeries = new Map<string, Series[]>();
const searchCategories = [];

selection.forEach(({experiment, runs, tagRegex}) => {
const runNames = runs.map(({name}) => name);
const selectedRunToTag = createRunToTagForPlugin(runs, pluginName);
const tagToSelectedRuns = createTagToRuns(selectedRunToTag);
const tags = tf_backend.getTags(selectedRunToTag);
// list of all tags that has selected runs.
tags.forEach(tag => {
const series = tagToSeries.get(tag) || [];
series.push(...tagToSelectedRuns.get(tag)
.map(run => ({experiment, run, tag})));
tagToSeries.set(tag, series);
});

const searchCategory = categorizeBySearchQuery(tags, tagRegex);
searchCategories.push(searchCategory);
// list of tags matching tagRegex in the selection.
searchCategory.items.forEach(tag => {
const series = tagToSearchSeries.get(tag) || [];
series.push(...tagToSelectedRuns.get(tag)
.map(run => ({experiment, run, tag})));
tagToSearchSeries.set(tag, series);
});
});

const searchCategory: RawCategory = searchCategories.length == 1 ?
searchCategories[0] :
{
name: searchCategories.every(c => !c.name) ? '' : 'multi',
metadata: {
type: CategoryType.SEARCH_RESULTS,
compositeSearch: true,
validRegex: searchCategories.every(c => c.metadata.validRegex),
universalRegex: false,
},
items: Array.from(tagToSearchSeries.keys())
.sort(vz_sorting.compareTagNames),
};

const searchSeriesCategory: SeriesCategory = Object.assign(
{},
searchCategory,
{
items: searchCategory.items.map(tag => ({
tag,
series: tagToSearchSeries.get(tag),
})),
},
);

// Organize the tag to items by prefix.
const prefixCategories: SeriesCategory[] = categorizeByPrefix(
Array.from(tagToSeries.keys()))
.map(({name, metadata, items}) => ({
name,
metadata,
items: items.map(tag => ({
tag,
series: tagToSeries.get(tag),
})),
}));

return [
searchSeriesCategory,
...prefixCategories,
];
}

function createTagToRuns(runToTag: RunToTag): Map<string, string[]> {
const tagToRun = new Map();
Object.keys(runToTag).forEach(run => {
Expand Down
Loading