@@ -1043,6 +1043,39 @@ def prune_formula_dictionary(eqdict):
10431043 return pruned
10441044
10451045
1046+ symmetry_constraints = "diffpy.symmetryutilities.SymmetryConstraints"
1047+ posparSymbols_deprecation_msg = build_deprecation_message (
1048+ symmetry_constraints ,
1049+ "posparSymbols" ,
1050+ "pospar_symbols" ,
1051+ removal_version ,
1052+ )
1053+ posparValues_deprecation_msg = build_deprecation_message (
1054+ symmetry_constraints ,
1055+ "posparValues" ,
1056+ "pospar_values" ,
1057+ removal_version ,
1058+ )
1059+ UparSymbols_deprecation_msg = build_deprecation_message (
1060+ symmetry_constraints ,
1061+ "UparSymbols" ,
1062+ "upar_symbols" ,
1063+ removal_version ,
1064+ )
1065+ UparValues_deprecation_msg = build_deprecation_message (
1066+ symmetry_constraints ,
1067+ "UparValues" ,
1068+ "upar_values" ,
1069+ removal_version ,
1070+ )
1071+ UFormulas_deprecation_msg = build_deprecation_message (
1072+ symmetry_constraints ,
1073+ "UFormulas" ,
1074+ "u_formulas" ,
1075+ removal_version ,
1076+ )
1077+
1078+
10461079class SymmetryConstraints (object ):
10471080 """Generate symmetry constraints for specified positions.
10481081
@@ -1132,10 +1165,10 @@ def __init__(self, spacegroup, positions, Uijs=None, sgoffset=[0, 0, 0], eps=Non
11321165 self .Ueqns = numpos * [None ]
11331166 self .Uisotropy = numpos * [False ]
11341167 # all members should be initialized here
1135- self ._findConstraints ()
1168+ self ._find_constraints ()
11361169 return
11371170
1138- def _findConstraints (self ):
1171+ def _find_constraints (self ):
11391172 """Find constraints for positions and anisotropic displacements
11401173 `Uij`."""
11411174 numpos = len (self .positions )
@@ -1184,11 +1217,29 @@ def _findConstraints(self):
11841217 self .corepos = [self .positions [i ] for i in coreidx ]
11851218 return
11861219
1220+ @deprecated (posparSymbols_deprecation_msg )
11871221 def posparSymbols (self ):
1222+ """'diffpy.structure.SymmetryConstraints.posparSymbols' is
1223+ deprecated and will be removed in version 4.0.0.
1224+
1225+ Please use 'diffpy.structure.SymmetryConstraints.pos_parm_symbols' instead.
1226+ """
1227+ return self .pos_parm_symbols ()
1228+
1229+ def pos_parm_symbols (self ):
11881230 """Return list of standard position parameter symbols."""
11891231 return [n for n , v in self .pospars ]
11901232
1233+ @deprecated (posparValues_deprecation_msg )
11911234 def posparValues (self ):
1235+ """'diffpy.structure.SymmetryConstraints.posparValues' is
1236+ deprecated and will be removed in version 4.0.0.
1237+
1238+ Please use 'diffpy.structure.SymmetryConstraints.pos_parm_values' instead.
1239+ """
1240+ return self .pos_parm_values ()
1241+
1242+ def pos_parm_values (self ):
11921243 """Return list of position parameters values."""
11931244 return [v for n , v in self .pospars ]
11941245
@@ -1214,7 +1265,7 @@ def positionFormulas(self, xyzsymbols=None):
12141265 emsg = "Not enough symbols for %i position parameters" % len (self .pospars )
12151266 raise SymmetryError (emsg )
12161267 # build translation dictionary
1217- trsmbl = dict (zip (self .posparSymbols (), xyzsymbols ))
1268+ trsmbl = dict (zip (self .pos_parm_symbols (), xyzsymbols ))
12181269
12191270 def translatesymbol (matchobj ):
12201271 return trsmbl [matchobj .group (0 )]
@@ -1249,16 +1300,45 @@ def positionFormulasPruned(self, xyzsymbols=None):
12491300 rv = [prune_formula_dictionary (eqns ) for eqns in self .positionFormulas (xyzsymbols )]
12501301 return rv
12511302
1303+ @deprecated (UparSymbols_deprecation_msg )
12521304 def UparSymbols (self ):
1305+ """'diffpy.structure.SymmetryConstraints.UparSymbols' is
1306+ deprecated and will be removed in version 4.0.0.
1307+
1308+ Please use 'diffpy.structure.SymmetryConstraints.u_parm_symbols' instead.
1309+ """
1310+ return self .u_parm_symbols ()
1311+
1312+ def u_parm_symbols (self ):
12531313 """Return list of standard atom displacement parameter
12541314 symbols."""
12551315 return [n for n , v in self .Upars ]
12561316
1317+ @deprecated (UparValues_deprecation_msg )
12571318 def UparValues (self ):
1319+ """'diffpy.structure.SymmetryConstraints.UparValues' is
1320+ deprecated and will be removed in version 4.0.0.
1321+
1322+ Please use 'diffpy.structure.SymmetryConstraints.u_parm_values'
1323+ instead.
1324+ """
1325+ return [v for n , v in self .Upars ]
1326+
1327+ def u_parm_values (self ):
12581328 """Return list of atom displacement parameters values."""
12591329 return [v for n , v in self .Upars ]
12601330
1331+ @deprecated (UFormula_deprecation_msg )
12611332 def UFormulas (self , Usymbols = None ):
1333+ """'diffpy.structure.SymmetryConstraints.UFormulas' is
1334+ deprecated and will be removed in version 4.0.0.
1335+
1336+ Please use 'diffpy.structure.SymmetryConstraints.u_formulas'
1337+ instead.
1338+ """
1339+ return self .u_formulas (Usymbols )
1340+
1341+ def u_formulas (self , Usymbols = None ):
12621342 """List of atom displacement formulas with custom parameter
12631343 symbols.
12641344
@@ -1282,7 +1362,7 @@ def UFormulas(self, Usymbols=None):
12821362 emsg = "Not enough symbols for %i U parameters" % len (self .Upars )
12831363 raise SymmetryError (emsg )
12841364 # build translation dictionary
1285- trsmbl = dict (zip (self .UparSymbols (), Usymbols ))
1365+ trsmbl = dict (zip (self .u_parm_symbols (), Usymbols ))
12861366
12871367 def translatesymbol (matchobj ):
12881368 return trsmbl [matchobj .group (0 )]
@@ -1315,7 +1395,7 @@ def UFormulasPruned(self, Usymbols=None):
13151395 List of atom displacement formulas in tuples of
13161396 ``(U11, U22, U33, U12, U13, U23)``.
13171397 """
1318- rv = [prune_formula_dictionary (eqns ) for eqns in self .UFormulas (Usymbols )]
1398+ rv = [prune_formula_dictionary (eqns ) for eqns in self .u_formulas (Usymbols )]
13191399 return rv
13201400
13211401
0 commit comments