Eomaps

Latest version: v8.3.1

Safety actively analyzes 682387 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 9 of 15

4.2.2

A minor bugfix release.

🌳 new
- To address issues when plotting **2D raster-data** with **unsorted coordinates**, there is now an option
to force sorting the data by coordinates prior to plotting with `m.plot_map(assume_sorted=False)`
- only works if coordinates are provided as 1D arrays and the data is provided as a 2D array
- sorting is only relevant for `raster` and `shade_raster` shapes (other shapes don't require sorting)
- by default no sorting is performed!
🌦️ changes
- The pick-radius used to identify clicked pixels can now be set in 2 ways `m.plot_map(pick_distance=...)`:
- if a number is provided, it is used as a multiplier for the dataset-radius
e.g. `pick-radius = pick_distance * radius_in_plot_crs`)
- if a string is provided, it is directly used as the pick-radius in units of the plot_crs
e.g. `pick-radius = float(pick_distance)`
πŸ”¨ fixes
- ❗ fix using "pick" callbacks with `m.set_shape.raster()` and 2D input-coordinates
- make radius-estimation more robust (fallback to nearest-neighbor if 2D estimation fails)
- fallback to `np.inf` for pick_distance if radius estimation fails
- fix delaunay_triangulation does not need to estimate the radius if masked=False
- fix issues with registering pandas

4.2.1

A bugfix release that greatly reduces import time!

🌦️ changes
- πŸ• greatly reduced "plain" import-time
- "heavy" modules such as 'datashader', 'xarray' etc. are now lazily imported only when needed
- this reduces runtime of `from eomaps import Maps` in a fresh terminal from ~5sec to ~1sec
- πŸƒ `m.add_marker(...)` now supports the "layer" kwarg
- πŸƒ `m.show()` now automatically calls `plt.show()` to actually draw the figure if matplotlib is in non-interactive mode

πŸ”¨ fixes
- legends for WebMap services are now updated based on the visible layer
- `m.add_marker` now only draws newly added markers (instead of updating all dynamic artists)
- avoid using `pkg_resources` to identify package-version (use explicit `_version.py` instead)

4.2

