-
Notifications
You must be signed in to change notification settings - Fork 20
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
add tests for diffraction methods #53
Comments
|
@sbillinge could you remove
from this issue? These are provided in this issue: #187 Also, if we could make a small distinction b/w the two issues via title, that would be great. |
Done. I also removed the methods that I think we are going to kill for making arrays from ranges. I couldn't come up with a good usecase for them because I think the stay had to be set by the y-array so I couldn't think of a time I would actually use that |
@sbillinge |
@sbillinge We have Does the following close this issue? This following code is implemented in the def test_all_array_getter():
actual_do = DiffractionObject(
xarray=np.array([0.0, 90.0, 180.0]),
yarray=np.array([1.0, 2.0, 3.0]),
xtype="tth",
wavelength=4.0 * np.pi,
)
expected_all_arrays = np.array(
[
[1.0, 0.0, 0.0, np.float64(np.inf)],
[2.0, 1.0 / np.sqrt(2), 90.0, np.sqrt(2) * 2 * np.pi],
[3.0, 1.0, 180.0, 1.0 * 2 * np.pi],
]
)
assert np.allclose(actual_do.all_arrays, expected_all_arrays)
def test_all_array_setter():
actual_do = DiffractionObject()
# Attempt to directly modify the property
with pytest.raises(
AttributeError,
match="Direct modification of attribute 'all_arrays' is not allowed. "
"Please use 'input_data' to modify 'all_arrays'.",
):
actual_do.all_arrays = np.empty((4, 4)) |
No description provided.
The text was updated successfully, but these errors were encountered: