Skip to content

Commit 17cf24a

Browse files
authored
clarify dimensionality checks for dimensionless units (thanks @AgnieszkaZaba for hint) (#1512)
1 parent 9079c1b commit 17cf24a

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

tests/smoke_tests/box/srivastava_1982/test_equations.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def test_eq10(self):
1717
m_e = eqs.eq10(m0=0.1 * si.kg / frag_mass, tau=eqs.tau(1 * si.s))
1818

1919
# assert
20-
assert m_e.check("[]")
20+
assert m_e.check(si.dimensionless)
2121

2222
def test_eq12(self):
2323
with DimensionalAnalysis():
@@ -30,7 +30,7 @@ def test_eq12(self):
3030
m_e = eqs.eq12()
3131

3232
# assert
33-
assert m_e.check("[]")
33+
assert m_e.check(si.dimensionless)
3434

3535
def test_eq13(self):
3636
with DimensionalAnalysis():
@@ -43,7 +43,7 @@ def test_eq13(self):
4343
m_e = eqs.eq13(m0=0.1 * si.kg / frag_mass, tau=eqs.tau(1 * si.s))
4444

4545
# assert
46-
assert m_e.check("[]")
46+
assert m_e.check(si.dimensionless)
4747

4848
def test_eq14(self):
4949
with DimensionalAnalysis():
@@ -55,4 +55,4 @@ def test_eq14(self):
5555
m_e = eqs.eq14()
5656

5757
# assert
58-
assert m_e.check("[]")
58+
assert m_e.check(si.dimensionless)

tests/unit_tests/physics/test_optical.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def test_albedo_unit(paper):
2424
albedo = formulae.optical_albedo.albedo(tau)
2525

2626
# assert
27-
assert albedo.check("[]")
27+
assert albedo.check(si.dimensionless)
2828

2929
@staticmethod
3030
@pytest.mark.parametrize(
@@ -44,4 +44,4 @@ def test_optical_depth_unit(paper):
4444
)
4545

4646
# assert
47-
assert tau.check("[]")
47+
assert tau.check(si.dimensionless)

tests/unit_tests/physics/test_particle_shape_and_density.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@ def test_reynolds_number(variant):
5757
)
5858

5959
# Assert
60-
assert re.check("[]")
60+
assert re.check(si.dimensionless)

tests/unit_tests/physics/test_trivia.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def test_schmidt_number():
7171
)
7272

7373
# Assert
74-
assert sc.check("[]")
74+
assert sc.check(si.dimensionless)
7575

7676
@staticmethod
7777
def test_poissonian_avoidance_function():
@@ -82,10 +82,10 @@ def test_poissonian_avoidance_function():
8282
sut = formulae.trivia.poissonian_avoidance_function
8383

8484
# Act
85-
sc = sut(
85+
prob = sut(
8686
r=1 / si.s,
8787
dt=10 * si.min,
8888
)
8989

9090
# Assert
91-
assert sc.check("[]")
91+
assert prob.check(si.dimensionless)

tests/unit_tests/physics/test_ventilation_coefficient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def test_dimensionality(variant):
2525
re = sut(sqrt_re_times_cbrt_sc=1 * si.dimensionless)
2626

2727
# Assert
28-
assert re.check("[]")
28+
assert re.check(si.dimensionless)
2929

3030
@staticmethod
3131
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)