-
Notifications
You must be signed in to change notification settings - Fork 7
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
[PNE-6367] Add support for feature effects. #982
Conversation
@@ -88,6 +88,7 @@ class TableConfig(Resource["TableConfig"]): | |||
The query used to define the materials underpinning this table | |||
generation_algorithm: TableFromGemdQueryAlgorithm | |||
Which algorithm was used to generate the config based on the GemdQuery results | |||
|
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.
My local flake8
was complaining about this file, despite me not touching it. 🤷♂️
1d2b4cb
to
8a16228
Compare
The payload comes in as a condensed format, so it's expanded in order to constructed nested lists of objects for clarity and ease of use. Additionally, the hierarchy of data is flipped to more closely match how it will be used by our customers. To that end, 'as_dict' is provided to ease importing it into a pandas DataFrame for whatever processing and analysis the customer desires.
8a16228
to
623a307
Compare
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.
Mostly good. I have a concern about a sig change.
@property | ||
def as_dict(self) -> Dict[str, Dict[str, Dict[UUID, float]]]: | ||
"""Presents the feature effects as a dictionary by output.""" | ||
return {output.output: output.feature_dict for output in self.outputs} |
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.
resource.py supports an as_dict
method that is not a property. Does it need to be a property? I'm concerned about changing the signature on a derived class.
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.
Resource
doesn't define as_dict
, just GEMDResource
.
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.
Yes, you're right. Not a sig collision.
Choice of property or method doesn't seem to have a consistent flavor in the library. This feels more like a method to me than a property, but acceptable as is if you feel strongly to the contrary.
The payload comes in as a condensed format, so it's expanded in order to contructed nested lists of objects for clarity and ease of use.
Additionally, the hierarchy of data is flipped to more closely match how it will be used by our customers. To that end, 'as_dict' is provided to ease importing it into a pandas DataFrame for whatever processing and analysis the customer desires.
PR Type:
Adherence to team decisions