Skip to content

fix: parse PDF metadata in PDFContribution.load_data - #12

Merged
sbillinge merged 2 commits into
diffpy:mainfrom
cadenmyers13:load-data-pdfparser
Oct 27, 2026
Merged

sbillinge merged 2 commits into
diffpy:mainfrom
cadenmyers13:load-data-pdfparser

Conversation

@cadenmyers13

Copy link
Copy Markdown
Contributor

load_data in pdfcontribution.py used ProfileParser, so the stype and qmax in a NOMAD file's free-text comment header were lost and get_scattering_type and get_qmax returned None. Use PDFParser, as diffpy.srfit does, and fix the docstring's parameter name.

cadenmyers13 and others added 2 commits October 26, 2026 17:29
load_data in pdfcontribution.py used ProfileParser, so the stype and
qmax in a NOMAD file's free-text comment header were lost and
get_scattering_type and get_qmax returned None. Use PDFParser, as
diffpy.srfit does, and fix the docstring's parameter name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The use-cmistructure branch also appends tests to the end of
test_pdfcontribution.py, so the two PRs conflicted. Putting the load_data
tests next to the other metadata tests avoids that.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cadenmyers13

Copy link
Copy Markdown
Contributor Author

@sbillinge ready for review

@codecov

codecov Bot commented Oct 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.29%. Comparing base (2b2ef8a) to head (e56c71a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #12      +/-   ##
==========================================
+ Coverage   96.21%   96.29%   +0.08%     
==========================================
  Files           6        6              
  Lines         264      270       +6     
==========================================
+ Hits          254      260       +6     
  Misses         10       10              
Files with missing lines Coverage Δ
tests/test_pdfcontribution.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sbillinge
sbillinge merged commit fcb9abb into diffpy:main Oct 27, 2026
6 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