Skip to content

doc & test: copy examples over and add generator tests - #19

Merged
sbillinge merged 4 commits into
diffpy:mainfrom
cadenmyers13:pdf-tests-and-docs
Oct 27, 2026
Merged

sbillinge merged 4 commits into
diffpy:mainfrom
cadenmyers13:pdf-tests-and-docs

Conversation

@cadenmyers13

Copy link
Copy Markdown
Contributor

No description provided.

cadenmyers13 and others added 4 commits October 26, 2026 17:22
srfit 3.4.0 is on conda-forge, so CI no longer needs to pip install the
rc (reverts 000e71b). cmipdf calls methods that srfit 3.3.1 lacks (19 of
49 tests fail with it), so declare the lower bound in conda.txt and
pip.txt.

Closes diffpy#6.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
basepdfgenerator.py still built diffpy.srfit.structure parameter sets
with struToParameterSet and read .stru and .useSymmetry, so a
diffpy.cmistructure parameter set raised AttributeError: stru. Use
structure_to_parameter_set, .structure and use_symmetry from
diffpy.cmistructure, add it to pip.txt, and pip install it in CI until it
is on conda-forge. Tests cover both generators, PDFContribution, and
constrain_as_space_group taking a real PDFGenerator.

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

Port srfit's 11 PDF examples and their data to docs/examples with the
cmipdf and cmistructure imports. scipyOptimize came from srfit's
gaussianrecipe example, which is not a PDF example, so it now lives in
crystalpdf.py and the other examples import it from there. With srfit
3.4.0, each example gives the same Rw as srfit's original.

Replace the README placeholder description, fix the README CLI name
(diffpy-cmipdf), and remove the scikit-package template pages. Add tests
for DebyePDFGenerator, which nothing tested: its parameters, that it
treats structures as not periodic by default, and that it matches a
DebyePDFCalculator.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The examples ported from srfit define makeRecipe, makeProfile,
makeContribution, makeC60 and scipyOptimize. Rename them to make_recipe,
make_profile, make_contribution, make_c60 and scipy_optimize, including
the imports from crystalpdf and the comments that name them. All 11
examples still run with the same Rw.

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

Copy link
Copy Markdown
Contributor Author

@sbillinge ready for review, please merge #17 and #16 first as this is built on them

@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 97.00%. Comparing base (2b2ef8a) to head (dfbf8ca).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #19      +/-   ##
==========================================
+ Coverage   96.21%   97.00%   +0.79%     
==========================================
  Files           6        6              
  Lines         264      334      +70     
==========================================
+ Hits          254      324      +70     
  Misses         10       10              
Files with missing lines Coverage Δ
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.

@sbillinge
sbillinge merged commit ad702ea into diffpy:main Oct 27, 2026
6 checks passed
@cadenmyers13
cadenmyers13 deleted the pdf-tests-and-docs branch October 27, 2026 13:43
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