-
Notifications
You must be signed in to change notification settings - Fork 76
[SVCS-159] Fix Extension Names in Renderer and Exporter #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
[SVCS-159] Fix Extension Names in Renderer and Exporter #320
Conversation
- get_renderer_name() and get_exporter_name() take self.metadata.ext as the ext name. Must convert it to lower case to find the renderer/exporter.
f83ce64 to
39ebdca
Compare
- Improve code and comments - Fix tests
39ebdca to
a0c694e
Compare
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.
Ready for CR 🎆
- If you prefer
nextfor iterator, I can change it.
| return list(entry_attrs)[0].attrs[0] | ||
| # `ep_iterator` is an iterable object. Must convert it to a `list` for access. | ||
| # `list()` can only be called once because the iterator moves to the end after conversion. | ||
| ep_iterator = pkg_resources.iter_entry_points(group='mfr.renderers', name=name.lower()) |
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.
For both exporter and renderer, the primary functional change is name=name.lower().
|
|
||
| def get_exporter_name(name): | ||
| # If file type is supported, there must be only one element in the list. | ||
| assert len(ep_list) == 1 |
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.
For both exporter and renderer, use assert for functionalities that are not expected to break.
Ticket
https://openscience.atlassian.net/browse/SVCS-159
Purpose
#296 breaks files of which the extension names are not lower case. This PR fix the issue.
Changes
name->name.lower()get_renderer_name()andget_exporter_name()Side effects
No
QA Notes
No
Deployment Notes
No