Skip to content

Commit

Permalink
PEP8 cleanup of CifToNmrStar.py and RCI.py
Browse files Browse the repository at this point in the history
  • Loading branch information
yokochi47 committed May 16, 2024
1 parent 11c4938 commit d7e3be3
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 66 deletions.
12 changes: 10 additions & 2 deletions wwpdb/utils/nmr/CifToNmrStar.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ def convert(self, cifPath=None, strPath=None, datablockName=None, maxRepeat=1):

category_order = _category_order

_sf_category = ''
cur_list_id = 1

reserved_block_names = []
sf = None
for item in category_order:
Expand All @@ -294,10 +297,15 @@ def convert(self, cifPath=None, strPath=None, datablockName=None, maxRepeat=1):

sf_category = item['sf_category']

cur_list_id = 1
if item['sf_category_flag'] or ('missing_sf_category' in item and item['missing_sf_category']):
if sf_category in sf_category_counter:
if sf_category not in sf_category_counter:
cur_list_id = 1
else:
cur_list_id = sf_category_counter[sf_category] + 1
elif sf_category != _sf_category:
cur_list_id = 1

_sf_category = sf_category

sf_tag_prefix = next(v['Tag category'] for k, v in self.schema.items()
if v['SFCategory'] == sf_category and v['Tag field'] == 'Sf_category')
Expand Down
Loading

0 comments on commit d7e3be3

Please sign in to comment.