From c70ccbf214e068c991608960cc81e3e1de0068e5 Mon Sep 17 00:00:00 2001 From: Jeremy Wolcott Date: Mon, 23 Feb 2026 11:48:19 -0500 Subject: [PATCH 1/5] handle package org under the "editable install" paradigm The `setup.cfg` rearranges the output directory structure when using `pip install`. However, `pip install` has an `-e` flag, which, instead of actually installing the package, creates an "in-place" installation that's editable. The trouble is that the package structure as stored in Git (which is designed to be easier to navigate when editing) doesn't correctly interact with the path structure needed by matplotlib. Here we fix this `__init__.py` (which is not used when the package is installed via setup.py) so that it performs the same `$MPLCONFIGDIR` mangling that the `python/__init__.py` would otherwise do in a normal installation. --- src/matplotlib/__init__.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/matplotlib/__init__.py b/src/matplotlib/__init__.py index e69de29..1f38367 100644 --- a/src/matplotlib/__init__.py +++ b/src/matplotlib/__init__.py @@ -0,0 +1,15 @@ +try: + # This conceit handles the arrangement that comes out + # when dune_plot_style is set up standalone by using `pip install -e`. + # You may notice that this file is very similar to the one in the python/ subdirectory; + # that's because when installed with a regular `pip install` (without the `-e`), + # this file is not installed anywhere, and is not needed. + # It's only needed because the `install -e` invocation, instead of doing an install, + # simply points back to the package, so the directory structure is not rearranged as it is in installation. + import os, os.path, pathlib + from . import stylelib as module + os.environ["MPLCONFIGDIR"] = os.path.join(str(pathlib.Path(module.__path__[0]).parent.absolute()), "stylelib") + (os.pathsep + os.environ["MPLCONFIGDIR"] if "MPLCONFIGDIR" in os.environ else "") +except: + pass + +from .python import * \ No newline at end of file From c548c5cacf5522b3ae22d32b468be8aba4dd8499 Mon Sep 17 00:00:00 2001 From: Jeremy Wolcott Date: Mon, 23 Feb 2026 11:48:44 -0500 Subject: [PATCH 2/5] compat fix with numpy 2.4+ (where singleton arrays aren't automatically converted to scalars) --- examples/matplotlib/plotting_helpers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/matplotlib/plotting_helpers.py b/examples/matplotlib/plotting_helpers.py index 8d17ee5..b899b68 100644 --- a/examples/matplotlib/plotting_helpers.py +++ b/examples/matplotlib/plotting_helpers.py @@ -38,10 +38,10 @@ def CovEllipse(xdata, ydata, cov, q=None, nsig=None, facecolor='none', **kwargs) width, height = 2 * np.sqrt(val[:, None] * r2) angle = np.degrees(np.arctan2(*vec[::-1, 0])) - xmean = np.mean(xdata) - ymean = np.mean(ydata) + xmean = np.squeeze(np.mean(xdata)) + ymean = np.squeeze(np.mean(ydata)) - ellipse = Ellipse(xy=(xmean,ymean), width=width, height=height, angle=angle, + ellipse = Ellipse(xy=(xmean,ymean), width=np.squeeze(width), height=np.squeeze(height), angle=np.squeeze(angle), facecolor=facecolor, **kwargs) return ellipse From 233efc871a0f0ea98a70bc194595e85a3a0bd429 Mon Sep 17 00:00:00 2001 From: Jeremy Wolcott Date: Mon, 23 Feb 2026 14:28:42 -0500 Subject: [PATCH 3/5] minimal .gitignore --- .gitignore | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bb9c934 --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# generally ignore image files (but updates to the examples/images directory should still be noticed) +*.pdf +*.png +!examples/images/*.png + +# Distribution / packaging +build/ +*.egg-info/ From 775344068b7cae4a5a89cccb7606624e58053956 Mon Sep 17 00:00:00 2001 From: Jeremy Wolcott Date: Mon, 23 Feb 2026 14:30:51 -0500 Subject: [PATCH 4/5] those were *minimum*, not *exact*, requirements --- requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 242a48a..1bb130c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -matplotlib==3.6.3 -numpy==1.24.1 -scipy==1.10.0 +matplotlib>=3.6.3 +numpy>=1.24.1 +scipy>=1.10.0 From 2d7d45097f75b445a84adeea8c5f60b0224196fc Mon Sep 17 00:00:00 2001 From: Jeremy Wolcott Date: Mon, 23 Feb 2026 14:31:45 -0500 Subject: [PATCH 5/5] prepare for tagging 1.03 --- CMakeLists.txt | 2 +- setup.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 12cab88..f3ff622 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.12) -project(DUNEPlotStyle VERSION 01.02 LANGUAGES CXX) +project(DUNEPlotStyle VERSION 01.03 LANGUAGES CXX) set(CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS OWNER_READ diff --git a/setup.cfg b/setup.cfg index c40e729..c1e0b79 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = dune_plot_style -version = 1.02 +version = 1.03 author = DUNE Authorship and Publications Board (APB) author_email = dune-apb@fnal.gov description = Plot styling tools