Skip to content

Commit afe10e2

Browse files
authored
fix: crystallographic_files folders in download now sans suffix (#550)
1 parent 65dba3c commit afe10e2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

viewer/download_structures.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,13 @@ def _create_structures_dict(site_obvs, protein_params, other_params):
737737
afile = []
738738
for f in model_attr:
739739
# here the model_attr is already stringified
740-
apath = Path('crystallographic_files').joinpath(so.code)
740+
try:
741+
exp_path = re.search(r"x\d*", so.code).group(0) # type: ignore[union-attr]
742+
except AttributeError:
743+
logger.error('Unexpected shortcodeformat: %s', so.code)
744+
exp_path = so.code
745+
746+
apath = Path('crystallographic_files').joinpath(exp_path)
741747
if model_attr and model_attr != 'None':
742748
archive_path = str(
743749
apath.joinpath(

0 commit comments

Comments
 (0)