Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 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
23 changes: 23 additions & 0 deletions news/deprecate-camel-case-1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* No News Added: deprecate CamelCase function for structure.py

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
1 change: 1 addition & 0 deletions requirements/conda.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
numpy
pycifrw
diffpy.utils
1 change: 1 addition & 0 deletions requirements/pip.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
numpy
pycifrw
diffpy.utils
4 changes: 2 additions & 2 deletions src/diffpy/structure/apps/transtru.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ def main():
strufile = args[1]
stru = Structure()
if args[1] == "-":
stru.readStr(sys.stdin.read(), infmt)
stru.read_str(sys.stdin.read(), infmt)
else:
stru.read(strufile, infmt)
sys.stdout.write(stru.writeStr(outfmt))
sys.stdout.write(stru.write_str(outfmt))
except IndexError:
print("strufile not specified", file=sys.stderr)
sys.exit(2)
Expand Down
4 changes: 2 additions & 2 deletions src/diffpy/structure/parsers/p_cif.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,8 @@ def _parse_atom_site_label(self, block):
if curlabel == "?":
continue
self.labelindex[curlabel] = len(self.stru)
self.stru.addNewAtom()
a = self.stru.getLastAtom()
self.stru.add_new_atom()
a = self.stru.get_last_atom()
for fset, val in zip(prop_setters, values):
fset(a, val)
if does_adp_type:
Expand Down
4 changes: 2 additions & 2 deletions src/diffpy/structure/parsers/p_discus.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,8 @@ def _parse_atom(self, words):
element = words[0][0:1].upper() + words[0][1:].lower()
xyz = [float(w) for w in words[1:4]]
Biso = float(words[4])
self.stru.addNewAtom(element, xyz)
a = self.stru.getLastAtom()
self.stru.add_new_atom(element, xyz)
a = self.stru.get_last_atom()
a.Bisoequiv = Biso
return

Expand Down
4 changes: 2 additions & 2 deletions src/diffpy/structure/parsers/p_pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ def parseLines(self, lines):
# get element from the first 2 characters of name
element = line[12:14].strip()
element = element[0].upper() + element[1:].lower()
stru.addNewAtom(element, occupancy=occupancy, label=name)
last_atom = stru.getLastAtom()
stru.add_new_atom(element, occupancy=occupancy, label=name)
last_atom = stru.get_last_atom()
last_atom.xyz_cartn = rc
last_atom.Uisoequiv = uiso
elif record == "SIGATM":
Expand Down
6 changes: 3 additions & 3 deletions src/diffpy/structure/parsers/p_pdffit.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ def parseLines(self, lines):
element = wl1[0][0].upper() + wl1[0][1:].lower()
xyz = [float(w) for w in wl1[1:4]]
occ = float(wl1[4])
stru.addNewAtom(element, xyz=xyz, occupancy=occ)
a = stru.getLastAtom()
stru.add_new_atom(element, xyz=xyz, occupancy=occ)
a = stru.get_last_atom()
p_nl += 1
wl2 = next(ilines).split()
a.sigxyz = [float(w) for w in wl2[0:3]]
Expand Down Expand Up @@ -169,7 +169,7 @@ def parseLines(self, lines):
if stru.pdffit["ncell"][:3] != [1, 1, 1]:
superlatpars = [latpars[i] * stru.pdffit["ncell"][i] for i in range(3)] + latpars[3:]
superlattice = Lattice(*superlatpars)
stru.placeInLattice(superlattice)
stru.place_in_lattice(superlattice)
stru.pdffit["ncell"] = [1, 1, 1, p_natoms]
except (ValueError, IndexError):
emsg = "%d: file is not in PDFfit format" % p_nl
Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/structure/parsers/p_rawxyz.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def parseLines(self, lines):
xyz = [float(f) for f in fields[x_idx : x_idx + 3]]
if len(xyz) == 2:
xyz.append(0.0)
stru.addNewAtom(element, xyz=xyz)
stru.add_new_atom(element, xyz=xyz)
except ValueError:
emsg = "%d: invalid number" % p_nl
exc_type, exc_value, exc_traceback = sys.exc_info()
Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/structure/parsers/p_xcfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def parseLines(self, lines):
elif len(words) == xcfg_entry_count and p_element is not None:
fields = [float(w) for w in words]
xyz = [xcfg_A * xi for xi in fields[:3]]
stru.addNewAtom(p_element, xyz=xyz)
stru.add_new_atom(p_element, xyz=xyz)
a = stru[-1]
_assign_auxiliaries(
a,
Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/structure/parsers/p_xyz.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def parseLines(self, lines):
element = fields[0]
element = element[0].upper() + element[1:].lower()
xyz = [float(f) for f in fields[1:4]]
stru.addNewAtom(element, xyz=xyz)
stru.add_new_atom(element, xyz=xyz)
except ValueError:
exc_type, exc_value, exc_traceback = sys.exc_info()
emsg = "%d: invalid number format" % p_nl
Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/structure/pdffitstructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def readStr(self, s, format="auto"):
StructureParser
Instance of `StructureParser` used to load the data.
"""
p = Structure.readStr(self, s, format)
p = Structure.read_str(self, s, format)
sg = getattr(p, "spacegroup", None)
if sg:
self.pdffit["spcgr"] = sg.short_name
Expand Down
Loading
Loading