Skip to content

Commit 0b7a0f0

Browse files
fix: edited docstring and test comments based on UC1-2
1 parent d2d6371 commit 0b7a0f0

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

news/getmud.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
**Added:**
22

3-
* Functionalities to estimate sample mass density or capillary diameter from muD and related chemical info.
3+
* Functionalities to estimate sample mass density or capillary diameter from target muD and related chemical info.
44

55
**Changed:**
66

src/diffpy/labpdfproc/getmud.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66

77
def estimate_mass_density(mud, diameter, sample_composition, energy):
8-
"""Estimate sample mass density (g/cm^3) from mu*D
9-
using capillary diameter, sample composition, and energy.
8+
"""Estimate sample mass density (g/cm^3) from
9+
muD, capillary diameter, sample composition, and energy.
1010
1111
Parameters
1212
----------
@@ -46,7 +46,8 @@ def estimate_diameter(
4646
sample_mass_density=None,
4747
packing_fraction=None,
4848
):
49-
"""Estimate capillary diameter (mm) from mu*D and mu.
49+
"""Estimate capillary diameter (mm) from
50+
muD, sample composition, energy, and mass density/packing fraction.
5051
5152
Parameters
5253
----------

tests/test_getmud.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"mud": 2.0,
1212
"diameter": 1.5,
1313
"sample_composition": "ZrO2",
14-
"energy": 20,
14+
"energy": 17.45, # Mo K_alpha source
1515
},
16-
0.25,
16+
1.0751,
1717
),
1818
],
1919
)
@@ -36,16 +36,16 @@ def test_estimate_mass_density(inputs, expected_mass_density):
3636
{
3737
"mud": 2.0,
3838
"sample_composition": "ZrO2",
39-
"energy": 20,
40-
"sample_mass_density": 0.25,
39+
"energy": 17.45,
40+
"sample_mass_density": 1.20,
4141
},
42-
1.5,
42+
1.3439,
4343
),
4444
# ( # C2: user specifies a packing fraction
4545
# {
4646
# "mud": 2.0,
4747
# "sample_composition": "ZrO2",
48-
# "energy": 20,
48+
# "energy": 17.45,
4949
# "packing_fraction": 0.3
5050
# },
5151
# 1.5

0 commit comments

Comments
 (0)