Skip to content

Commit 06dcfcc

Browse files
committed
update deprecate loadData with load_data
1 parent 1ae2926 commit 06dcfcc

3 files changed

Lines changed: 14 additions & 14 deletions

File tree

docs/source/examples/functions-example.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ For example, if you want to load data from ``zro2_mo.xy`` in the ``example-data`
1313

1414
.. code-block:: python
1515
16-
from diffpy.utils.parsers.loaddata import loadData
16+
from diffpy.utils.parsers import load_data
1717
from diffpy.utils.diffraction_objects import DiffractionObject
1818
1919
filepath = "../example-data/zro2_mo.xy"
20-
xarray, yarray = loadData(filepath, unpack=True)
20+
xarray, yarray = load_data(filepath, unpack=True)
2121
input_pattern = DiffractionObject(
2222
xarray=xarray,
2323
yarray=yarray,

src/diffpy/labpdfproc/labpdfprocapp.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
set_wavelength,
1313
)
1414
from diffpy.utils.diffraction_objects import XQUANTITIES, DiffractionObject
15-
from diffpy.utils.parsers.loaddata import loadData
15+
from diffpy.utils.parsers import load_data
1616

1717

1818
def _add_common_args(parser, use_gui=False):
@@ -139,7 +139,7 @@ def _save_correction(correction, input_path, args):
139139

140140

141141
def _load_pattern(path, xtype, wavelength, metadata):
142-
x, y = loadData(path, unpack=True)
142+
x, y = load_data(path, unpack=True)
143143
return DiffractionObject(
144144
xarray=x,
145145
yarray=y,
@@ -264,8 +264,8 @@ def create_parser(use_gui=False):
264264

265265

266266
def _handle_old_api_conversion(args):
267-
"""Convert `sample` command arguments to previous format so functions can
268-
accept them without modification."""
267+
"""Convert `sample` command arguments to previous format so
268+
functions can accept them without modification."""
269269
if args.command == "sample":
270270
# Convert sample args to theoretical_from_density format
271271
args = load_wavelength_from_config_file(args)

tests/test_fixtures.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
import pytest
44

5-
from diffpy.utils.parsers.loaddata import loadData
5+
from diffpy.utils.parsers import load_data
66

77

88
# Test that our readable and unreadable files are indeed readable and
9-
# unreadable by loadData (which is our definition of readable and unreadable)
10-
def test_loadData_with_input_files(user_filesystem):
9+
# unreadable by load_data (which is our definition of readable and unreadable)
10+
def test_load_data_with_input_files(user_filesystem):
1111
os.chdir(user_filesystem)
12-
xarray_chi, yarray_chi = loadData("good_data.chi", unpack=True)
13-
xarray_xy, yarray_xy = loadData("good_data.xy", unpack=True)
14-
xarray_txt, yarray_txt = loadData("good_data.txt", unpack=True)
12+
xarray_chi, yarray_chi = load_data("good_data.chi", unpack=True)
13+
xarray_xy, yarray_xy = load_data("good_data.xy", unpack=True)
14+
xarray_txt, yarray_txt = load_data("good_data.txt", unpack=True)
1515
with pytest.raises(ValueError):
16-
xarray_txt, yarray_txt = loadData("unreadable_file.txt", unpack=True)
16+
xarray_txt, yarray_txt = load_data("unreadable_file.txt", unpack=True)
1717
with pytest.raises(ValueError):
18-
xarray_pkl, yarray_pkl = loadData("binary.pkl", unpack=True)
18+
xarray_pkl, yarray_pkl = load_data("binary.pkl", unpack=True)

0 commit comments

Comments
 (0)