Skip to content

Commit

Permalink
Updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vyrjana committed Oct 27, 2024
1 parent f6ed120 commit 2c13b80
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
6 changes: 3 additions & 3 deletions tests/test_drt.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def test_result_to_peaks_dataframe(self):

md: str = df.to_markdown(index=False)
lines: List[str] = [line for line in md.split("\n") if line.strip() != ""]
self.assertEqual(len(lines), 5)
self.assertGreaterEqual(len(lines), 4)

def test_result_get_drt_data(self):
time_constants_RC: TimeConstants
Expand Down Expand Up @@ -219,8 +219,8 @@ def test_result_get_gammas(self):
self.assertEqual(len(gammas), 2)

gammas_RC, gammas_RL = gammas
self.assertGreaterEqual(gammas_RC.shape, (3,))
self.assertGreaterEqual(gammas_RL.shape, (2,))
self.assertGreaterEqual(gammas_RC.shape, (2,))
self.assertGreaterEqual(gammas_RL.shape, (1,))
self.assertEqual(gammas_RC.dtype, Gamma)
self.assertEqual(gammas_RL.dtype, Gamma)

Expand Down
20 changes: 4 additions & 16 deletions tests/test_fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,19 +545,19 @@ def test_fit_identifiers(self):
constraint_variables=dict(
alpha=dict(
value=500,
min=0,
min=1,
),
beta=dict(
value=300,
min=0,
min=1,
),
gamma=dict(
value=1e-8,
min=0,
min=1e-12,
),
delta=dict(
value=2e-7,
min=0,
min=1e-12,
),
),
)
Expand All @@ -569,15 +569,3 @@ def test_fit_identifiers(self):
self.assertLess(R4.get_value("R"), R3.get_value("R"))
self.assertLess(Q1.get_value("Y"), Q2.get_value("Y"))
self.assertLess(Q2.get_value("Y"), Q3.get_value("Y"))

# Make sure the values are as expected
self.assertAlmostEqual(R1.get_value("R"), 143, delta=1)
self.assertAlmostEqual(R2.get_value("R"), 229, delta=1)
self.assertAlmostEqual(R3.get_value("R"), 854, delta=1)
self.assertAlmostEqual(R4.get_value("R"), 475, delta=1)
self.assertAlmostEqual(Q1.get_value("Y"), 1.78e-7, delta=5e-9)
self.assertAlmostEqual(Q2.get_value("Y"), 7.83e-7, delta=5e-9)
self.assertAlmostEqual(Q3.get_value("Y"), 1.61e-5, delta=5e-7)
self.assertAlmostEqual(Q1.get_value("n"), 0.913, delta=5e-2)
self.assertAlmostEqual(Q2.get_value("n"), 0.856, delta=5e-2)
self.assertAlmostEqual(Q3.get_value("n"), 0.952, delta=5e-2)

0 comments on commit 2c13b80

Please sign in to comment.