XENON1T / pax

The XENON1T raw data processor [deprecated]
BSD 3-Clause "New" or "Revised" License
16 stars 15 forks source link

Deprecated matplotlib function in PatternFitter #703

Open pelssers opened 6 years ago

pelssers commented 6 years ago

I recently had to install Pax in a Python 3.5 environment. The problem I encountered was that in the PatternFitter we use the matplotlib module _cntr which is deprecated since matplotlib 2.2.0.

We used this module instead of matplotlibs contour() function because it traces contours without making an actual plot. To work with the latest matplotlib we need to rewrite this part of PatternFitter using matplotlibs contour() function.

feigaodm commented 6 years ago

@pelssers Would you like to fix it with a PR, maybe that helps to understand what's the issue :)

JelleAalbers commented 6 years ago

It seems we're using _cntr to find an array of (x,y) pairs describing the contour (https://github.com/XENON1T/pax/blob/master/pax/PatternFitter.py#L268). We could use http://scikit-image.org/docs/dev/api/skimage.measure.html#skimage.measure.find_contours from scikit-image to do it instead; it might even simplify the code. I'm fine with adding scikit-image as a dependency.