Skip to content

Commit

Permalink
fix cannot remove all multiplicity
Browse files Browse the repository at this point in the history
  • Loading branch information
Lan Le authored and phuang26 committed Dec 2, 2021
1 parent 1efdfb4 commit fb01b1e
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion chem_spectra/lib/composer/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,17 +181,32 @@ def gen_integration_info(self):
if len(self.itgs) > 0:
table = []
for itg in self.itgs:
absoluteArea = 0
if 'absoluteArea' in itg:
absoluteArea = itg['absoluteArea']
table.extend([
'({}, {}, {}, {})\n'.format(
itg['xL'] - self.refShift,
itg['xU'] - self.refShift,
float(itg['area']) * self.refArea,
itg['absoluteArea'],
absoluteArea,
),
])
return table
elif self.core.params['integration'].get('edited'):
return []
elif 'stack' in self.core.params['integration']:
itg_stack = self.core.params['integration']['stack'] or []
if len(itg_stack) == 0:
return []
if 'stack' in self.core.params['multiplicity']:
mpy_stack = self.core.params['multiplicity']['stack'] or []
if len(mpy_stack) > 0:
for itg in itg_stack:
for mpy in mpy_stack:
if (itg['xL'] == mpy['xExtent']['xL']) and (itg['xU'] == mpy['xExtent']['xU']):
return []
return itg_stack
else:
return self.core.itg_table

Expand All @@ -216,6 +231,8 @@ def gen_mpy_integ_info(self):
return table
elif self.core.params['multiplicity'].get('edited'):
return []
elif 'stack' in self.core.params['multiplicity']:
return self.core.params['multiplicity']['stack']
else:
return self.core.mpy_itg_table

Expand Down

0 comments on commit fb01b1e

Please sign in to comment.