Skip to content

tests for apply_corr #80

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

Closed
wants to merge 1 commit into from
Closed

Conversation

yucongalicechen
Copy link
Collaborator

closes #19
@sbillinge I saw that you assigned this to yourself but I thought I could just do it conveniently by following the tests for compute_cve

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.

please see inline

@@ -80,3 +80,39 @@ def test_compute_cve(mocker):
scat_quantity="cve",
)
assert actual_abdo == expected_abdo


def test_apply_corr(mocker):
Copy link
Contributor

Choose a reason for hiding this comment

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

this test is probably correct but hard to follow.

  1. there is a lot of duplicated code instantiating the DO's so maybe make a helper function called something like _instantiate_test_do(yarray) and just call that with only the y-array as input
  2. maybe make the inputs easier to understand, so input y-array is [2., 2., 2.] and correction is [0.5, 0.5, 0.5] and so expected is a do with yarray [1., 1., 1.].

Would these make it easier to read?

If you make that wrapper function, on a separate PR we can maybe clean up some of the other tests as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sounds good, I'll do that

@yucongalicechen
Copy link
Collaborator Author

closed by #81

@yucongalicechen yucongalicechen deleted the corr branch June 21, 2024 22:41
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.

test for apply_corr() in functions.py
2 participants