From e5a2d4076a19ab2dd0d0543048be086c2772f601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Le=20Guyader?= <loic.le.guyader@xfel.eu> Date: Tue, 22 Oct 2019 14:23:17 +0200 Subject: [PATCH] Make sure the list of run keys are sorted before comparing them. --- Load.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Load.py b/Load.py index b3adaeb..62ec295 100644 --- a/Load.py +++ b/Load.py @@ -451,15 +451,17 @@ def load(fields, runNB, proposalNB, semesterNB, topic='SCS', display=False, return result def concatenateRuns(runs): - """ Concatenate two runs with identical data variables along the trainId dimension + """ Concatenate a list of two runs with identical data variables along the + trainId dimension. + Input: runs: (list) the xarray Datasets to concatenate Output: a concatenated xarray Dataset """ - keys = runs[0].keys() + keys = sorted(runs[0].keys()) for run in runs[1:]: - if run.keys() != keys: + if sorted(run.keys()) != keys: print('data fields between different runs are not identical. Cannot combine runs.') return -- GitLab