-
Notifications
You must be signed in to change notification settings - Fork 1.7k
HParam UI: update ColumnHeader type #6346
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
HParam UI: update ColumnHeader type #6346
Conversation
e4a04df to
78ad536
Compare
78ad536 to
5492ab4
Compare
rileyajones
left a comment
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.
I am aware that this PR does not contain any real functional changes and that it is just adding some metadata in a bunch of places.
I have gone through and checked each of the enabled statuses in the tests and could not find any inconsistencies.
| ChangeDetectionStrategy, | ||
| Component, | ||
| Input, | ||
| OnDestroy, |
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.
Was this unused before?
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.
Sorry that should not have been in this PR. But, that is correct it was an unused import.
## Motivation for features / changes In #6346 we added a displayName attribute to the ColumnHeader. This PR uses that name to be displayed in the headers. ## Technical description of changes I removed lots of headers from a test since now we do not need to test that each type has the proper text displayed.
## Motivation for features / changes In tensorflow#6346 we added a displayName attribute to the ColumnHeader. This PR uses that name to be displayed in the headers. ## Technical description of changes I removed lots of headers from a test since now we do not need to test that each type has the proper text displayed.
The goals is to allow for dynamic HParam columns in the data table. This
means that we cannot have an enum like ColumnHeaderType be the unique
identifier for the column headers because we cannot encapsulate all
possible hparams into an enum.
This change adds a name and displayName field to the ColumnHeader
interface. The goal here is to make name be the unique identifier for
columns. However, this PR does not use these fields at all. It simply
adds them. THERE IS NO FUNCTIONAL CHANGE in this PR.
Upcoming changes will switch the code over to start using the name as
the unique identifier and display the displayName.
(For POC to see how this change fits in googlers see cl/526767686)
N/A
POC works
There were many alternatives considered. In fact I do not believe this
is going to be the final structure.
One option is to remove the type and add a category field
export interface ColumnHeader {
name: string;
displayName: string;
Category: ColumnCategory(STATIC, HPARAM, METRIC)
enabled: boolean;
}
However, deciding how to calculate the value based on hardcoded name
strings does not seem ideal.
Another option is to have a hierarchy. I expect it to look like this:
Interface ColumnHeaderBase {
name: string;
displayName: string;
type: ColumnHeaderType;
enabled: boolean;
}
export interface StaticColumnHeader extends ColumnHeaderBase{
category: “STATIC”
}
export interface HParamColumnHeader extends ColumnHeaderBase{
category: “HParam”
source: enum(data, config,....);
differs:boolean;
}
ColumnHeader = StaticColumnHeader | HParamColumnHeader
This may be the final form that we go with however, we are not sure the
source and differs attributes need to go here or somewhere else yet. All
code which works with the type defined in this PR will work with this
proposal as well.
Lastly, there is the option which is the same as the hierarchy option
above but with StaticColumnHeader being the only interface with a "type"
attribute. This is a valid possibility but, I have decided that it just
adds unnecessary complexity by requiring a type check in many more
places.
The goals is to allow for dynamic HParam columns in the data table. This
means that we cannot have an enum like ColumnHeaderType be the unique
identifier for the column headers because we cannot encapsulate all
possible hparams into an enum.
This change adds a name and displayName field to the ColumnHeader
interface. The goal here is to make name be the unique identifier for
columns. However, this PR does not use these fields at all. It simply
adds them. THERE IS NO FUNCTIONAL CHANGE in this PR.
Upcoming changes will switch the code over to start using the name as
the unique identifier and display the displayName.
(For POC to see how this change fits in googlers see cl/526767686)
N/A
POC works
There were many alternatives considered. In fact I do not believe this
is going to be the final structure.
One option is to remove the type and add a category field
export interface ColumnHeader {
name: string;
displayName: string;
Category: ColumnCategory(STATIC, HPARAM, METRIC)
enabled: boolean;
}
However, deciding how to calculate the value based on hardcoded name
strings does not seem ideal.
Another option is to have a hierarchy. I expect it to look like this:
Interface ColumnHeaderBase {
name: string;
displayName: string;
type: ColumnHeaderType;
enabled: boolean;
}
export interface StaticColumnHeader extends ColumnHeaderBase{
category: “STATIC”
}
export interface HParamColumnHeader extends ColumnHeaderBase{
category: “HParam”
source: enum(data, config,....);
differs:boolean;
}
ColumnHeader = StaticColumnHeader | HParamColumnHeader
This may be the final form that we go with however, we are not sure the
source and differs attributes need to go here or somewhere else yet. All
code which works with the type defined in this PR will work with this
proposal as well.
Lastly, there is the option which is the same as the hierarchy option
above but with StaticColumnHeader being the only interface with a "type"
attribute. This is a valid possibility but, I have decided that it just
adds unnecessary complexity by requiring a type check in many more
places.
## Motivation for features / changes In #6346 we updated the ColumnHeader interface. However, objects using this interface are stored in localStorage. This checks localStorage to ensure it has the new interface. If it does not then it ignores those values. ## Technical description of changes I am simply checking if the first value has the name property to ensure the values are valid. I could do a more thorough check but it seems unnecessary. ## Detailed steps to verify changes work correctly (as executed by you) It worked for me when running locally.
The goals is to allow for dynamic HParam columns in the data table. This
means that we cannot have an enum like ColumnHeaderType be the unique
identifier for the column headers because we cannot encapsulate all
possible hparams into an enum.
This change adds a name and displayName field to the ColumnHeader
interface. The goal here is to make name be the unique identifier for
columns. However, this PR does not use these fields at all. It simply
adds them. THERE IS NO FUNCTIONAL CHANGE in this PR.
Upcoming changes will switch the code over to start using the name as
the unique identifier and display the displayName.
(For POC to see how this change fits in googlers see cl/526767686)
N/A
POC works
There were many alternatives considered. In fact I do not believe this
is going to be the final structure.
One option is to remove the type and add a category field
export interface ColumnHeader {
name: string;
displayName: string;
Category: ColumnCategory(STATIC, HPARAM, METRIC)
enabled: boolean;
}
However, deciding how to calculate the value based on hardcoded name
strings does not seem ideal.
Another option is to have a hierarchy. I expect it to look like this:
Interface ColumnHeaderBase {
name: string;
displayName: string;
type: ColumnHeaderType;
enabled: boolean;
}
export interface StaticColumnHeader extends ColumnHeaderBase{
category: “STATIC”
}
export interface HParamColumnHeader extends ColumnHeaderBase{
category: “HParam”
source: enum(data, config,....);
differs:boolean;
}
ColumnHeader = StaticColumnHeader | HParamColumnHeader
This may be the final form that we go with however, we are not sure the
source and differs attributes need to go here or somewhere else yet. All
code which works with the type defined in this PR will work with this
proposal as well.
Lastly, there is the option which is the same as the hierarchy option
above but with StaticColumnHeader being the only interface with a "type"
attribute. This is a valid possibility but, I have decided that it just
adds unnecessary complexity by requiring a type check in many more
places.
The goals is to allow for dynamic HParam columns in the data table. This
means that we cannot have an enum like ColumnHeaderType be the unique
identifier for the column headers because we cannot encapsulate all
possible hparams into an enum.
This change adds a name and displayName field to the ColumnHeader
interface. The goal here is to make name be the unique identifier for
columns. However, this PR does not use these fields at all. It simply
adds them. THERE IS NO FUNCTIONAL CHANGE in this PR.
Upcoming changes will switch the code over to start using the name as
the unique identifier and display the displayName.
(For POC to see how this change fits in googlers see cl/526767686)
N/A
POC works
There were many alternatives considered. In fact I do not believe this
is going to be the final structure.
One option is to remove the type and add a category field
export interface ColumnHeader {
name: string;
displayName: string;
Category: ColumnCategory(STATIC, HPARAM, METRIC)
enabled: boolean;
}
However, deciding how to calculate the value based on hardcoded name
strings does not seem ideal.
Another option is to have a hierarchy. I expect it to look like this:
Interface ColumnHeaderBase {
name: string;
displayName: string;
type: ColumnHeaderType;
enabled: boolean;
}
export interface StaticColumnHeader extends ColumnHeaderBase{
category: “STATIC”
}
export interface HParamColumnHeader extends ColumnHeaderBase{
category: “HParam”
source: enum(data, config,....);
differs:boolean;
}
ColumnHeader = StaticColumnHeader | HParamColumnHeader
This may be the final form that we go with however, we are not sure the
source and differs attributes need to go here or somewhere else yet. All
code which works with the type defined in this PR will work with this
proposal as well.
Lastly, there is the option which is the same as the hierarchy option
above but with StaticColumnHeader being the only interface with a "type"
attribute. This is a valid possibility but, I have decided that it just
adds unnecessary complexity by requiring a type check in many more
places.
The goals is to allow for dynamic HParam columns in the data table. This
means that we cannot have an enum like ColumnHeaderType be the unique
identifier for the column headers because we cannot encapsulate all
possible hparams into an enum.
This change adds a name and displayName field to the ColumnHeader
interface. The goal here is to make name be the unique identifier for
columns. However, this PR does not use these fields at all. It simply
adds them. THERE IS NO FUNCTIONAL CHANGE in this PR.
Upcoming changes will switch the code over to start using the name as
the unique identifier and display the displayName.
(For POC to see how this change fits in googlers see cl/526767686)
N/A
POC works
There were many alternatives considered. In fact I do not believe this
is going to be the final structure.
One option is to remove the type and add a category field
export interface ColumnHeader {
name: string;
displayName: string;
Category: ColumnCategory(STATIC, HPARAM, METRIC)
enabled: boolean;
}
However, deciding how to calculate the value based on hardcoded name
strings does not seem ideal.
Another option is to have a hierarchy. I expect it to look like this:
Interface ColumnHeaderBase {
name: string;
displayName: string;
type: ColumnHeaderType;
enabled: boolean;
}
export interface StaticColumnHeader extends ColumnHeaderBase{
category: “STATIC”
}
export interface HParamColumnHeader extends ColumnHeaderBase{
category: “HParam”
source: enum(data, config,....);
differs:boolean;
}
ColumnHeader = StaticColumnHeader | HParamColumnHeader
This may be the final form that we go with however, we are not sure the
source and differs attributes need to go here or somewhere else yet. All
code which works with the type defined in this PR will work with this
proposal as well.
Lastly, there is the option which is the same as the hierarchy option
above but with StaticColumnHeader being the only interface with a "type"
attribute. This is a valid possibility but, I have decided that it just
adds unnecessary complexity by requiring a type check in many more
places.
The goals is to allow for dynamic HParam columns in the data table. This
means that we cannot have an enum like ColumnHeaderType be the unique
identifier for the column headers because we cannot encapsulate all
possible hparams into an enum.
This change adds a name and displayName field to the ColumnHeader
interface. The goal here is to make name be the unique identifier for
columns. However, this PR does not use these fields at all. It simply
adds them. THERE IS NO FUNCTIONAL CHANGE in this PR.
Upcoming changes will switch the code over to start using the name as
the unique identifier and display the displayName.
(For POC to see how this change fits in googlers see cl/526767686)
N/A
POC works
There were many alternatives considered. In fact I do not believe this
is going to be the final structure.
One option is to remove the type and add a category field
export interface ColumnHeader {
name: string;
displayName: string;
Category: ColumnCategory(STATIC, HPARAM, METRIC)
enabled: boolean;
}
However, deciding how to calculate the value based on hardcoded name
strings does not seem ideal.
Another option is to have a hierarchy. I expect it to look like this:
Interface ColumnHeaderBase {
name: string;
displayName: string;
type: ColumnHeaderType;
enabled: boolean;
}
export interface StaticColumnHeader extends ColumnHeaderBase{
category: “STATIC”
}
export interface HParamColumnHeader extends ColumnHeaderBase{
category: “HParam”
source: enum(data, config,....);
differs:boolean;
}
ColumnHeader = StaticColumnHeader | HParamColumnHeader
This may be the final form that we go with however, we are not sure the
source and differs attributes need to go here or somewhere else yet. All
code which works with the type defined in this PR will work with this
proposal as well.
Lastly, there is the option which is the same as the hierarchy option
above but with StaticColumnHeader being the only interface with a "type"
attribute. This is a valid possibility but, I have decided that it just
adds unnecessary complexity by requiring a type check in many more
places.
## Motivation for features / changes The eventual goal is to allow dynamic HParam columns in the data table. To do this we introduced the name and displayName attributes to the ColumnHeader in #6346. The name attribute is now going to be the unique identifier for a column instead of the type enum. ## Technical description of changes The SelectedStepRunData is used to hold the data for the table for a specific run. Previously this was an object with an optional property for all values of the ColumnHeaderType enum. This will no longer work as these values need to be more dynamic to allow for all possible Hparam values. This PR changes that object to add an array which holds all the data points associated with the name of the column which they correspond to. Unfortunately this breaks the sorting as the array of SelectedStepRunData which is passed to the DataTable is sorted based on which header type the user chose to sort by. So that had to be updated to use the name of the column which the user chose to sort by. ## Alternate designs / implementations considered (or N/A) I thought about adding a new field to the SelectedStepRunData object called HParam value and keeping all the optional attributes. This was a big headache for ordering and sorting.
Motivation for features / changes
The goals is to allow for dynamic HParam columns in the data table. This means that we cannot have an enum like ColumnHeaderType be the unique identifier for the column headers because we cannot encapsulate all possible hparams into an enum.
Technical description of changes
This change adds a name and displayName field to the ColumnHeader interface. The goal here is to make name be the unique identifier for columns. However, this PR does not use these fields at all. It simply adds them. THERE IS NO FUNCTIONAL CHANGE in this PR.
Upcoming changes will switch the code over to start using the name as the unique identifier and display the displayName.
(For POC to see how this change fits in googlers see cl/526767686)
Screenshots of UI changes (or N/A)
N/A
Detailed steps to verify changes work correctly (as executed by you)
POC works
Alternate designs / implementations considered (or N/A)
There were many alternatives considered. In fact I do not believe this is going to be the final structure.
One option is to remove the type and add a category field
export interface ColumnHeader {
name: string;
displayName: string;
Category: ColumnCategory(STATIC, HPARAM, METRIC)
enabled: boolean;
}
However, deciding how to calculate the value based on hardcoded name strings does not seem ideal.
Another option is to have a hierarchy. I expect it to look like this:
Interface ColumnHeaderBase {
name: string;
displayName: string;
type: ColumnHeaderType;
enabled: boolean;
}
export interface StaticColumnHeader extends ColumnHeaderBase{
category: “STATIC”
}
export interface HParamColumnHeader extends ColumnHeaderBase{
category: “HParam”
source: enum(data, config,....);
differs:boolean;
}
ColumnHeader = StaticColumnHeader | HParamColumnHeader
This may be the final form that we go with however, we are not sure the source and differs attributes need to go here or somewhere else yet. All code which works with the type defined in this PR will work with this proposal as well.
Lastly, there is the option which is the same as the hierarchy option above but with StaticColumnHeader being the only interface with a "type" attribute. This is a valid possibility but, I have decided that it just adds unnecessary complexity by requiring a type check in many more places.