Skip to content

Commit

Permalink
Molecule and Crystal unit tests: always add the scattering power to t…
Browse files Browse the repository at this point in the history
…he Crystal before the scatterer
  • Loading branch information
vincefn committed Dec 19, 2021
1 parent 41b3e39 commit 58a97f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/pyobjcryst/tests/pyobjcrysttestutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def makeScattererAnisotropic():

def makeCrystal(sp, atom):
c = Crystal(3.52, 3.52, 3.52, "225")
c.AddScatterer(atom)
c.AddScatteringPower(sp)
c.AddScatterer(atom)
return c

def getScatterer():
Expand Down Expand Up @@ -138,6 +138,8 @@ def makeMnO6():
sp1.SetBiso(8*pi*pi*0.003)
sp2 = ScatteringPowerAtom("O", "O")
sp2.SetBiso(8*pi*pi*0.003)
crystal.AddScatteringPower(sp1)
crystal.AddScatteringPower(sp2)

m = MakeOctahedron(crystal, "MnO6", sp1, sp2, 0.5*a)

Expand Down
2 changes: 1 addition & 1 deletion src/pyobjcryst/tests/testcrystal.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def testRemoveFunctions(self):

# You can add scatterers with the same name. That should be a no-no.
sp2, atom2 = makeScatterer()
c.AddScatterer(atom2)
c.AddScatteringPower(sp2)
c.AddScatterer(atom2)

# These act according to the library. You can try to remove an object
# that is not in the crystal, and it will gladly do nothing for you.
Expand Down

0 comments on commit 58a97f6

Please sign in to comment.