From 58f75e9f1412af8ae9806e5d31421cd7907ba7fc Mon Sep 17 00:00:00 2001 From: dvezinet Date: Mon, 30 Mar 2026 12:46:05 +0000 Subject: [PATCH 1/2] [#237] Fixed --- datastock/_plot_as_array.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/datastock/_plot_as_array.py b/datastock/_plot_as_array.py index 4b6c33f..209c105 100644 --- a/datastock/_plot_as_array.py +++ b/datastock/_plot_as_array.py @@ -91,7 +91,7 @@ def plot_as_array( # check key, inplace flag and extract sub-collection lk = [kk for kk in [keyX, keyY, keyZ, keyU] if kk is not None] - coll2, key = coll.extract( + coll2, keys = coll.extract( [key] + lk, inc_monot=False, inc_vectors=False, @@ -99,7 +99,10 @@ def plot_as_array( return_keys=True, inplace=inplace, ) - key = [kk for kk in key if kk not in lk][0] + if key is None: + key = [kk for kk in key if kk not in lk][0] + lndim = [coll2.ddata[kk]['data'].ndim for kk in key] + key = key[np.argmax(lndim)] ndim = coll2.ddata[key]['data'].ndim # -------------- @@ -603,7 +606,6 @@ def _check( else: dvminmax2[k1]['min'] = dvminmax[kk]['min'] - if dvminmax is None or dvminmax.get(kk, {}).get('max') is None: dvminmax2[k1]['max'] = nanmax + margin else: From ecf7449490858dfd8f464b51414f2c82c9ea8810 Mon Sep 17 00:00:00 2001 From: dvezinet Date: Mon, 30 Mar 2026 13:13:55 +0000 Subject: [PATCH 2/2] [#237] Minor debiug --- datastock/_class1.py | 1 - datastock/_class1_compute.py | 2 -- datastock/_plot_as_array.py | 2 +- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/datastock/_class1.py b/datastock/_class1.py index 29b9296..2c9644c 100644 --- a/datastock/_class1.py +++ b/datastock/_class1.py @@ -470,7 +470,6 @@ def extract( return_keys: returns the value of keys """ - return _class1_compute._extract_instance( self, keys=keys, diff --git a/datastock/_class1_compute.py b/datastock/_class1_compute.py index a204115..2418d85 100644 --- a/datastock/_class1_compute.py +++ b/datastock/_class1_compute.py @@ -735,7 +735,6 @@ def _extract_instance( # ----------------- # select # ----------------- - ldata, lref = _extract_select( coll=coll, keys=keys, @@ -755,7 +754,6 @@ def _extract_instance( else: coll2 = coll.__class__() - # ------------------------ # Populate # ------------------------ diff --git a/datastock/_plot_as_array.py b/datastock/_plot_as_array.py index 209c105..3b4d2d4 100644 --- a/datastock/_plot_as_array.py +++ b/datastock/_plot_as_array.py @@ -100,7 +100,7 @@ def plot_as_array( inplace=inplace, ) if key is None: - key = [kk for kk in key if kk not in lk][0] + key = [kk for kk in key if kk not in lk] lndim = [coll2.ddata[kk]['data'].ndim for kk in key] key = key[np.argmax(lndim)] ndim = coll2.ddata[key]['data'].ndim