question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[feature request] Discover and load compression plugins

See original GitHub issue

As mentioned in #2161 and https://github.com/h5py/h5py/issues/928#issuecomment-353715290, the official way for packages to support plugins is using entry points.

By officially supporting plugins that register new compression schemes, unpythonic and error prone mechanisms like hdf5plugin modifying h5py’s global variables state on import can be avoided.

hdf5plugin plugin could then register itself e.g. like this:

[project.entry-points.'h5py.compression']
lz4 = 'hdf5plugin:LZ4'
zstd = 'hdf5plugin:Zstd'

While h5py loads their projects:

from collections import ChainMap
from importlib.metadata import entry_points

FILTERS_BUILTIN = {'gzip': ..., 'lzf': ..., 'szip': ...}
FILTERS_PLUGIN = {ep.name: ep.load() for ep in entry_points(group='h5py.compression')}
FILTERS = ChainMap(FILTERS_BUILTIN, FILTERS_PLUGIN)

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:27 (22 by maintainers)

github_iconTop GitHub Comments

1reaction
vasolecommented, Oct 17, 2022

It would be so simple if the work done by hdf5plugin developers could be made by the HDF Group …

1reaction
t20100commented, Oct 17, 2022

h5py and hdf5plugin are constrained by libhdf5 API and behaviour (as any library wrappers), so it’s not always easy/possible to be Pythonic.

Now to focus on entry point/behaviour issue, from hdf5plugin side:

  • We are ready to adapt to an entry point integration if the h5py dev team is taking this way.
  • To me, it is not worth breaking the current behaviour of import hdf5plugin loading HDF5 filters for e.g., import hdf5plugin; hdf5plugin.load_filters().
Read more comments on GitHub >

github_iconTop Results From Across the Web

Provide a interface for registering filter plugins #928 - GitHub
Provide a interface for registering filter plugins #928 ... [feature request] Discover and load compression plugins #2163.
Read more >
Smush – Lazy Load Images, Optimize & Compress Images
Compress images & optimize images with lazy load, WebP conversion, and resize detection to make your site load amazingly fast.
Read more >
11 Best Free Compressor Plugins 2022 (VCA, Vari-Mu, FET ...
In this article, we enlist and review the 11 Best Free Compressor Plugins available in 2022. Find the perfect compressor for mastering and...
Read more >
6 Best WordPress Image Optimizer Plugins (Tested and ...
ShortPixel Image Optimizer; Optimole; Imagify; EWWW Image Optimizer; Compress JPEG & PNG images by TinyPNG; Smush Image Compression and ...
Read more >
Highcompress Image Compressor plugin for Wordpress
Highcompress is a tool to compress images without loosing quality powered by Deep learning. We have added many feature other than compression on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found