From 60bc9c1ed692f1bb47c2302028b265fd02c704cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Sierro?= Date: Wed, 13 Sep 2023 10:35:07 +0200 Subject: [PATCH] fix: Pickle PlotRange --- src/scgenerator/physics/units.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/scgenerator/physics/units.py b/src/scgenerator/physics/units.py index ffe37c0..19ddb61 100644 --- a/src/scgenerator/physics/units.py +++ b/src/scgenerator/physics/units.py @@ -386,6 +386,9 @@ class PlotRange(tuple): def sort_axis(self, axis: np.ndarray) -> tuple[np.ndarray, np.ndarray, tuple[float, float]]: return sort_axis(axis, self) + def __reduce__(self): + return (PlotRange, (self.left, self.right, self.unit)) + def sort_axis( axis: np.ndarray, plt_range: PlotRange