Skip to content

Commit

Permalink
Fix KeyError exception of the previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
yokochi47 committed Jan 16, 2025
1 parent 8c3c8e3 commit 566cfca
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions wwpdb/utils/nmr/NmrDpUtility.py
Original file line number Diff line number Diff line change
Expand Up @@ -28779,7 +28779,10 @@ def __testCsValueConsistencyInPkLoop(self) -> bool:
if sp_dim['ID'] != i:
continue
axis_codes.append(sp_dim['Axis_code'])
alt_axis_codes.append(str(sp_dim['Atom_isotope_number']) + sp_dim['Atom_type'])
if 'Atom_isotope_number' in sp_dim and 'Atom_type' in sp_dim:
alt_axis_codes.append(str(sp_dim['Atom_isotope_number']) + sp_dim['Atom_type'])
else:
alt_axis_codes.append(sp_dim['Axis_code'])
abs_pk_pos.append(False if 'Absolute_peak_positions' not in sp_dim else sp_dim['Absolute_peak_positions'])
sp_width = None if 'Sweep_width_units' not in sp_dim else sp_dim.get('Sweep_width')
if 'Sweep_width_units' in sp_dim and sp_dim['Sweep_width_units'] == 'Hz'\
Expand Down Expand Up @@ -29274,7 +29277,10 @@ def __testCsValueConsistencyInPkAltLoop(self) -> bool:
if sp_dim['ID'] != i:
continue
axis_codes.append(sp_dim['Axis_code'])
alt_axis_codes.append(str(sp_dim['Atom_isotope_number']) + sp_dim['Atom_type'])
if 'Atom_isotope_number' in sp_dim and 'Atom_type' in sp_dim:
alt_axis_codes.append(str(sp_dim['Atom_isotope_number']) + sp_dim['Atom_type'])
else:
alt_axis_codes.append(sp_dim['Axis_code'])
abs_pk_pos.append(False if 'Absolute_peak_positions' not in sp_dim else sp_dim['Absolute_peak_positions'])
sp_width = None if 'Sweep_width_units' not in sp_dim else sp_dim.get('Sweep_width')
if 'Sweep_width_units' in sp_dim and sp_dim['Sweep_width_units'] == 'Hz' and 'Spectrometer_frequency' in sp_dim and sp_width is not None:
Expand Down

0 comments on commit 566cfca

Please sign in to comment.