Skip to content

Commit b91b6ec

Browse files
change cwd path from os to pathlib
1 parent 4bbe4a2 commit b91b6ec

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/diffpy/labpdfproc/functions.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import math
2-
import os
2+
from pathlib import Path
33

44
import numpy as np
55
import pandas as pd
@@ -12,11 +12,11 @@
1212
TTH_GRID = np.arange(1, 180.1, 0.1)
1313
CVE_METHODS = ["brute_force", "polynomial_interpolation"]
1414

15-
# pre-computed datasets for fast calculation
15+
# pre-computed datasets for polynomial interpolation (fast calculation)
1616
MUD_LIST = [0.5, 1, 2, 3, 4, 5, 6]
17-
CWD = os.path.dirname(os.path.abspath(__file__))
18-
MULS = np.loadtxt(CWD + "/data/inverse_cve.xy")
19-
COEFFICIENT_LIST = np.array(pd.read_csv(CWD + "/data/coefficient_list.csv", header=None))
17+
CWD = Path(__file__).parent.resolve()
18+
MULS = np.loadtxt(CWD / "data" / "inverse_cve.xy")
19+
COEFFICIENT_LIST = np.array(pd.read_csv(CWD / "data" / "coefficient_list.csv", header=None))
2020
INTERPOLATION_FUNCTIONS = [interp1d(MUD_LIST, coefficients, kind="quadratic") for coefficients in COEFFICIENT_LIST]
2121

2222

0 commit comments

Comments
 (0)