Skip to content

refactor: use a more flexible interface to utilize diffpy.srfit - #31

Draft
ycexiao wants to merge 12 commits into
diffpy:mainfrom
ycexiao:refinement
Draft

refactor: use a more flexible interface to utilize diffpy.srfit#31
ycexiao wants to merge 12 commits into
diffpy:mainfrom
ycexiao:refinement

Conversation

@ycexiao

@ycexiao ycexiao commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR address?

Use a more flexible interface to utilize diffpy.srfit

What should the reviewer(s) do?

)


def test_refinement_session():

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@sbillinge Could you please review the function signatures we have now? If there aren't any issues, I'll continue working on making the tests pass.

@sbillinge sbillinge left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this seems like a good start. It is a bit hard to know what else we will need until we start using it (or the agent does)


def test_refine_sine():
# C1: Refinement session without additional calculator or functions
session = RefinementSession()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@sbillinge Please see this new interaction logic with ParametricModel.

I thought it couldn't be more straightforward and simpler. But if it could, could you please add some pseudo-code here so I can implement it?

ni_model.parameters["ni_model.s"].value = 1.0

session = RefinementSession()
session.solve(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

constraints have not been implemented, so value check is not added.

@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.30%. Comparing base (680a3d5) to head (30c3040).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #31      +/-   ##
==========================================
+ Coverage   94.14%   96.30%   +2.15%     
==========================================
  Files           5        8       +3     
  Lines         188      298     +110     
==========================================
+ Hits          177      287     +110     
  Misses         11       11              
Files with missing lines Coverage Δ
tests/conftest.py 76.31% <100.00%> (+40.60%) ⬆️
tests/test_parametric_model.py 100.00% <100.00%> (ø)
tests/test_refinement_server.py 100.00% <100.00%> (ø)
tests/test_refinement_session.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

3 participants