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

HParams: Create filter dialog component #6493

Merged
merged 8 commits into from
Aug 15, 2023

Conversation

rileyajones
Copy link
Contributor

@rileyajones rileyajones commented Jul 13, 2023

Motivation for features / changes

We want to be able to filter the runs table by hparam. The existing logic for this is handled by a bunch of inner components found in the runs_table_component which makes it hard to share. In this PR I am replicating that UI with some enhancements in a standalone component which will later be used by the data_table_component.

See #6488 for screenshots and a more complete description of what is being added

Alternate designs / implementations considered (or N/A)

I'm not sure that this component should be part of the data table but that is simplest place to put it for now.

@rileyajones rileyajones marked this pull request as ready for review July 13, 2023 22:57
@rileyajones rileyajones requested a review from bmd3k July 13, 2023 22:57
tensorboard/webapp/widgets/data_table/BUILD Outdated Show resolved Hide resolved
tensorboard/webapp/hparams/BUILD Show resolved Hide resolved
tensorboard/webapp/widgets/data_table/types.ts Outdated Show resolved Hide resolved
).find((elem) =>
elem.nativeElement.innerHTML.includes('Include Undefined')
)!;
includeUndefinedCheckbox.query(By.css('label')).nativeElement.click();
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way to use Component Harnesses in the tests? Its current best practice but will also possibly make it easier to switch to the new components introduced in Angular 15.

Copy link
Contributor

Choose a reason for hiding this comment

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

Did you give Component Harnesses a try?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did manage to get this working with harnesses

@rileyajones rileyajones requested a review from bmd3k July 19, 2023 22:43
tensorboard/webapp/hparams/BUILD Show resolved Hide resolved
tensorboard/webapp/hparams/_types.ts Show resolved Hide resolved
tensorboard/webapp/widgets/data_table/BUILD Outdated Show resolved Hide resolved
tensorboard/webapp/widgets/data_table/types.ts Outdated Show resolved Hide resolved
tensorboard/webapp/widgets/data_table/types.ts Outdated Show resolved Hide resolved
tensorboard/webapp/widgets/data_table/types.ts Outdated Show resolved Hide resolved
).find((elem) =>
elem.nativeElement.innerHTML.includes('Include Undefined')
)!;
includeUndefinedCheckbox.query(By.css('label')).nativeElement.click();
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you give Component Harnesses a try?

@rileyajones rileyajones changed the title HParams: Create filter dialogue component HParams: Create filter dialog component Aug 11, 2023
Copy link
Contributor

@bmd3k bmd3k left a comment

Choose a reason for hiding this comment

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

Thanks its looking pretty good. All that remains are some requests for increased test coverage and clarity.

