From 8f07b260661afd9d74b8cb7f1f40be3153e7aa47 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 15 Aug 2022 19:05:15 +0200 Subject: datafile: more thorough detection of when c= is needed --- datafile.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/datafile.py b/datafile.py index 0436e2a..f9f758f 100644 --- a/datafile.py +++ b/datafile.py @@ -84,6 +84,7 @@ class _DataSet(object): ### private ### _df = None + _need_c = False def __init__(self, df, name): self._df = df @@ -95,6 +96,7 @@ class _DataSet(object): self._slice_single_component(first_iter, 0) self.nb_components = 1 except KeyError: + self._need_c = True c = 0 while True: try: @@ -119,6 +121,9 @@ class _DataSet(object): def _slice_single_component(self, it, rl, component = None): querystr = b'%s it=%d tl=0 rl=%d' % (self.name.encode('ascii'), it, rl) + if component is None and self._need_c: + component = 0 + if component is not None: querystr += b' c=%d' % component -- cgit v1.2.3