Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions news/explicit_paths.rst
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* Paths to diffpy.utils.parsers functions made explicitly to the file level.

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
9 changes: 4 additions & 5 deletions src/diffpy/pdfmorph/tools.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -116,9 +116,8 @@ def readPDF(fname):
r,gr
Arrays read from data.
"""
from diffpy.utils.parsers import loadData

rv = loadData(fname, unpack=True)
rv = parsers.loaddata.loadData(fname, unpack=True)
if len(rv) >= 2:
return rv[:2]
return (None, None)
Expand DownExpand Up@@ -146,7 +145,7 @@ def deserialize(serial_file):
dict
Data read from serial file.
"""
return parsers.deserialize_data(serial_file)
return parsers.serialization.deserialize_data(serial_file)


def case_insensitive_dictionary_search(key: str, dictionary: dict):
Expand DownExpand Up@@ -200,11 +199,11 @@ def field_sort(filepaths: list, field, reverse=False, serfile=None, get_field_va
files_field_values = []
if serfile is None:
for path in filepaths:
fhd = parsers.loadData(path, headers=True)
fhd = parsers.loaddata.loadData(path, headers=True)
files_field_values.append([path, case_insensitive_dictionary_search(field, fhd)])
else:
# deserialize the serial file
des_dict = parsers.deserialize_data(serfile)
des_dict = parsers.serialization.deserialize_data(serfile)

# get names of each file to search the serial file
import pathlib
Expand Down