fixture.componentInstance.discreteValueFilter = 'ba';
fixture.detectChanges();
expect(
(await rootLoader.getAllHarnesses(MatCheckboxHarness)).length
Copy link
Contributor

Choose a reason for hiding this comment

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

I would be more confident in the test if you actually checked that it's the 'bar' and 'baz' boxes shown.

Copy link
Contributor

Choose a reason for hiding this comment

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

This would still make me more confident. (You resolved this but I didn't see corresponding changes).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure how this has happened but this comment is on an outdated version of the file.

Clicking your comment allows me to see the code you are commenting on:
image

However, clicking the "Files Changed" tab I see a much different file (where I did address your comment).
image

image

@rileyajones rileyajones requested a review from bmd3k August 15, 2023 17:06
Copy link
Contributor

@bmd3k bmd3k left a comment

Choose a reason for hiding this comment

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

A few more comments to be addressed, please.

);
await checkbox.uncheck();

expect(filterValues).toEqual([2, 2, 4]);
Copy link
Contributor

Choose a reason for hiding this comment

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

I would be more confident in the test if you confirmed the output of the EventEmitter after every click. You say "Unchecking an unchecked box should not trigger an event" but the test does not prove this - it actually allows for the possibility of "Checking an unchecked box does not trigger an event" (which is a bug).

Alternatively, another way to make me more confident in the test is to just get rid of L166,167 and then we have only three uncheck/check calls and its a bit easier to conclude that the filterValues on L175 correspond to those three clicks. In which case, if you think the test on L167 is important to test, consider moving it to its own test case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is my second draft of this. In the original I did check after each event but I thought the amount of setup required for each action made it hard to read. I'm going to put this in a loop instead but I plan to maintain the practice of checking the values in an array as I do find it more readable.

@@ -72,8 +71,8 @@ def tf_js_binary(
# the global level and tends to overwrite `window` functions. "iife" is
# just a thin wrapper around "esm" (it adds 11 bytes) and doesn't
# suffer from the same overwriting problem.
format="iife",
minify= False if dev_mode_only else True,
format = "iife",
Copy link
Contributor

Choose a reason for hiding this comment

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

You have unrelated changes here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The observer effect (aka ide autoformat) is alive and strong. Sorry I missed this.

fixture.componentInstance.discreteValueFilter = 'ba';
fixture.detectChanges();
expect(
(await rootLoader.getAllHarnesses(MatCheckboxHarness)).length
Copy link
Contributor

Choose a reason for hiding this comment

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

This would still make me more confident. (You resolved this but I didn't see corresponding changes).

@rileyajones rileyajones merged commit 4bbe464 into tensorflow:master Aug 15, 2023
rileyajones added a commit that referenced this pull request Aug 17, 2023
## Motivation for features / changes
#6493 Broke our internal sync Googlers see
[cl/557499468](http://cl/557499468)

The issue is related to our internal Angular component migration. New
components are not allowed to rely on the legacy components. Due to this
the new component added in #6493 uses the non legacy checkbox. However,
our dependency remapping always remaps dependencies on material_checkbox
to legacy_material_checkbox.

To fix this I am changing the name of the remapping rule in
[cl/557515881](http://cl/557515881) and adjusting all the OSS usage
EXCEPT for the usage in filter_dialog.

[cl/557590954](http://cl/557590954) is also required to map the testing
dependency needed to use `MatCheckboxHarness`
rileyajones added a commit that referenced this pull request Aug 22, 2023
…6553)

## Motivation for features / changes
Now that the filter dialog is merged #6493 we need to add support for
filtering by hparams. However, #6544 changed the way hparam values are
read. This change adds a new property to state in which to store
dashboard related hparam and metric filters.

See #6488 for the WIP integration with the runs_table_container +
tb_data_table -> common_selectors + hparam_selectors.
yatbear pushed a commit to yatbear/tensorboard that referenced this pull request Aug 25, 2023
## Motivation for features / changes
We want to be able to filter the runs table by hparam. The existing
logic for this is handled by a bunch of inner components found in the
runs_table_component which makes it hard to share. In this PR I am
replicating that UI with some enhancements in a standalone component
which will later be used by the data_table_component.

See tensorflow#6488 for screenshots and a more complete description of what is
being added

## Alternate designs / implementations considered (or N/A)
I'm not sure that this component should be part of the data table but
that is simplest place to put it for now.
yatbear pushed a commit to yatbear/tensorboard that referenced this pull request Aug 25, 2023
…low#6547)

## Motivation for features / changes
tensorflow#6493 Broke our internal sync Googlers see
[cl/557499468](http://cl/557499468)

The issue is related to our internal Angular component migration. New
components are not allowed to rely on the legacy components. Due to this
the new component added in tensorflow#6493 uses the non legacy checkbox. However,
our dependency remapping always remaps dependencies on material_checkbox
to legacy_material_checkbox.

To fix this I am changing the name of the remapping rule in
[cl/557515881](http://cl/557515881) and adjusting all the OSS usage
EXCEPT for the usage in filter_dialog.

[cl/557590954](http://cl/557590954) is also required to map the testing
dependency needed to use `MatCheckboxHarness`
yatbear pushed a commit to yatbear/tensorboard that referenced this pull request Aug 25, 2023
…ensorflow#6553)

## Motivation for features / changes
Now that the filter dialog is merged tensorflow#6493 we need to add support for
filtering by hparams. However, tensorflow#6544 changed the way hparam values are
read. This change adds a new property to state in which to store
dashboard related hparam and metric filters.

See tensorflow#6488 for the WIP integration with the runs_table_container +
tb_data_table -> common_selectors + hparam_selectors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants