Skip to content

Conversation

@ycexiao
Copy link
Collaborator

@ycexiao ycexiao commented Sep 15, 2025

What problem does this PR address?

Address issues mentioned in #243

  1. Detect extrapolation in morphstretch.
  2. Add tests for extrapolation warnings.

What should the reviewer(s) do?

Please check the modifications.

ycexiao

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Sep 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.92%. Comparing base (2e5391d) to head (0fa73ff).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #258   +/-   ##
=======================================
  Coverage   99.92%   99.92%           
=======================================
  Files          23       24    +1     
  Lines        1355     1398   +43     
=======================================
+ Hits         1354     1397   +43     
  Misses          1        1           
Files with missing lines Coverage Δ
tests/helper.py 100.00% <100.00%> (ø)
tests/test_morphshift.py 100.00% <100.00%> (ø)
tests/test_morphsqueeze.py 100.00% <100.00%> (ø)
tests/test_morphstretch.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ycexiao ycexiao marked this pull request as ready for review September 15, 2025 21:26
@ycexiao
Copy link
Collaborator Author

ycexiao commented Sep 15, 2025

@sbillinge @Sparks29032, it's ready for review.

@Sparks29032
Copy link
Collaborator

Tests lgtm

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.

just a couple of comments, but otherwise lgtm

tests/helper.py Outdated
def create_morph_data_file(
data_dir_path, x_morph, y_morph, x_target, y_target
):
morph_file = data_dir_path / "morph_data"
Copy link
Contributor

Choose a reason for hiding this comment

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

do these files end up having an extension? If they are text files maybe make them .txt? But I am not 100% sure what is going on so please advise if I am off base here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These files do not end with an extension. This helper function create these files in tmp_dir to facilitate CLI testing when test_func has the corresponding data. I will add the extension ".txt" to make the implementation more explicit.

tests/helper.py Outdated
]
morph_data_text = "\n".join(morph_data_text)
morph_file.write_text(morph_data_text)
target_file = data_dir_path / "target_data"
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

Copy link
Collaborator Author

@ycexiao ycexiao left a comment

Choose a reason for hiding this comment

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

@sbillinge, it's ready for review.

def create_morph_data_file(
data_dir_path, x_morph, y_morph, x_target, y_target
):
morph_file = data_dir_path / "morph_data.txt"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

.txt extension added.

@ycexiao
Copy link
Collaborator Author

ycexiao commented Sep 17, 2025

@sbillinge, it's ready for review.

@sbillinge sbillinge merged commit ddfa6fe into diffpy:main Sep 19, 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.

3 participants