🌳 New
- ⭐ there's a new function `m.fetch_layers()`
- ...to fetch (and cache) all layers of a map so that switching layers (with buttons & sliders) is fast
- a associated callback `m.cb.keypress.attach.fetch_layers()` is also available
- ⭐ there's a new pre-defined WebMap service for the "Copernicus Atmosphere Monitoring Service"
- accessible via `m.add_wms.CAMS` (see [ECMWF CAMS](https://confluence.ecmwf.int/display/CKB/WMS+for+CAMS+Global+and+European+air+quality+products) for details )
- πŸ“ƒ docs on [WebMap services](https://eomaps.readthedocs.io/en/latest/api.html#webmap-layers) have been updated with examples on how to
- use custom service-urls
- pass arguments (time, style etc.) to the service

🌦️ Changes
- πŸƒ `m.set_shape.raster()` can now be used with 1D `pandas.DataFrames` as well!
(DataFrames will be re-structured internally based on unique values of the coordinate-columns)
- πŸƒ `.add_legend()` for WebMap services can now properly recognizes the used map-style
`m.add_wms.<SERVICE>.....add_layer.<LAYER>.add_legend()`

πŸ”¨ Fixes
- ❗ fix pixel centers shifted by half pixel-size with `m.set_shape.raster()`
- speedup `m.set_shape.raster()` (remove unnecessary calculations)
- fix identification of picked ID if `pandas.Series` objects are used as coordinates
- allow setting shade-aggregator via strings (e.g. "mean", "min", "max" etc.) for `m.shade_points`
- fix colorbar kwargs assertions should intercept before axes are created
- add fix for QuadMesh performance issues for older matplotlib versions (e.g. < v3.5.2)
- fix issues with updating WebMaps when using `m.util.layer_slider()`
- fix re-using WebMap objects with different kwargs
- fix fetching WebMap legends for different styles

4.1.1

A bugfix release that brings some nice updates for the colorbar.

🌈 updates for the colorbar
- ⭐ Colorbars now have proper extension-arrows to indicate values outside the colorbar-range
- ⭐ `m.add_colorbar()` supports some new arguments to further customize the colorbar:
- `histogram_size` : set the relative height of the histogram in relation to the height of the colorbar
(use 0 for a plain colorbar and 999 for a plain histogram)
- `extend_frac`: set the relative size of the extension-arrows
- `add_extend_arrows`: toggle drawing extension-arrows
(by default arrows are only drawn if there are values outside the [`vmin`, `vmax`] range)

🌦️ changes
- setting vmin/vmax no longer clips data-values
(e.g. callbacks now always retrieve actual data-values independent of vmin/vmax)

πŸ”¨ fixes
- fix setting zorder for WebMap layers
- make sure the default zorder for `m.plot_map()` is 1 for all shapes
- fix test-action issues (use mamba + updated version of conda-incubator)
- fix adding static annotations by dataset-ID with `m.add_annotation()`
- fix some issues with draggable axes
- fix sorting of callback-execution order

4.1

A minor release that brings an awesome new feature and some bugfixes.
πŸ”¬ New feature: Inset-maps!
- Quickly create zoomed-in views on selected regions of a map with `m.new_inset_map()`

Checkout the docs for more details: [πŸ”¬ Inset-maps - zoom-in on interesting areas](https://eomaps.readthedocs.io/en/latest/api.html#inset-maps-zoom-in-on-interesting-areas)

![test](https://user-images.githubusercontent.com/22773387/167152361-e49f1ad1-5ef5-4d1d-b151-e2f707db4d27.png)


πŸ”¨ fixes
- allow using a scalar radius for calculating ellipse and rectangle points
- make sure the blit-manager always uses the correct figure object
- make histogram plot background visible (but set boundary color to none)
- fix wrong error-catching for layer-slider
- fix issues with colored histograms for discrete colormaps

4.0

A new major release that brings some nice new features, a lot of updates and some outstanding api-changes.
🌩 changes
❗ There are **breaking changes** to EOmaps v3.x ❗
🌞 For a quick-guide on how to **port existing scripts** to v4.x see: [βš™οΈ port script from v3.x to v4.x](
https://eomaps.readthedocs.io/en/dev/FAQ.html#port-script-from-eomaps-v3-x-to-v4-x)

[or click on the text below for details!]

<details>
<summary>πŸ”Έ <code>m.plot_specs</code> and <code>m.set_plot_specs(...)</code> have been removed</summary>

- **"vmin", "vmax"** and **"cmap"** are now set when calling `m.plot_map(...)`
- **"density", "tick_precision", "histbins"** and **"label"** are now set when calling `m.add_colorbar(...)`
- **"cpos"** and **"cpos_radius"** are now set with `m.set_data_specs(...)`

</details>

<details>
<summary>πŸ”Έ <code>voroni_diagram</code> is now correctly called <code>voronoi_diagram</code></summary>

This just fixes the typo in the name.

python
--- OLD ---
m.set_shape.voroni_diagram()

--- NEW ---
m.set_shape.voronoi_diagram()



</details>

<details>
<summary>πŸ”Έ The data-specs <code>xcoord</code> and <code>ycoord</code> have been renamed to <code>x</code> and <code>y</code></summary>

This change is optional and will only raise a depreciation warning for now...
The old naming-convention will however be removed in future releases so it's highly recommended to use the new (shorter and more intuitiveπŸ™‚) `x` and `y` variable names.

python
--- OLD ---
m.set_data(data=..., xcoord=..., ycoord=..., ...)
m.data_specs.xcoord

--- NEW ---
m.set_data(data=..., x=..., y=..., ...)
m.data_specs.x


</details>

<details>
<summary>πŸ”Έ Custom callback functions now have a slightly different call-signature </summary>

> This removes the contra-intuitive "binding" of functions to the `Maps`-objects and ensures that class-methods can be used as callbacks without unwanted side-effects.

- The first argument is no longer identified automatically as the `Maps`-object!
(if you need access to the underlying `Maps`-object, simply pass it as an argument!)

python
m = Maps()
def cb(m, **kwargs):
pos = kwargs["pos"]
print("the Maps-object:", m)
print("the click-position is", pos)

m.cb.click.attach(cb, m=m)


<details>
<summary> πŸ‘Ύ [click to show] how to get back the old behaviour </summary>

To get back the old behavior you have to "bind" the callback functions to the Maps-object, e.g:

python
m = Maps()
def cb(self, **kwargs):
...

m.cb.click.attach(cb.__get__(m))

or simply pass the Maps-object as kwarg, e.g.:
python
m = Maps()
def cb(self, **kwargs):
...

m.cb.click.attach(cb self=m)


</details>

</details>

🌳 NEW
- ⭐ The Sentinel-2 cloudless WebMap service can now be used via `m.add_wms.s2_cloudless`
- 🌟 It is now possible to set "coordinate-only" datasets!
- This is particularly useful if you want to manually assign colors
python
m.set_data(None, [1,2,3], [1,2,3])
m.plot_map(fc=["r", "g", "b"])

πŸš€ there's a new plot shape! `m.set_shape.raster`
A fast way to plot 2D datasets.
<details>
<summary>[click to show] πŸ”Έ details </summary>

- it's quite similar to `plt.imshow` (e.g. a QuadMesh is used to speed up plotting of 2D datasets)
- the differences to `shade_raster` are:
- the whole dataset is always plotted (so for very very large datasets `shade_raster` is much faster!)
- it supports manual color specifications (`shade_raster` does not)
- the differences between `rectangles` and `raster` are:
- `raster` does not take the curvature of the edges into account
- `raster` determines the pixel-size based on neighboring pixels, `rectangles` allows arbitrary pixel-dimensions

</details>

🌈 there have been some major improvements for manual color specifications!

Checkout the [🌎 Customizing the plot](https://eomaps.readthedocs.io/en/dev/api.html#customizing-the-plot) section of the docs for details!

Colors can now be set manually with all shapes (except `shade` shapes) using
`m.plot_map(fc=[...])` (or `facecolor=` or `color=`)!


<details>
<summary>[click to show] πŸ”Έ Possible ways to specify colors.</summary>

- a single value (RGB/RGBA tuple, a matplotlib color-name or a hex-color)
- a tuple of 3/4 arrays in the same shape as the coordinates (identified as RGB/RGBA values)
- a list/array of RGB tuples, e.g. `[(1, 0, 0.25), (0.3, 0.4, 0.5), ....]`
- a list/array of RGBA tuples, e.g.: `[(1, 0, 0.25, 0.15), (0.3, 0.4, 0.5, 0.25), ....]`
- a list/array of matplotlib named-colors, e.g. `["r", "olive", "darkblue", ...]`
- a list/array of hex-colors, e.g.: `['ff0040', '4c6680', ...]`
For example:
python
m = Maps()
m.set_data(None, [1,2,3,4,5], [1,2,3,4,5])
use named colors
m.plot_map(ec="k", fc=["r", "olive", "darkblue", "orange", "indigo"])
or RGB tuples
m.plot_map(color=[(1, 0, 0), (.4, .5, .6), (.2, .7, .2), (.45, .12, .98), (.94, .45, .56)])
or a single color for all datapoints
m.plot_map(facecolor="g", edgecolor="r")
or use 3 individual arrays that should be identified as RGB values

Page 9 of 15

Β© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.