Skip to content

Commit c7b1f60

Browse files
authored
Merge pull request #154 from Sparks29032/explicit_paths
Fix tools diffpy.utils paths
2 parents 8595c1f + 7ab7e6f commit c7b1f60

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

Diff for: news/explicit_paths.rst

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* <news item>
4+
5+
**Changed:**
6+
7+
* Paths to diffpy.utils.parsers functions made explicitly to the file level.
8+
9+
**Deprecated:**
10+
11+
* <news item>
12+
13+
**Removed:**
14+
15+
* <news item>
16+
17+
**Fixed:**
18+
19+
* <news item>
20+
21+
**Security:**
22+
23+
* <news item>

Diff for: src/diffpy/pdfmorph/tools.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,8 @@ def readPDF(fname):
116116
r,gr
117117
Arrays read from data.
118118
"""
119-
from diffpy.utils.parsers import loadData
120119

121-
rv = loadData(fname, unpack=True)
120+
rv = parsers.loaddata.loadData(fname, unpack=True)
122121
if len(rv) >= 2:
123122
return rv[:2]
124123
return (None, None)
@@ -146,7 +145,7 @@ def deserialize(serial_file):
146145
dict
147146
Data read from serial file.
148147
"""
149-
return parsers.deserialize_data(serial_file)
148+
return parsers.serialization.deserialize_data(serial_file)
150149

151150

152151
def case_insensitive_dictionary_search(key: str, dictionary: dict):
@@ -200,11 +199,11 @@ def field_sort(filepaths: list, field, reverse=False, serfile=None, get_field_va
200199
files_field_values = []
201200
if serfile is None:
202201
for path in filepaths:
203-
fhd = parsers.loadData(path, headers=True)
202+
fhd = parsers.loaddata.loadData(path, headers=True)
204203
files_field_values.append([path, case_insensitive_dictionary_search(field, fhd)])
205204
else:
206205
# deserialize the serial file
207-
des_dict = parsers.deserialize_data(serfile)
206+
des_dict = parsers.serialization.deserialize_data(serfile)
208207

209208
# get names of each file to search the serial file
210209
import pathlib

0 commit comments

Comments
 (0)