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

Allow choosing sheets when constructing a Table #2076

Merged
merged 2 commits into from
Mar 10, 2017
Merged

Allow choosing sheets when constructing a Table #2076

merged 2 commits into from
Mar 10, 2017

Conversation

markotoplak
Copy link
Member

@markotoplak markotoplak commented Mar 7, 2017

Includes
  • Code changes
  • Tests
  • Documentation

@astaric
Copy link
Member

astaric commented Mar 7, 2017

This looks like a change that could benefit from the third checkbox (documentation).

@codecov-io
Copy link

codecov-io commented Mar 7, 2017

Codecov Report

Merging #2076 into master will decrease coverage by -0.98%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #2076      +/-   ##
==========================================
- Coverage   69.93%   68.96%   -0.98%     
==========================================
  Files         315      315              
  Lines       53979    53981       +2     
==========================================
- Hits        37752    37226     -526     
- Misses      16227    16755     +528

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1165800...6e6a23a. Read the comment docs.

@@ -48,6 +48,11 @@ def test_named_sheet(self):
self.assertEqual(len(table.domain.attributes), 4)
self.assertEqual(table.name, 'header_0_sheet-my_sheet')

def test_named_sheet_table(self):
table = Table(get_dataset("header_0_sheet.xlsx"), sheet="my_sheet")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we avoid polluting the constructor? I.e. encouraging the use of Table.from_file()?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Constructor did not change at all with this PR, here it is just used as usual.

Copy link
Contributor

@kernc kernc Mar 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usage implies sheet is an argument accepted in the constructor. Any future re-design will need to take this instantaneous whim into consideration. Our Table constructor doesn't have a docstring. This is not the usual.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, that is exactly why I thought to include it here like this: that we would know what we break. :) But here I think it would actually be better to modify the constructor not to pass kwargs to from_file so that this would not even be allowed. What do you think?

Copy link
Contributor

@kernc kernc Mar 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, I don't at all mind not passing kwargs to from_file method.

@astaric astaric merged commit 81afdde into biolab:master Mar 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants