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

Added get_filters function; Fixed register #212

Merged
merged 8 commits into from
Nov 24, 2022
Merged

Conversation

t20100
Copy link
Member

@t20100 t20100 commented Nov 24, 2022

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 with get_filters and then retrieve the filter_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 to hdf5plugin 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: 58c56eb

closes #207

@t20100 t20100 added this to the 4.0.0 milestone Nov 24, 2022
@t20100 t20100 requested a review from vasole November 24, 2022 13:09
@t20100 t20100 changed the title Added get_filters function Added get_filters function; Fixed register Nov 24, 2022
@rayosborn
Copy link

Thank you for this. It goes much further than I was proposing and the registered option in the get_fllters function looks especially useful.

Copy link
Member

@vasole vasole left a comment

Choose a reason for hiding this comment

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

Great work! (as usual)

@vasole vasole merged commit 625ca0a into silx-kit:main Nov 24, 2022
@t20100 t20100 deleted the get_filters branch November 28, 2022 14:16
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.

Adding dictionaries to point to filter classes - not IDs
3 participants