Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE_DANSE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ For more information please visit the project web-page at

http://www.diffpy.org

or email Prof. Simon Billinge at sb2896@columbia.edu.
or email Prof. Simon Billinge at sbillinge@ucsb.edu.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down
2 changes: 1 addition & 1 deletion devutils/tunePeakPrecision.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"""

nickel = Structure()
nickel.readStr(nickel_discus_data, format="discus")
nickel.read_structure(nickel_discus_data, format="discus")


def Gpdffit2(qmax):
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/distanceprinter.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def _addPairContribution(self, bnds, sumscale):
"""

nickel = Structure()
nickel.readStr(nickel_discus_data, format="discus")
nickel.read_structure(nickel_discus_data, format="discus")

bucky = Structure(filename="datafiles/C60bucky.stru", format="discus")
distprint = DistancePrinter()
Expand Down
24 changes: 24 additions & 0 deletions news/fix-structure-deprecations.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**Added:**

* <news item>

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* Use ``Lattice.cell_parms`` in place of the deprecated ``Lattice.abcABG`` when converting ``diffpy.structure`` objects to silence deprecation warnings.
* Use ``load_structure``, ``get_parser``, ``parse_file``, ``read_structure``, ``set_latt_parms``, and ``add_new_atom`` in place of the deprecated ``diffpy.structure`` functions in tests, examples, and docstrings.

**Security:**

* <news item>
4 changes: 2 additions & 2 deletions src/diffpy/srreal/sfaverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
sfavg1 = SFAverage.fromComposition({'Na' : 1, 'Cl' : 1}, xtb, qa)
sfavg2 = SFAverage.fromComposition([('Mn', 1), ('O', 2)], xtb, qa)

from diffpy.structure import loadStructure
from diffpy.structure import load_structure
from diffpy.srreal.pdfcalculator import DebyePDFCalculator
dpdfc = DebyePDFCalculator()
dpdfc(loadStructure('rutile.cif'))
dpdfc(load_structure('rutile.cif'))
sfavg3 = SFAverage.fromStructure(dpdfc.getStructure(),
dpdfc.scatteringfactortable, dpdfc.qgrid)
"""
Expand Down
4 changes: 2 additions & 2 deletions src/diffpy/srreal/structureconverters.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
@RegisterStructureAdapter("diffpy.structure.structure.Structure")
def convertDiffPyStructure(stru):
"""Adapt Structure class from diffpy.structure package."""
haslattice = (1, 1, 1, 90, 90, 90) != stru.lattice.abcABG()
haslattice = (1, 1, 1, 90, 90, 90) != stru.lattice.cell_parms()
isperiodic = haslattice
hasmeta = _DiffPyStructureMetadata.hasMetadata(stru)
if hasmeta:
Expand Down Expand Up @@ -173,7 +173,7 @@ def _fetchDiffPyStructureData(adpt, stru):
aa.uij_cartn = a0.U
adpt.append(aa)
if hasattr(adpt, "setLatPar"):
adpt.setLatPar(*stru.lattice.abcABG())
adpt.setLatPar(*stru.lattice.cell_parms())
for aa in adpt:
adpt.toCartesian(aa)
return
Expand Down
2 changes: 1 addition & 1 deletion tests/test_bvscalculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_bvrmsdiff(self):
# check mixed occupancy
rutilemix = self.rutile.copy()
for a in self.rutile:
rutilemix.addNewAtom(a)
rutilemix.add_new_atom(a)
for a in rutilemix:
a.occupancy = 0.5
self.bvc(rutilemix)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_structureadapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_createStructureAdapterTypes(self):
self.nickel.pdffit = None
adpt1 = createStructureAdapter(self.nickel)
self.assertTrue(type(adpt1) is PeriodicStructureAdapter)
self.nickel.lattice.setLatPar(1, 1, 1, 90, 90, 90)
self.nickel.lattice.set_latt_parms(1, 1, 1, 90, 90, 90)
adpt2 = createStructureAdapter(self.nickel)
self.assertTrue(type(adpt2) is AtomicStructureAdapter)
self.nickel.pdffit = dict(scale=1)
Expand Down
8 changes: 4 additions & 4 deletions tests/testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
PeriodicStructureAdapter,
StructureAdapter,
)
from diffpy.structure.parsers import getParser
from diffpy.structure.parsers import get_parser

# helper functions

Expand All @@ -36,16 +36,16 @@ def loadObjCrystCrystal(filename):

def loadDiffPyStructure(filename):
fullpath = datafile(filename)
stru = mod_structure.loadStructure(fullpath)
stru = mod_structure.load_structure(fullpath)
return stru


def loadCrystalStructureAdapter(filename):
from diffpy.srreal.structureconverters import _fetchDiffPyStructureData

fullpath = datafile(filename)
pcif = getParser("cif")
stru = pcif.parseFile(fullpath)
pcif = get_parser("cif")
stru = pcif.parse_file(fullpath)
asu = stru[:0] + pcif.asymmetric_unit
adpt = CrystalStructureAdapter()
_fetchDiffPyStructureData(adpt, asu)
Expand Down
Loading