parent
711a42565c
commit
dd4612dd9b
|
@ -187,12 +187,14 @@ class Result:
|
||||||
choice = list(datasets).copy() if hasattr(datasets,'__iter__') and not isinstance(datasets,str) else \
|
choice = list(datasets).copy() if hasattr(datasets,'__iter__') and not isinstance(datasets,str) else \
|
||||||
[datasets]
|
[datasets]
|
||||||
|
|
||||||
if what == 'increments':
|
what_ = what if what.endswith('s') else what+'s'
|
||||||
|
|
||||||
|
if what_ == 'increments':
|
||||||
choice = [c if isinstance(c,str) and c.startswith('increment_') else
|
choice = [c if isinstance(c,str) and c.startswith('increment_') else
|
||||||
self.increments[c] if isinstance(c,int) and c<0 else
|
self.increments[c] if isinstance(c,int) and c<0 else
|
||||||
f'increment_{c}' for c in choice]
|
f'increment_{c}' for c in choice]
|
||||||
elif what == 'times':
|
elif what_ == 'times':
|
||||||
what = 'increments'
|
what_ = 'increments'
|
||||||
if choice == ['*']:
|
if choice == ['*']:
|
||||||
choice = self.increments
|
choice = self.increments
|
||||||
else:
|
else:
|
||||||
|
@ -206,18 +208,18 @@ class Result:
|
||||||
elif np.isclose(c,self.times[idx+1]):
|
elif np.isclose(c,self.times[idx+1]):
|
||||||
choice.append(self.increments[idx+1])
|
choice.append(self.increments[idx+1])
|
||||||
|
|
||||||
valid = _match(choice,getattr(self,what))
|
valid = _match(choice,getattr(self,what_))
|
||||||
existing = set(self.visible[what])
|
existing = set(self.visible[what_])
|
||||||
|
|
||||||
dup = self.copy()
|
dup = self.copy()
|
||||||
if action == 'set':
|
if action == 'set':
|
||||||
dup.visible[what] = sorted(set(valid), key=util.natural_sort)
|
dup.visible[what_] = sorted(set(valid), key=util.natural_sort)
|
||||||
elif action == 'add':
|
elif action == 'add':
|
||||||
add = existing.union(valid)
|
add = existing.union(valid)
|
||||||
dup.visible[what] = sorted(add, key=util.natural_sort)
|
dup.visible[what_] = sorted(add, key=util.natural_sort)
|
||||||
elif action == 'del':
|
elif action == 'del':
|
||||||
diff = existing.difference(valid)
|
diff = existing.difference(valid)
|
||||||
dup.visible[what] = sorted(diff, key=util.natural_sort)
|
dup.visible[what_] = sorted(diff, key=util.natural_sort)
|
||||||
|
|
||||||
return dup
|
return dup
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue