Skip to content

Refactor test_on_xtype() using @pytest.mark.parametrize and conftest.py #229

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
bobleesj opened this issue Dec 14, 2024 · 0 comments · Fixed by #231
Closed

Refactor test_on_xtype() using @pytest.mark.parametrize and conftest.py #229

bobleesj opened this issue Dec 14, 2024 · 0 comments · Fixed by #231

Comments

@bobleesj
Copy link
Contributor

bobleesj commented Dec 14, 2024

Problem

We have 2 PRs opened at the moment, working on the same file.

Once #228 is addressed and merged, refactor:

def test_on_xtype():
    do = DiffractionObject(wavelength=2 * np.pi, xarray=np.array([30, 60]), yarray=np.array([1, 2]), xtype="tth")
    assert np.allclose(do.on_xtype("tth"), [np.array([30, 60]), np.array([1, 2])])
    assert np.allclose(do.on_xtype("2theta"), [np.array([30, 60]), np.array([1, 2])])
    assert np.allclose(do.on_xtype("q"), [np.array([0.51764, 1]), np.array([1, 2])])
    assert np.allclose(do.on_xtype("d"), [np.array([12.13818, 6.28319]), np.array([1, 2])])

Ref: Continuing our in-line comment interactions from #225 (comment)

Proposed solutions

  • Use well defined reusable DO instances defined under contest.py
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 a pull request may close this issue.

1 participant