Added get_filters
function; Fixed register
#212
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a
get_filters
function to retrieve filter classes from names or IDs.By default is returns all filter classes.
It accepts a special argument "registered" and then returns classes of all currently registered filters.
The
register
function was also extended to supports IDs.The
FILTERS
constant was removed from the documentation (not deprecated though): one can get filter classes withget_filters
and then retrieve thefilter_id
from the filter classes.A
filter_name
class attribute was also added to filter classes so one can get it from a class and it is shown in the documentation along with the classes.Question: Is it really worth adding this
filter_name
which is specific tohdf5plugin
to the API or not?@rayosborn would that fits your need?
This PR also fixes a bug in
register
when one filter fails to register, the other are skipped: 58c56ebcloses #207