Skip to content

chore: sync code with srfit 3.4.0 - #5

Merged
sbillinge merged 7 commits into
diffpy:mainfrom
cadenmyers13:sync-srfit-3.4.0
Oct 16, 2026
Merged

sbillinge merged 7 commits into
diffpy:mainfrom
cadenmyers13:sync-srfit-3.4.0

Conversation

@cadenmyers13

Copy link
Copy Markdown
Contributor

Carry over edits on diffpy.srfit 3.4.0 to the PDF pack

cadenmyers13 and others added 5 commits October 16, 2026 10:16
Port the srfit changes to pdf/ made since cmipdf was copied (#217,
#225, #228, #229):

- basepdfgenerator.py, pdfcontribution.py, characteristicfunctions.py:
  call add_parameter/new_parameter instead of the deprecated
  addParameter/newParameter, and set scatteringfactortable instead of
  calling setScatteringFactorTableByType.
- characteristicfunctions.py, pdfparser.py: fix docstrings that did not
  render (literal blocks for the lognormal formulas, list spacing).
- Tests: get_value, load_structure and scatteringfactortable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Match the diffpy.srfit test style already used in test_pdfparser.py:

- test_generators.py: split testGenerator into one test per behavior,
  with parametrized C1/Expected cases for the scattering type and each
  wrapped calculator Parameter, and actual_/expected_ names.
- test_pdfcontribution.py: same style; split get_qmax by where qmax is
  found, check the exact savetxt error, and compare the pickled
  residual after a Uiso change against a freshly built contribution
  instead of an "is different" guard.
- conftest.py: remove the unused skip-if-missing fixtures and add an
  ni_pdffit_structure fixture.

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

codecov Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.60%. Comparing base (c7bdc5f) to head (de9531f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main       #5      +/-   ##
==========================================
+ Coverage   87.11%   95.60%   +8.49%     
==========================================
  Files           5        5              
  Lines         194      205      +11     
==========================================
+ Hits          169      196      +27     
+ Misses         25        9      -16     
Files with missing lines Coverage Δ
tests/conftest.py 72.72% <100.00%> (+20.80%) ⬆️
tests/test_generators.py 100.00% <100.00%> (ø)
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.

@cadenmyers13

Copy link
Copy Markdown
Contributor Author

@sbillinge ready for review/merge. I pinned the srfit version to the rc version in CI so tests pass for now. I added an issue to remove it later.

cadenmyers13 and others added 2 commits October 16, 2026 13:08
- pyproject.toml: point the diffpy-cmipdf entry point at cmipdf_app:main
  (app.py does not exist), support Python 3.12-3.13 only (diffpy.srreal
  has no 3.14 build, and 3.11 is below srfit's minimum), and fail tests
  when cmipdf calls its own deprecated names, matching srfit.
- cookiecutter.json: minimum Python 3.12.
- docs: replace the template API page with the cmipdf modules, and use
  m2r2 instead of the unmaintained m2r.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Set requires-python, the classifiers and cookiecutter.json to
3.11-3.13, matching the other diffpy.cmi* packages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sbillinge
sbillinge merged commit 4b8c07d into diffpy:main Oct 16, 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