Skip to content

Morphfuncxy #239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Aug 1, 2025
Merged

Morphfuncxy #239

merged 17 commits into from
Aug 1, 2025

Conversation

Sparks29032
Copy link
Collaborator

@Sparks29032 Sparks29032 commented Jul 12, 2025

Current being used at APS for applying pdfgetx3.

In progress:

  • More robust tests
  • Tutorial documentation
  • Change funcxy docstring example

Copy link

codecov bot commented Jul 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.22%. Comparing base (af80472) to head (783f6f7).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #239      +/-   ##
==========================================
+ Coverage   99.13%   99.22%   +0.08%     
==========================================
  Files          21       23       +2     
  Lines        1154     1285     +131     
==========================================
+ Hits         1144     1275     +131     
  Misses         10       10              
Files with missing lines Coverage Δ
tests/test_morph_func.py 100.00% <100.00%> (ø)
tests/test_morphfuncx.py 100.00% <100.00%> (ø)
tests/test_morphfuncxy.py 100.00% <100.00%> (ø)
tests/test_morphfuncy.py 100.00% <100.00%> (ø)
tests/test_morphpy.py 100.00% <100.00%> (ø)
tests/test_refine.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
Copy link
Contributor

lookin good

@Sparks29032 Sparks29032 marked this pull request as ready for review July 31, 2025 02:31
@Sparks29032
Copy link
Collaborator Author

Long PR, but a lot of the code has to be changed with the introduction of MorphFuncx, and we cannot test those changes without the implementation of MorphFuncx. As such, changes in non-MorphFuncx files are not put into a separate PR.

@Sparks29032
Copy link
Collaborator Author

Sparks29032 commented Jul 31, 2025

Force push to remove 3 accidental commits. See changes on the force push compare. Only updates should be merging with upstream main.

@Sparks29032
Copy link
Collaborator Author

Here's a breakdown of the changes in each of the files:

  • Documentation (docs/source/morphpy.rst): Added tutorial examples for MorphFuncx and MorphFuncxy.
  • News: Standard news updates
  • Source (src/diffpy/morph): Changed name of function parameter in the MorphFuncy function to funcy function.
    • morph_api.py: function -> funcy function
    • morph_io.py: Implement printing of MorphFuncx, MorphFuncxy morph outputs.
    • morphapp.py: Implement the MorphFuncx and MorphFuncxy functions.
    • morphpy.py: Implement the MorphFuncx and MorphFuncxy functions.
    • refine.py: The refiner originally assumes a fixed grid length. However, the MorphFuncx morph can shift and scale the grid. This behavior is desirable as the output grid may be vastly different from the original grid, so simply interpolating onto the new grid (what stretch, squeeze do) is insufficient. The MorphFuncx example in docs/source/morphpy.rst demonstrates this. New tests are added to tests/test_refine.py to check this.
    • morphs/morphrgrid.py: The morphed r-grid due to MorphFuncx may not have equal spacing. We adjust for that. Furthermore, while the previous implementation assumes the morph and target grids are fixed, we add new variables tagged _origin to account for the possibility of a dynamic grid. These satisfy previous tests in tests/test_morphrgrid.py. The new behavior is tested in the tests/test_morphfuncx.py tests as no other morphs will trigger this behavior.
  • New morphs (src/diffpy/morph/morphs): Implement new MorphFuncx, MorphFuncxy morphs.
  • New tests (tests): Mostly to test the new morphing functions in the CLI and Python implementations. Also some tests for the new refiner changes due to MorphFuncx.

@sbillinge
Copy link
Contributor

LGTM

@sbillinge sbillinge merged commit 6fdc0af into diffpy:main Aug 1, 2025
5 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