Skip to content

Commit 0cad788

Browse files
fix: tweak TTH_GRID and add back check_and_build_global_config
1 parent 84d0e33 commit 0cad788

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/diffpy/labpdfproc/functions.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99

1010
RADIUS_MM = 1
1111
N_POINTS_ON_DIAMETER = 300
12-
TTH_GRID = np.round(np.arange(1, 180.1, 0.1), decimals=1)
12+
TTH_GRID = np.arange(1, 180.1, 0.1)
13+
# Round down the last element if it's slightly above 180 due to floating point precision
14+
TTH_GRID[-1] = 180
1315
CVE_METHODS = ["brute_force", "polynomial_interpolation"]
1416

1517
# pre-computed datasets for polynomial interpolation (fast calculation)

src/diffpy/labpdfproc/tools.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from pathlib import Path
33

44
from diffpy.utils.diffraction_objects import ANGLEQUANTITIES, QQUANTITIES, XQUANTITIES
5-
from diffpy.utils.tools import compute_mud, get_package_info, get_user_info
5+
from diffpy.utils.tools import check_and_build_global_config, compute_mud, get_package_info, get_user_info
66

77
WAVELENGTHS = {"Mo": 0.71, "Ag": 0.59, "Cu": 1.54}
88
known_sources = [key for key in WAVELENGTHS.keys()]
@@ -237,6 +237,7 @@ def load_user_info(args):
237237
the updated argparse Namespace with username and email inserted
238238
239239
"""
240+
check_and_build_global_config()
240241
config = get_user_info(owner_name=args.username, owner_email=args.email)
241242
args.username = config["owner_name"]
242243
args.email = config["owner_email"]

0 commit comments

Comments
 (0)