-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
OWDataSets: refactor code, move some functionalities to new methods #2950
Conversation
Orange/widgets/data/owdatasets.py
Outdated
self._header_labels = [header['label'] for _, header in self.HEADER_SCHEMA] | ||
self._html_description_tags = ['year', 'source', 'title', 'description', 'seealso', 'references'] | ||
|
||
self._header_index = namedtuple('_header_index', [*[info_tag for info_tag, _ in self.HEADER_SCHEMA]]) |
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 is a syntax error on older python versions (as reported by failing tests).
But also, I don't see a reason for unpacking and repacking the list...
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.
Thanks, forgot to remove this when I was testing something.
Orange/widgets/data/owdatasets.py
Outdated
|
||
# add missing variables to the namespace | ||
# not needed if all info files have the same JSON structure | ||
for tag in self._html_description_tags: |
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.
Not all variables are in _html_description_tags
, e.g. one test fails, because 'size' is missing (which is in _header_index
, but not in _html_description_tags
.
Also, did you make sure that it is OK to set all missing things to None
? Previously, some default values were different, e.g. []
for 'references'.
8ad5494
to
4fd7627
Compare
Codecov Report
@@ Coverage Diff @@
## master #2950 +/- ##
==========================================
+ Coverage 81.86% 81.86% +<.01%
==========================================
Files 329 329
Lines 56770 56782 +12
==========================================
+ Hits 46474 46486 +12
Misses 10296 10296 |
Issue
biolab/orange3-single-cell#121
Description of changes
Split large chunk of code into smaller methods, so we can easily override them.
Moved item model creation in a separate method.
Includes