Compare commits
1 commit
master
...
no_dps_ali
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1876951bc3 |
3 changed files with 11 additions and 0 deletions
|
|
@ -32,7 +32,11 @@ class unit_config(object):
|
||||||
t = copy.copy(self)
|
t = copy.copy(self)
|
||||||
return t
|
return t
|
||||||
|
|
||||||
|
do_dps_align = True
|
||||||
|
|
||||||
def align(self, *others):
|
def align(self, *others):
|
||||||
|
if not self.do_dps_align:
|
||||||
|
return
|
||||||
self.dps.align(*[o.dps for o in others])
|
self.dps.align(*[o.dps for o in others])
|
||||||
for c in (self,)+others:
|
for c in (self,)+others:
|
||||||
c.ppss.realign_to_dps(c.dps)
|
c.ppss.realign_to_dps(c.dps)
|
||||||
|
|
|
||||||
|
|
@ -760,12 +760,16 @@ class dps_table(object):
|
||||||
d.add(p)
|
d.add(p)
|
||||||
return d
|
return d
|
||||||
|
|
||||||
|
do_dps_align = True
|
||||||
|
|
||||||
def align(self, *others):
|
def align(self, *others):
|
||||||
"""align several dps tables for easier diffing:
|
"""align several dps tables for easier diffing:
|
||||||
dps_products that are in all tables are left in their original position,
|
dps_products that are in all tables are left in their original position,
|
||||||
others are appended at the end sorted by name;
|
others are appended at the end sorted by name;
|
||||||
all products idx are shifted to make space for the longest dp in any table"""
|
all products idx are shifted to make space for the longest dp in any table"""
|
||||||
tables = (self,) + others
|
tables = (self,) + others
|
||||||
|
if not self.do_dps_align:
|
||||||
|
return tables
|
||||||
name_set = [set([p.name for p in t.list()]) for t in tables]
|
name_set = [set([p.name for p in t.list()]) for t in tables]
|
||||||
common_set = name_set[0].intersection(*name_set[1:])
|
common_set = name_set[0].intersection(*name_set[1:])
|
||||||
names = [p.name for p in self.list() if p.name in common_set]
|
names = [p.name for p in self.list() if p.name in common_set]
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,9 @@ from . import data as step_data
|
||||||
|
|
||||||
class step_config(unit_config):
|
class step_config(unit_config):
|
||||||
TYPE = "STEP"
|
TYPE = "STEP"
|
||||||
|
|
||||||
|
do_dps_align = False
|
||||||
|
|
||||||
def __init__(self, ppss=None, science=None, dps=None, l3=None,
|
def __init__(self, ppss=None, science=None, dps=None, l3=None,
|
||||||
unit='STEP', model=None, variant=None,
|
unit='STEP', model=None, variant=None,
|
||||||
ix1_thr=None, ix2_thr=None,
|
ix1_thr=None, ix2_thr=None,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue