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

raster-aggregation in matplotlib extension #1091

Open
raphaelquast opened this issue Jun 2, 2022 · 0 comments
Open

raster-aggregation in matplotlib extension #1091

raphaelquast opened this issue Jun 2, 2022 · 0 comments
Milestone

Comments

@raphaelquast
Copy link
Contributor

Is your feature request related to a problem? Please describe.

I've already stated the problem on discourse (here), but since it does not seem to get a lot of
attention there I thought I'll bring this up in a more general way on github as well.

I'm the dev of EOmaps, which already provides an integration for datashader via the matplotlib-extension.

While working on some improvements on the link between EOmaps and datashader, I've noticed
that at the moment, (at least as I understand it) the dsshow function of the matplotlib-extension
only allows for bypixel aggregations, which limits the capabilities quite a bit.

To be more precise, I've been trying to get "raster"-like aggregations (using for example "mode" reduction) working but
I could not find a way on how to do that without monkey-patching parts of the matplotlib-extension (see below)

Describe the solution you'd like

A clear and concise description of what you want to happen.

at the moment, the aggregation in dsshow() is implemented like this:

canvas = Canvas(
    plot_width=plot_width,
    plot_height=plot_height,
    x_range=x_range,
    y_range=y_range,
)
binned = bypixel(self.df, canvas, self.glyph, self.aggregator)

however, as I understand it, a more flexible way would be to use something like

canvas = Canvas(
    plot_width=plot_width,
    plot_height=plot_height,
    x_range=x_range,
    y_range=y_range,
)

# <aggregation-type> = "raster", "point", "line" etc. 
# <reduction> = "mean", "median", "max" etc.
agg = canvas.<aggregation-type>(<Dataset>, agg=<reduction>)
binned = agg.compute()

This is just a scetch to clarify what I mean...

Describe alternatives you've considered

Well, I've managed to get raster-aggregation working in EOmaps by monkey-patching the aggregate() function of the matplotlib-extension, but I don't think that this is a proper (and sustainable) way to provide a better datashader-integration.

Additional context

here's what I intend to achieve (ideally without having to temper with the matpltolib-extension myself):
datashader_raster_aggregation

@ianthomas23 ianthomas23 self-assigned this Jul 18, 2022
@ianthomas23 ianthomas23 added this to the v0.14.2 milestone Jul 18, 2022
@ianthomas23 ianthomas23 modified the milestones: v0.14.2, v0.14.3 Aug 10, 2022
@ianthomas23 ianthomas23 removed their assignment Oct 24, 2023
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

No branches or pull requests

2 participants