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
load and save functionality for open files and strings #566
Conversation
80cd709
to
281e6dd
Compare
featuretools/tests/primitive_tests/test_feature_serialization.py
Outdated
Show resolved
Hide resolved
featuretools/tests/primitive_tests/test_feature_serialization.py
Outdated
Show resolved
Hide resolved
featuretools/tests/primitive_tests/test_feature_serialization.py
Outdated
Show resolved
Hide resolved
featuretools/tests/primitive_tests/test_feature_serialization.py
Outdated
Show resolved
Hide resolved
featuretools/tests/primitive_tests/test_feature_serialization.py
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #566 +/- ##
==========================================
+ Coverage 96.43% 96.47% +0.03%
==========================================
Files 117 117
Lines 9505 9524 +19
==========================================
+ Hits 9166 9188 +22
+ Misses 339 336 -3
Continue to review full report at Codecov.
|
featuretools/tests/primitive_tests/test_feature_serialization.py
Outdated
Show resolved
Hide resolved
…onvert to JSON first, and then catching that ValueError if is a file path
featuretools/tests/primitive_tests/test_feature_serialization.py
Outdated
Show resolved
Hide resolved
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.
Looks good
fixes #73
Updated /featuretools/feature_base save and load to fulfill:
Returns the serialized features as a string
ft.save_features(features)
Saves the serialized features as a file
ft.save_features(features, '/path/to/save/to.txt')
Save the features to open file f
ft.save_features(features, f)
Loads features from string:
ft.load_features(feature_str)
Loads features from file path:
ft.load_features('/path/to/features')
Loads features from open file f:
ft.load_features(f)