Skip to content

Add uncertainties for main parameters.#299

Open
Sparks29032 wants to merge 6 commits into
diffpy:mainfrom
Sparks29032:covariance
Open

Add uncertainties for main parameters.#299
Sparks29032 wants to merge 6 commits into
diffpy:mainfrom
Sparks29032:covariance

Conversation

@Sparks29032
Copy link
Copy Markdown
Collaborator

@Sparks29032 Sparks29032 commented Apr 24, 2026

Closes #300

Need tests for warnings and each parameter separately (including baselineslope).

Need special handling for squeeze and func[x/y/xy] morph parameters.

image

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.93%. Comparing base (fc45fa1) to head (001feb4).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #299   +/-   ##
=======================================
  Coverage   99.93%   99.93%           
=======================================
  Files          24       24           
  Lines        1480     1523   +43     
=======================================
+ Hits         1479     1522   +43     
  Misses          1        1           
Files with missing lines Coverage Δ
tests/test_morphapp.py 100.00% <ø> (ø)
tests/test_morphio.py 100.00% <100.00%> (ø)
tests/test_morphpy.py 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Sparks29032
Copy link
Copy Markdown
Collaborator Author

Sparks29032 commented May 11, 2026

Case where all parameters have uncertainties:
image

Case where certain parameters cause the Hessian to turn singular:
image

Tests and documentation updated. Ready to merge after review.

@Sparks29032
Copy link
Copy Markdown
Collaborator Author

Oops, previous one I ran only one of the tests I thought would be affected... fixed now.

@Sparks29032
Copy link
Copy Markdown
Collaborator Author

image

Loosened tolerance for checking numerics match. New algorithms and updates to old ones can cause some deviation (e.g. works on one of our tests on PR workflows but not others).

@Sparks29032 Sparks29032 marked this pull request as ready for review May 11, 2026 06:17
Copy link
Copy Markdown
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.

looks great. One inline comment.

Comment thread src/diffpy/morph/morph_io.py Outdated
f"# {param} = {morph_results[target][param]:.6f}"
for param in morph_results[target]
)
# output += "# Optimized morphing parameters:\n"
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.

are you retaining these lines for some reason? If yes, state the reason and when they can be removed, and if not, then just remove them.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ah, thanks. I left that there as reference for a different approach originally.

@Sparks29032
Copy link
Copy Markdown
Collaborator Author

@sbillinge Removed the stray comment.

Since pre-commit isn't working on here (we will address by #301 hopefully), this screenshot is just to confirm it is passing it locally.
image

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.

Add option to see uncertainties

2 participants