sertit / eoreader

Remote-sensing opensource python library reading optical and SAR sensors, loading and stacking bands, clouds, DEM and spectral indices in a sensor-agnostic way.
https://eoreader.readthedocs.io/en/latest/
Apache License 2.0
271 stars 22 forks source link

Add a context manager to open product #133

Open jteulade opened 3 months ago

jteulade commented 3 months ago

When you open a product with the method Reader().open(...), you have to delete the product at the end. Otherwise, if your program open a lot of products, you can have a space problem.

With a context manager, you can have a clearer code without a try finally statement.

remi-braun commented 3 months ago

Very nice feature to have, indeed 😉