Skip to content

Commit df9a959

Browse files
committed
allow the HM symbol change to be visible after changing the IT coord
code
1 parent b6b7a77 commit df9a959

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

easyDiffractionApp/Examples/LaMnO3_3T2@LLB/models/lmo.cif

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ _cell.angle_beta 90.0
88
_cell.angle_gamma 90.0
99

1010
_space_group.name_H-M_alt "P n m a"
11-
_space_group.IT_coordinate_system_code cab
11+
_space_group.IT_coordinate_system_code abc
1212

1313
loop_
1414
_atom_site.label
@@ -22,4 +22,4 @@ _atom_site.B_iso_or_equiv
2222
La La 0.9924720001733065 0.048845000881678716 0.25 1.0 Biso 0.2906
2323
Mn Mn 0.5 0.0 0.0 1.0 Biso 0.1658
2424
O1 O 0.0743619999537262 0.48730900009876266 0.25 1.0 Biso 0.438
25-
O2 O 0.7257829999607026 0.306773999947812 0.03854 1.0 Biso 0.3592
25+
O2 O 0.7257829999607026 0.306773999947812 0.03854 1.0 Biso 0.3592

easyDiffractionApp/Logic/Model.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,13 +565,26 @@ def setMainParamWithFullUpdate(self, blockIdx, category, name, field, value):
565565
# but it's easier to just update the existing dict
566566
if field == 'value':
567567
self._dataBlocks[blockIdx]['params'][category][name]['value'] = value
568+
# check dependencies for the given parameter
569+
self.setParamDependencies(blockIdx, category, name, value)
568570
elif field == 'error':
569571
self._dataBlocks[blockIdx]['params'][category][name]['error'] = value
570572
elif field == 'fit':
571573
self._dataBlocks[blockIdx]['params'][category][name]['fit'] = value
574+
572575
self.setDataBlocksCif()
576+
# self.replaceModel(self._dataBlocksCif[0][0])
573577
self.replaceModel()
574578

579+
def setParamDependencies(self, blockIdx, category, name, value):
580+
# changes to certain parameters trigger changes in other parameters
581+
# 1. space group code change -> change space group name
582+
if name == 'IT_coordinate_system_code':
583+
spaceGroup = self._dataBlocks[blockIdx]['params']['_space_group']
584+
group = self.job.phases[blockIdx].space_group
585+
spaceGroup['name_H-M_alt']['value'] = group.hermann_mauguin
586+
pass
587+
575588
@Slot(int, str, str, str, 'QVariant')
576589
def setMainParam(self, blockIdx, category, name, field, value):
577590
changedIntern = self.editDataBlockMainParam(blockIdx, category, name, field, value)
@@ -621,7 +634,8 @@ def createSpaceGroupNames(self):
621634
names = []
622635
for system in all_system_names:
623636
numbers = SpacegroupInfo.get_ints_from_system(system)
624-
names.extend([SpacegroupInfo.get_symbol_from_int_number(n) for n in numbers])
637+
for n in numbers:
638+
names.extend(SpacegroupInfo.get_compatible_HM_from_int(n))
625639
return names
626640

627641
def createIsotopesNames(self):

0 commit comments

Comments
 (0)