Skip to content

v2.12.0

Latest

Choose a tag to compare

@PierreRaybaut PierreRaybaut released this 30 Oct 09:20
· 3 commits to master since this release
v2.12.0
775f245

Version 2.12

PlotPy Version 2.12.0

✨ New features:

  • Min/max curve downsampling — Curve downsampling now keeps, by default, the minimum and the maximum of each group of 2 × N points (N being the downsampling factor), instead of one point out of N: narrow peaks and the envelope of noisy signals are preserved, with about as many points as before. The new Downsampling method curve parameter (CurveParam.dsamp_method) restores the former method ("stride"). CurveItem.get_dsamp_indices returns the indices of the points kept, the new minmax_downsampling_indices function computes them, and the CurveItem.frozen_downsampling context keeps them while points are edited (closes Issue #83)

🛠️ Bug fixes:

  • Z-axis logarithmic scale — With the Z-axis logarithmic scale enabled (ZAxisLogTool), the color bar, the contrast adjustment panel and the LUT range used logarithms of the image values instead of the image values themselves. The color bar now shows the original image values on a logarithmic scale, with the same colors as the image, consistently with the cursor values. In the contrast adjustment panel, the range now matches the histogram, so that the "Full range", "Eliminate %", "Min." and "Max." actions no longer show the image with a single color. Cross sections and exported images with the LUT applied now follow the logarithmic color mapping. Images with values lower than 1 (e.g. between 0 and 1) are no longer shown with a single color: values lower than or equal to zero are now shown with the lowest color of the colormap. Enabling the logarithmic scale sets the LUT range to the full range of the positive values, and disabling it restores the previous LUT range. The Z-axis log tool is now disabled for image items which do not support it (RGB images, 2D histograms, quadrilateral grids and image filters). API change: with the logarithmic scale, get_lut_range, set_lut_range, get_lut_range_full and the lut_range argument of set_data now use data units instead of base-10 logarithms, and the new BaseImageItem.supports_zaxis_log method tells whether an image item supports the logarithmic scale (closes Issue #63)
  • Editing points of downsampled curves — With downsampling enabled, moving a curve point modified another point of the curve data than the one shown, since the handle of a drawn point was used as an index into the full data
  • Curve fitting dialog — Running the automatic fit no longer raises OverflowError: argument 1 overflowed errors when a fitted value ends up far outside the range of its slider (e.g. with the Powell method on a fit range restricted to the tail of a peak). These errors left the slider of the parameter unresponsive, and the values of the following parameters were not displayed. Such values are now shown with a warning icon, whose tooltip gives the slider range, while the slider stays at its nearest end. Typing nan or inf in a parameter field now restores the previous value instead of raising errors, and the number of slider steps must be at least 2 in the parameter properties dialog (closes Issue #76)
  • Cross-section panels with many hidden images — X/Y cross-section panels kept one curve for every image ever displayed, even after it was hidden, so plots containing hundreds of hidden images became progressively slower to refresh. Curves are now only kept for visible images, and are recreated when a hidden image is shown again
  • Cross sections of images added or shown again — When an image was added to the plot, or shown again after having been hidden, while a cross-section marker or shape was active, its X/Y cross-section curves remained empty (image added) or showed the cross section at a former position of the marker (image shown again) until the marker was moved. These curves are now computed as soon as the image is shown, unless the auto-refresh of the cross-section panel is disabled. The shade under the cross-section curves no longer fades as hidden images accumulate in the plot (closes Issue #89)
  • Custom colormaps location — Custom colormaps were saved in a .none directory of the user's configuration directory (~/.config/.none on Linux, %USERPROFILE%\.none on Windows), shared by all applications whatever their own configuration directory, and this directory was created as soon as colormaps were loaded. Custom colormaps are now saved in PlotPy's configuration directory (.plotpy by default) or, if the application sets the name of PlotPy's configuration with plotpy.config.CONF.set_application (e.g. "MyApp/plotpy"), in the configuration directory of this application, from which they are reloaded even if the name is set after PlotPy was imported. The first time, custom colormaps saved in the former .none and .plotpy directories are copied to the new location, without modifying the former files. Looking up the location of PlotPy's configuration files no longer creates any directory (closes Issue #70)
  • Anti-aliasing interpolation — With the anti-aliasing interpolation, replacing the data of an image by data of another type (e.g. 16-bit integers by floating-point numbers) made the next drawing of the image fail, which aborted the application with PyQt5. Exporting an image area with its interpolation but without its contrast settings (e.g. with the rectangle snapshot tool) failed with TypeError: AA Mask data type must be ... errors when the Z-axis logarithmic scale was enabled, or after such a data type change. Images are now drawn and exported whatever their data type and their Z-axis scale (closes Issue #89)
  • Python and libraries information — plotpy.widgets.about.get_python_libs_info and the plotpy-benchmarks script failed with AttributeError: module 'guidata.widgets.about' has no attribute 'get_python_libs_info' (closes Issue #89)

⚡ Performance:

  • Plot refresh — Refreshing a plot no longer recomputes the plot layout when the title and axis styles did not change
  • Item tools and item list — Updating the status of item-related tools and of the item list panel is no longer quadratic in the number of plot items
  • Image creation — Creating an image item no longer recomputes the colormap lookup table when the same colormap, inversion and transparency settings were already used: the table (more than 1000 colormap evaluations) is computed once and reused, which saves a few milliseconds per image
  • Curves on high-DPI screens — With a display scaling factor such as 125 % or 150 %, curves and error bars of width 1 were drawn wider than one screen pixel, which made their rendering up to several hundred times slower on noisy signals (about 800 ms instead of 3 ms for a 2000-point curve at 150 %). Curves and error bars of width 1 or less are now drawn one screen pixel wide on screen; printing and exporting are not affected. The new curve/cosmetic_hairline option of the plot configuration section restores the previous behavior (closes Issue #80)
  • Thick curves — Curves wider than one screen pixel are now drawn on screen as several one-pixel strokes, slightly offset from each other, which looks almost the same as before but is 30 to 50 times faster on noisy curves: a 2000-point curve of width 2 takes about 10 ms instead of 370 ms to draw with antialiasing. Dash patterns are scaled as before. Printing and exporting, curves with a translucent color and curves wider than 8 screen pixels still use the original pen. The new curve/fast_thick_lines option of the plot configuration section restores the previous behavior (closes Issue #82)

⚙️ Dependencies:

  • Python 3.10 or later is now required, and wheels are no longer built for Python 3.9. Python 3.9 users must keep an earlier compatible release (PlotPy 2.11.x) (closes Issue #74)

🔧 Other changes:

  • Continuous integration — PlotPy is now also tested with PyQt6 and PySide6 (Python 3.10 and 3.14) on each push and pull request, and with PyQt6 before each PyPI release. Pull requests targeting the develop or release branch are now tested against the development versions of guidata and PythonQwt, as pushes to these branches already were (closes Issue #69)
  • Test suite — The SnapshotTool annotation test no longer hangs when run on its own, on Windows or with Qt 6: it waited indefinitely for the snapshot dialog to be closed