-
Notifications
You must be signed in to change notification settings - Fork 11
add private function for initating DO #81
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it still seems a bit hard to read. Also the numbers in the yarray are fairly irrational
@@ -56,27 +56,29 @@ def test_set_muls_at_angle(inputs, expected): | |||
assert actual_muls_sorted == pytest.approx(expected_muls_sorted, rel=1e-4, abs=1e-6) | |||
|
|||
|
|||
def test_compute_cve(mocker): | |||
def _instantiate_test_do(mocker, yarray, name="test", scat_quantity="x-ray"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you pass everything in we don't gain much. Are there cases where you want to vary name="test", scat_quantity="x-ray" etc?
I would make yarray a required arg too to make the code more readable.
Also, is it necessary to pass in mocker? It may be, but if not I don't think it adds much syntatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I couldn't find prettier numbers for the yarrays.. they all seem a bit messy.
The name and scat_quantity are for the absorption correction DOs.
I can remove the mocker, it's not needed there.
I gave some. uncorrected [2,2,2] correction [0.5,0.5,0.5], corrected
[1,1,1]
…On Thu, Jun 20, 2024 at 4:36 PM Yucong (Alice) Chen < ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/diffpy/labpdfproc/tests/test_functions.py
<#81 (comment)>
:
> @@ -56,27 +56,29 @@ def test_set_muls_at_angle(inputs, expected):
assert actual_muls_sorted == pytest.approx(expected_muls_sorted, rel=1e-4, abs=1e-6)
-def test_compute_cve(mocker):
+def _instantiate_test_do(mocker, yarray, name="test", scat_quantity="x-ray"):
Yeah I couldn't find prettier numbers for the yarrays.. they all seem a
bit messy.
The name and scat_quantity are for the absorption correction DOs.
I can remove the mocker, it's not needed there.
—
Reply to this email directly, view it on GitHub
<#81 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABAOWUN6GFIZFWDJLWDVSNLZIM4MNAVCNFSM6AAAAABJUNK43WVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDCMZRGMYDMMJSHA>
.
You are receiving this because you commented.Message ID: <diffpy/diffpy.
***@***.***>
--
Simon Billinge
Professor,
Department of Applied Physics and Applied Mathematics
Columbia University
|
I added tests for apply_corr here too. It seems that I can write another private function for the setup to simplify (mocker, input pattern, etc.)..? |
addressing #80