Skip to content

Commit f311988

Browse files
committed
Fix insert_scattering_quantity to input data in all other files globally
1 parent 919c60b commit f311988

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/diffpy/utils/diffraction_objects.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def _xtype_wmsg(xtype):
2929
def _setter_wmsg(attribute):
3030
return (
3131
f"Direct modification of attribute '{attribute}' is not allowed. "
32-
f"Please use 'insert_scattering_quantity' to modify '{attribute}'.",
32+
f"Please use 'input_data' to modify '{attribute}'.",
3333
)
3434

3535

@@ -351,7 +351,7 @@ def input_data(
351351
if len(xarray) != len(yarray):
352352
raise ValueError(
353353
"'xarray' and 'yarray' must have the same length. "
354-
"Please re-initialize 'DiffractionObject' or re-run the method 'insert_scattering_quantity' "
354+
"Please re-initialize 'DiffractionObject' or re-run the method 'input_data' "
355355
"with 'xarray' and 'yarray' of identical length."
356356
)
357357

tests/test_diffraction_objects.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ def test_all_array_setter():
364364
with pytest.raises(
365365
AttributeError,
366366
match="Direct modification of attribute 'all_arrays' is not allowed. "
367-
"Please use 'insert_scattering_quantity' to modify 'all_arrays'.",
367+
"Please use 'input_data' to modify 'all_arrays'.",
368368
):
369369
actual_do.all_arrays = np.empty((4, 4))
370370

@@ -373,7 +373,7 @@ def test_xarray_yarray_length_mismatch():
373373
with pytest.raises(
374374
ValueError,
375375
match="'xarray' and 'yarray' must have the same length. "
376-
"Please re-initialize 'DiffractionObject' or re-run the method 'insert_scattering_quantity' "
376+
"Please re-initialize 'DiffractionObject' or re-run the method 'input_data' "
377377
"with 'xarray' and 'yarray' of identical length",
378378
):
379379
DiffractionObject(xarray=np.array([1.0, 2.0]), yarray=np.array([0.0, 0.0, 0.0]))
@@ -391,7 +391,7 @@ def test_input_xtype_setter():
391391
with pytest.raises(
392392
AttributeError,
393393
match="Direct modification of attribute 'input_xtype' is not allowed. "
394-
"Please use 'insert_scattering_quantity' to modify 'input_xtype'.",
394+
"Please use 'input_data' to modify 'input_xtype'.",
395395
):
396396
do.input_xtype = "q"
397397

0 commit comments

Comments
 (0)