Skip to content

Commit

Permalink
tests: add test with tilted curve
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Jan 10, 2022
1 parent e9ce96b commit 61315c1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 8 deletions.
1 change: 1 addition & 0 deletions nanite/poc.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ def residual(params, x, data):
model(out.params, x)]
details["plot poc"] = [[cp, cp],
[y.min(), y.max()]]
print(cp, y.min(), y.max())

if ret_details:
return cp, details
Expand Down
Binary file not shown.
40 changes: 32 additions & 8 deletions tests/test_poc.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,38 @@ def test_poc_details_deviation_from_baseline():
"plot baseline threshold",
"plot poc"]:
assert key in pocd
assert np.allclose(
np.mean(pocd["plot baseline threshold"][1]),
8.431890003513514e-11,
atol=0)
assert np.allclose(
np.mean(pocd["plot baseline mean"][1]),
-7.573822405258677e-12,
atol=0)
assert np.allclose(
np.mean(pocd["plot baseline threshold"][1]),
8.431890003513514e-11,
atol=0)
assert np.allclose(
np.mean(pocd["plot baseline mean"][1]),
-7.573822405258677e-12,
atol=0)


def test_poc_details_fit_line_polynomial():
fd = IndentationGroup(
data_path
/ "fmt-jpk-fd_single_tilted-baseline-mitotic_2021-01-29.jpk-force")[0]
details = fd.apply_preprocessing(
["compute_tip_position", "correct_tip_offset"],
options={"correct_tip_offset": {"method": "fit_line_polynomial"}},
ret_details=True)
pocd = details["correct_tip_offset"]
for key in ["plot force",
"plot fit",
"plot poc"]:
assert key in pocd
assert np.allclose(
pocd["plot poc"][0][0],
15602,
atol=0)
assert np.allclose(
fd["force"][15602],
1.7313584441928315e-09,
atol=0,
)


def test_poc_frechet_direct_path():
Expand Down

0 comments on commit 61315c1

Please sign in to comment.