Skip to content

Commit b8811a3

Browse files
committed
fix self-test & improve docs
1 parent d6a3049 commit b8811a3

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

GSASII/GSASIIscriptable.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5588,16 +5588,22 @@ def addDistRestraint(self, origin, target, bond, factor=1.1, ESD=0.01):
55885588
return count
55895589

55905590
def Origin1to2Shift(self):
5591-
'''Applied an Origin 1 to Origin 2 shift to the selected phase
5591+
'''Applies an Origin 1 to Origin 2 shift to the selected phase,
5592+
if defined. Note that GSAS-II only uses Origin 2 settings when
5593+
both are offered in the International Tables.
5594+
(These are space groups where the centre of symmetry is not
5595+
at the highest symmetry site in the cell.)
5596+
If the structure is not in the Origin 1 setting,
5597+
this routine will create garbage.
55925598
55935599
A copy of the phase is made where the new phase name has the string
55945600
"_shifted" added to it. The routine returns a reference to the
55955601
new :class:`G2Phase` object for the new phase.
55965602
55975603
If the phase is not one of the space groups that has Origin 1 & Origin 2
5598-
settings, None is return.
5604+
settings, None is returned.
55995605
5600-
:returns: returns a newly created phase object or None
5606+
:returns: the newly created phase object or None
56015607
'''
56025608
gpx = self.proj
56035609
SGData = self.data['General']['SGData']

GSASII/imports/G2phase_RRUFF.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
import numpy as np
88
import random as ran
99
from .. import GSASIIobj as G2obj
10-
from .. import GSASIIspc as G2spc
11-
from .. import GSASIIlattice as G2lat
1210

1311
class PhaseReaderClass(G2obj.ImportPhase):
1412
'''A quickly-written importer to open a .txt file from the RRUFF database
@@ -45,6 +43,8 @@ def ContentsValidator(self, filename):
4543
def Reader(self,filename,ParentFrame=None, **unused):
4644
'Read a DIF file from RRUFF'
4745
#self.errors = 'Error opening file'
46+
from .. import GSASIIspc as G2spc
47+
from .. import GSASIIlattice as G2lat
4848
Title = ''
4949
atomsmode = False
5050
fp = open(filename, 'r')

docs/source/GSASIIscriptable.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ method Use
329329
:meth:`~GSASIIscriptable.G2Phase.clearDistRestraint` Clears any previously defined bond distance restraint(s) for the selected phase
330330
:meth:`~GSASIIscriptable.G2Phase.addDistRestraint` Finds and defines new bond distance restraint(s) for the selected phase
331331
:meth:`~GSASIIscriptable.G2Phase.setDistRestraintWeight` Sets the weighting factor for the bond distance restraints
332+
:meth:`~GSASIIscriptable.G2Phase.Origin1to2Shift` Shifts the atom coordinates from an Origin 1 setting to the Origin 2 setting
332333
======================================================== ===============================================================================================================
333334

334335
.. _Class_G2PwdrData:

0 commit comments

Comments
 (0)