From ac9babb9ad8a0f416aa543e9723791c424e0c5d9 Mon Sep 17 00:00:00 2001 From: Artur Glavic Date: Fri, 10 Oct 2025 09:26:40 +0200 Subject: [PATCH] Fix unwanted matplotlib import in projection.py --- eos/projection.py | 5 +++-- requirements.txt | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/eos/projection.py b/eos/projection.py index fa81180..f4949d2 100644 --- a/eos/projection.py +++ b/eos/projection.py @@ -10,8 +10,6 @@ from typing import List, Tuple, Union import numpy as np from dataclasses import dataclass -from matplotlib.colors import LogNorm - from .event_data_types import EventDatasetProtocol from .instrument import Detector, LZGrid from .normalization import LZNormalisation @@ -312,6 +310,7 @@ class LZProjection(ProjectionInterface): """ Inline update of previous plot by just updating the data. """ + from matplotlib.colors import LogNorm if self.is_normalized: I = self.data.ref else: @@ -458,6 +457,7 @@ class YZProjection(ProjectionInterface): """ Inline update of previous plot by just updating the data. """ + from matplotlib.colors import LogNorm if isinstance(self._graph.norm, LogNorm): vmin = self.data.I[(self.data.I>0)].min()*0.5 else: @@ -597,6 +597,7 @@ class TofZProjection(ProjectionInterface): """ Inline update of previous plot by just updating the data. """ + from matplotlib.colors import LogNorm if isinstance(self._graph.norm, LogNorm): vmin = self.data.I[(self.data.I>0)].min()*0.5 else: diff --git a/requirements.txt b/requirements.txt index 8dddb81..5d8f474 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,5 +2,6 @@ numpy h5py orsopy numba +matplotlib backports.strenum; python_version<"3.11" backports.zoneinfo; python_version<"3.9"