Skip to content

Commit

Permalink
Fix potential bug that causes internal_error
Browse files Browse the repository at this point in the history
  • Loading branch information
yokochi47 committed Apr 23, 2024
1 parent a2e81f2 commit 17133c3
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions wwpdb/utils/nmr/NmrDpUtility.py
Original file line number Diff line number Diff line change
Expand Up @@ -9382,7 +9382,6 @@ def __detectContentSubType__(self, file_list_id, input_source, dir_path=None):

# increment loop counter of each content subtype
for lp_category in self.__lp_category_list:

if lp_category in self.lp_categories[file_type].values():
lp_counts[[k for k, v in self.lp_categories[file_type].items() if v == lp_category][0]] += 1

Expand Down Expand Up @@ -38039,7 +38038,10 @@ def __calculateStatsOfDistanceRestraint(self, file_list_id, sf_framecode, lp_dat
member_id, chain_id_1, seq_id_1, comp_id_1, atom_id_1,
chain_id_2, seq_id_2, comp_id_2, atom_id_2)

_count[data_type] += 1
if data_type in _count:
_count[data_type] += 1
else:
_count[data_type] = 1

range_of_vals.append(v)
count_of_vals.append(_count)
Expand Down Expand Up @@ -38320,7 +38322,10 @@ def __calculateStatsOfDistanceRestraint(self, file_list_id, sf_framecode, lp_dat
member_id, chain_id_1, seq_id_1, comp_id_1, atom_id_1,
chain_id_2, seq_id_2, comp_id_2, atom_id_2)

_count[data_type] += 1
if data_type in _count:
_count[data_type] += 1
else:
_count[data_type] = 1

if 0.0 <= v < scale and redundant:

Expand Down Expand Up @@ -38375,7 +38380,10 @@ def __calculateStatsOfDistanceRestraint(self, file_list_id, sf_framecode, lp_dat
member_id, chain_id_1, seq_id_1, comp_id_1, atom_id_1,
chain_id_2, seq_id_2, comp_id_2, atom_id_2)

_count[data_type] += 1
if data_type in _count:
_count[data_type] += 1
else:
_count[data_type] = 1

range_of_vals.append(v)
count_of_vals.append(_count)
Expand Down Expand Up @@ -39979,7 +39987,10 @@ def __calculateStatsOfDihedralRestraint(self, file_list_id, lp_data, conflict_id
chain_id_1, seq_id_1, atom_id_1, chain_id_2, seq_id_2, atom_id_2,
chain_id_3, seq_id_3, atom_id_3, chain_id_4, seq_id_4, atom_id_4)[0]

_count[data_type] += 1
if data_type in _count:
_count[data_type] += 1
else:
_count[data_type] = 1

if 0.0 <= v < scale and redundant:

Expand All @@ -40003,7 +40014,10 @@ def __calculateStatsOfDihedralRestraint(self, file_list_id, lp_data, conflict_id
chain_id_1, seq_id_1, atom_id_1, chain_id_2, seq_id_2, atom_id_2,
chain_id_3, seq_id_3, atom_id_3, chain_id_4, seq_id_4, atom_id_4)[0]

_count[data_type] += 1
if data_type in _count:
_count[data_type] += 1
else:
_count[data_type] = 1

range_of_vals.append(v)
count_of_vals.append(_count)
Expand Down Expand Up @@ -40359,7 +40373,10 @@ def __calculateStatsOfRdcRestraint(self, file_list_id, lp_data, conflict_id_set,

data_type = self.__getTypeOfRdcRestraint(atom_id_1, atom_id_2)

_count[data_type] += 1
if data_type in _count:
_count[data_type] += 1
else:
_count[data_type] = 1

range_of_vals.append(v)
count_of_vals.append(_count)
Expand Down Expand Up @@ -54415,7 +54432,6 @@ def __updateConstraintStats(self):

# increment loop counter of each content subtype
for lp_category in self.__lp_category_list:

if lp_category in self.lp_categories[file_type].values():
lp_counts[[k for k, v in self.lp_categories[file_type].items() if v == lp_category][0]] += 1

Expand Down

0 comments on commit 17133c3

Please sign in to comment.