Skip to content

test: use filename string instead of pathlib.Path to fix tests using diffpy.structure #128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 4, 2025

Conversation

ycexiao
Copy link
Contributor

@ycexiao ycexiao commented Aug 4, 2025

What problem does this issue address?

Fix tests involving diffpy.structure as mentioned in #90 (comment)

What should the reviewer(s) do?

Please check the modifications.

Copy link

github-actions bot commented Aug 4, 2025

Warning! No news item is found for this PR. If this is a user-facing
change/feature/fix,
please add a news item by copying the format from news/TEMPLATE.rst.
For best practices, please visit
https://scikit-package.github.io/scikit-package/frequently-asked-questions.html#billinge-group-standards.

Copy link

codecov bot commented Aug 4, 2025

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.99%. Comparing base (b94a3a9) to head (685e8d5).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
tests/test_pdf.py 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #128      +/-   ##
==========================================
- Coverage   67.05%   66.99%   -0.07%     
==========================================
  Files          25       25              
  Lines        3160     3163       +3     
==========================================
  Hits         2119     2119              
- Misses       1041     1044       +3     
Files with missing lines Coverage Δ
tests/test_pdf.py 43.29% <0.00%> (-0.69%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ycexiao ycexiao marked this pull request as ready for review August 4, 2025 19:15
@ycexiao
Copy link
Contributor Author

ycexiao commented Aug 4, 2025

@sbillinge, it's ready for review.

The "Check for News" failed because the branch was renamed. The correct news item was added in the PR.

Copy link
Contributor

@sbillinge sbillinge left a comment

Choose a reason for hiding this comment

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

please see comments

@@ -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

Copy link
Contributor Author

@ycexiao ycexiao left a comment

Choose a reason for hiding this comment

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

@sbillinge, it's ready for review.

@@ -160,7 +160,8 @@ def testGenerator(

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

Choose a reason for hiding this comment

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

renamed to cif_path

@@ -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")
cif_path = str(ciffile)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

renamed to cif_path

@sbillinge sbillinge merged commit a4efe0d into diffpy:main Aug 4, 2025
2 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants