From 513554efd350d5acffba0b6c0c1e787161052bf9 Mon Sep 17 00:00:00 2001 From: Kimoon Han Date: Thu, 19 Dec 2024 13:45:13 +0900 Subject: [PATCH] fix: enforce strict monotonicity check in data loader --- src/erlab/io/dataloader.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/erlab/io/dataloader.py b/src/erlab/io/dataloader.py index 586f0558..5a374397 100644 --- a/src/erlab/io/dataloader.py +++ b/src/erlab/io/dataloader.py @@ -1413,7 +1413,10 @@ def _combine_multiple( if ( len(coord_dict) > 1 and len(data_list) > 1 - and all(is_monotonic(np.asarray(v)) for v in coord_dict.values()) + and all( + is_monotonic(np.asarray(v), strict=True) + for v in coord_dict.values() + ) ): # We rename with process_keys after assigning coords and expanding dims. # This is necessary to ensure that coordinate_attrs are preserved.