Skip to content

Conversation

@Sparks29032
Copy link
Collaborator

Very useful for experiments when you are interested in the difference signal. diffpy.morph has a very robust way of taking the difference on an intersecting grid as well

@codecov
Copy link

codecov bot commented Jul 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.12%. Comparing base (322b75e) to head (e8b888f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #237      +/-   ##
==========================================
+ Coverage   99.09%   99.12%   +0.03%     
==========================================
  Files          21       21              
  Lines        1104     1142      +38     
==========================================
+ Hits         1094     1132      +38     
  Misses         10       10              
Files with missing lines Coverage Δ
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 Sparks29032 marked this pull request as draft July 11, 2025 23:22
@Sparks29032 Sparks29032 marked this pull request as ready for review July 11, 2025 23:28
Copy link
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.

Nice! Please see comments. I can merge this if it helps you and we can return to the tweaks later too, just make issues in that case so I can close confident we won't forget


save: str or path
Save the morphed function to a the file passed to save. Use '-' for stdout.
get_diff: bool
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we want to do either/or here. A clearer logic would be that diff is saved if this is true, not saved if it is false, and also the case for the morph function. So TT would save both. To keep the API cleaner, we could have defaults of TF for morph and diff (the current behavior).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Got it, created #238 since I think we should have a discussion on this.

dest="get_diff",
action="store_true",
help=(
"Save the difference curve rather than the manipulated function.\n"
Copy link
Contributor

Choose a reason for hiding this comment

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

if we do update the logic, update this help here too.

"--rmin",
type="float",
help="Minimum r-value to use for PDF comparisons.",
help="Minimum r-value (abscissa) to use for function comparisons.",
Copy link
Contributor

Choose a reason for hiding this comment

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

"r" might be a bit confusing in our more general world of functions. Not sure what to change it to (and let's just make an issue, not do it on this PR0. "x" is widely used by scientists. "minimum value on the absisca" might be mathematically more correct? Anyway, just a note to make an issue.....

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep, I noted this in #236

"using a serial file NAMESFILE. The format of NAMESFILE should be "
"as follows: each target PDF is an entry in NAMESFILE. For each "
"entry, there should be a key {__save_morph_as__} whose value "
"specifies the name to save the manipulated PDF as. An example "
Copy link
Contributor

Choose a reason for hiding this comment

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

another issue to make as claning before release (not now) would be to do a global search for PDF and root it out wherever it survives. Like a weed......

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep, noted in #236, didn't want to do that now

@Sparks29032
Copy link
Collaborator Author

I created issues addressing these comments (yea, noticed there were a lot of PDF references still dangling, but didn't want to refactor all). I also put some more detailed notes on #238 about the either or approach.

@sbillinge sbillinge merged commit c4eba1e into diffpy:main Jul 12, 2025
5 checks passed
Sparks29032 added a commit to Sparks29032/diffpy.morph that referenced this pull request Jul 12, 2025
* Add save diff

* Add documentation

* Name change diff->get-diff
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