Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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/use-string-in-structure
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* No news added: Use filename string instead of pathlib.Path to fix the test using ``diffpy.structure``.

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
5 changes: 4 additions & 1 deletion tests/test_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def testGenerator(

stru = PDFFitStructure()
ciffile = datafile("ni.cif")
ciffile = str(ciffile)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's change the variable name to cif_path.

Please can you also make an issue on diffpy.structure to have loadStructure accept pathlib.Path or string, i.e., any valid path object.?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please can you also make an issue on diffpy.structure to have loadStructure accept pathlib.Path or string, i.e., any valid path object.?

Yes, there was already an issue diffpy/diffpy.structure#124

stru.read(ciffile)
for i in range(4):
stru[i].Bisoequiv = 1
Expand Down Expand Up @@ -298,7 +299,9 @@ def test_pickling(

pc = PDFContribution("pdf")
pc.loadData(datafile("ni-q27r100-neutron.gr"))
ni = loadStructure(datafile("ni.cif"))
ciffile = datafile("ni.cif")
ciffile = str(ciffile)
ni = loadStructure(ciffile)
ni.Uisoequiv = 0.003
pc.addStructure("ni", ni)
pc.setCalculationRange(0, 10)
Expand Down
Loading