Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/napari_stress/_reconstruction/fit_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def _fancy_edge_fit(
DESCRIPTION.
"""
params = _function_args_to_list(selected_edge_func)[1:]
array = [x for x in array if not np.isnan(x)] # filter out nans
array = array[~np.isnan(array)] # filter out nans
try:
if selected_edge_func == _sigmoid:
# estimate parameters and trim intensity array
Expand Down Expand Up @@ -252,8 +252,7 @@ def estimate_fit_parameters(intensity):
"""
# Check if there are too few points
if len(intensity) < 5:
print("Warning: Too few points in trace (length < 5)")
return [np.nan] * 5, intensity, intensity
raise ValueError("Warning: Too few points in trace (length < 5)")

# Calculate the first derivative (dY)
dY = 0.5 * (
Expand Down
Loading