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

Merge for v3.4 #63

Merged
merged 84 commits into from
Apr 5, 2022
Merged

Merge for v3.4 #63

merged 84 commits into from
Apr 5, 2022

Conversation

raphaelquast
Copy link
Owner

@raphaelquast raphaelquast commented Mar 25, 2022

A major release that brings a lot of updates on speed and memory management and some very nice (but possibly breaking) changes compared previous versions of EOmaps.

❗ IMPORTANT CHANGES ❗

⭐ Starting with EOmaps v3.4 all callbacks and colorbars are layer-specific !

This means that callbacks only trigger if the layer of the associated Maps object is visible!
(...and colorbars are only visible if the associated layer is visible)

  • To trigger callbacks or add features & datasets independent of the visible layer, use m.all.cb. ...
    (or attach them to a Maps object on the "all" layer)

  • Note: pick callbacks now always react to the visible collection!
    (except for the ones on the "all" layer)

    m = Maps(layer=0)
    m.cb.click.attach.annotate()       # this callback is ONLY executed if the layer 0 is visible
    
    m1 = m.new_layer(layer=1)
    m1.cb.click.attach.mark()          # this callback is ONLY executed if the layer 1 is visible
    
    m.all.cb.click.attach.annotate()   # this callback is executed independent of the visible layer!

🍃 removed arguments

  • the obsolete "orientation" argument has been removed from Maps(...)
    (it set the colorbar-orientation which is now specified via m.add_colorbar(orientation=...)

🌳 NEW

  • m.show() can be used to make the associated layer visible. (a shortcut for m.show_layer(m.layer)
  • m.BM.on_layer(...) can be used to trigger functions if the visible layer changes.
  • 🌟 WebMap layers are now lazily evaluated and only added to the map if the corresponding layer is actually visible.
  • 🌟 [experimental feature] memory-mapping can now be used to avoid using up a lot of ram for very large datasets
    • Intermediate datasets are stored as memory-mapped files in a temp-folder on disk to release memory
    • By default memory-mapping is disabled! (to activate it, use: m.plot_map(memmap=False) )

🌦️ changes

  • Adding data from files (e.g. m.from_file or m.new_layer_from_file) now always uses "shade_raster" as the default plot-shape (since EOmaps v3.3.2, raster-shading works perfectly fine with re-projected rasters as well)
  • If a file with >2M data-points is plotted, only "shade" shapes are attempted by default to avoid overloading memory.
  • only one colorbar is allowed for Maps objects (use multiple objects for multiple colorbars)

🔨 fixes

  • Fix several issues with memory-leaks and garbage-collection of objects
  • Fix autoscale_fraction not recognized when using preset="bw" in m.add_scalebar
  • Maps objects are now properly garbage-collected
  • Fix auto-scaling of scalebars for very small scales
  • Maps.from_file now properly handles pathlib.Path objects
  • Fix utility widget start-layer should be the currently visible layer
  • Fix pick-events should only identify points on visible layers
  • Fix m.add_colorbar(log=True) for horizontal colorbars
  • Fix colorbar limit autoscaling
  • Fix logo size changes on zoom
  • Remove obsolete layer kwarg from m.add_logo
  • Fix incorrect color-normalization for shade_raster or shade_points if vmin/vmax outside the data-range are used
    (thanks to @maxhollmann)

@codecov-commenter
Copy link

codecov-commenter commented Mar 28, 2022

Codecov Report

Merging #63 (3b3fdaa) into master (0528e04) will decrease coverage by 2.42%.
The diff coverage is 62.79%.

❗ Current head 3b3fdaa differs from pull request most recent head f8de0de. Consider uploading reports for the commit f8de0de to get more accurate results

@@            Coverage Diff             @@
##           master      #63      +/-   ##
==========================================
- Coverage   75.46%   73.03%   -2.43%     
==========================================
  Files          12       12              
  Lines        5106     5330     +224     
==========================================
+ Hits         3853     3893      +40     
- Misses       1253     1437     +184     
Impacted Files Coverage Δ
eomaps/callbacks.py 86.95% <ø> (-0.63%) ⬇️
eomaps/reader.py 17.07% <5.00%> (+0.23%) ⬆️
eomaps/_shapes.py 80.62% <50.00%> (-0.40%) ⬇️
eomaps/eomaps.py 71.02% <57.86%> (-1.93%) ⬇️
eomaps/helpers.py 76.63% <64.00%> (-1.24%) ⬇️
eomaps/_containers.py 71.16% <66.66%> (-2.14%) ⬇️
eomaps/_cb_container.py 76.86% <67.20%> (-6.25%) ⬇️
eomaps/utilities.py 64.32% <76.92%> (-0.57%) ⬇️
eomaps/_webmap.py 80.32% <83.67%> (-0.80%) ⬇️
eomaps/scalebar.py 75.95% <88.88%> (-7.35%) ⬇️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0528e04...f8de0de. Read the comment docs.

@raphaelquast raphaelquast changed the title Merge for v3.3.3 Merge for v3.4 Mar 29, 2022
- use BM.on_layer for selectors and sliders
- move `util._layer_selector._get_layers()` to `m._get_layers()`
- add "name" property to all webmap services
- make sure Maps objects are properly garbage-collected
- avoid circular references (use weak-references otherwise)
- add `m.cleanup()` to allow immediate garbage-collection of Maps objects
- remove unneeded "m._bounds()" function
- callbacks are only executed on the layer of the associated Maps-object
- callbacks on the "all" layer are executed on all Maps-objects
  (the new default layer is "all" !)
@raphaelquast raphaelquast added this to the EOmaps v3.4 milestone Apr 5, 2022
@raphaelquast raphaelquast merged commit fcb4a85 into master Apr 5, 2022
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.

3 participants