-
Notifications
You must be signed in to change notification settings - Fork 320
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
Make data saver accept numpy type floats/ints #1225
Conversation
…rting them to floating points.
Codecov Report
@@ Coverage Diff @@
## master #1225 +/- ##
==========================================
+ Coverage 80.53% 80.54% +0.01%
==========================================
Files 49 49
Lines 6816 6821 +5
==========================================
+ Hits 5489 5494 +5
Misses 1327 1327 |
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.
This seems very sensible, I like the idea. Just add a bit of testing and we'll roll.
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.
great, but please add tests (at least the code from the issue description, and smth for the strings)
2) Typehint change in add_result of the datasaver class: Add that numpy types are acceptable
@WilliamHPNielsen @astafan8 I have added test. Can we have another look |
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.
it's nice with the tests!
@WilliamHPNielsen If you approve this, I will merge right away |
data_saver = DataSaver( | ||
dataset=test_set, write_period=0, parameters={"p": p}) | ||
|
||
data_saver.add_result(("p", "some text")) |
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.
don't want to be annoying but:
- pep8 required newline at the end of the file
- should the test also assert that
some text
is indeed in the database?
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 quite surprised this commit even passed the quality inspection: Doesn't CI check for PEP8?
Anyway, I will correct the above.
Merge: 551620d 24dfa0b Author: sohail chatoor <[email protected]> Merge pull request #1225 from sohailc/bug/1224
Fixes #1224
We test if a value is a "non-array-type" by our ability to recast it to a float. This is more robust than having a list of acceptable types as we can always miss types.