Skip to content
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

Merged
merged 9 commits into from
Aug 15, 2018

Conversation

sohailc
Copy link
Member

@sohailc sohailc commented Aug 9, 2018

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.

@codecov
Copy link

codecov bot commented Aug 9, 2018

Codecov Report

Merging #1225 into master will increase coverage by 0.01%.
The diff coverage is 100%.

@@            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

Copy link
Contributor

@WilliamHPNielsen WilliamHPNielsen left a 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.

Copy link
Contributor

@astafan8 astafan8 left a 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
@sohailc
Copy link
Member Author

sohailc commented Aug 13, 2018

@WilliamHPNielsen @astafan8 I have added test. Can we have another look

Copy link
Contributor

@astafan8 astafan8 left a 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!

@sohailc
Copy link
Member Author

sohailc commented Aug 13, 2018

@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"))
Copy link
Contributor

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?

Copy link
Member Author

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.

@sohailc sohailc merged commit 700e0cb into microsoft:master Aug 15, 2018
giulioungaretti pushed a commit that referenced this pull request Aug 15, 2018
Merge: 551620d 24dfa0b
Author: sohail chatoor <schatoor@gmail.com>

    Merge pull request #1225 from sohailc/bug/1224
@sohailc sohailc deleted the bug/1224 branch October 3, 2018 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants