-
Notifications
You must be signed in to change notification settings - Fork 25
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
Create Config class and fix printing. #456
Conversation
Codecov Report
@@ Coverage Diff @@
## v1.0.0.dev #456 +/- ##
============================================
Coverage 100.00% 100.00%
============================================
Files 14 14
Lines 1131 1135 +4
============================================
+ Hits 1131 1135 +4
Continue to review full report at Codecov.
|
90a8e55
to
12b5bfb
Compare
rdt/hyper_transformer.py
Outdated
"""Config dict for ``HyperTransformer`` with a better representation.""" | ||
|
||
def __repr__(self): | ||
"""Preaty print the dictionary.""" |
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.
typo: Pretty
@@ -12,6 +12,18 @@ | |||
get_default_transformer, get_transformer_instance, get_transformers_by_type) | |||
|
|||
|
|||
class Config(dict): |
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.
Now that we have this class I'm wondering if it makes sense to move the field_transformers
, _provided_field_transformers
, field_sdtypes
and _provided_field_sdtypes
to this class. Then we could make the config an attribute of the HyperTransformer
and add methods to this class for updating the config. For example, if the user sets something, it will update both dictionaries appropriately. Like a private update_field_transformers(self, user_provided=False)
and update_field_sdtypes(self, user_provided=False)
method that either only update the main dictionaries or both if necessary.
It's up to you if you want to do that extra work. I think the benefit would be that it would be less likely for anyone to forget to update or clear a provided dictionary when updating the main one, but this isn't in the scope of the issue
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 opened an issue to address this in another pr
: #457
* Create Config class and fix printing. * Fix: integer and float to be numerical. * Remove int and float. * Fix integration test * Fix tests * Fix typo
Resolve #450
Resolve #452
Resolve #449
deepcopy
(version 9 and above fixes it).14
since they are currently on13
.