diff --git a/changelog.md b/changelog.md index 38497f413..e39382c59 100644 --- a/changelog.md +++ b/changelog.md @@ -12,6 +12,7 @@ * Fixed a bug where the time between frames was incorrectly not excluded when calling [`ImageStack.frame_timestamp_ranges()`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.ImageStack.html#lumicks.pylake.ImageStack.frame_timestamp_ranges) with `include_dead_time=False`. Note that `Scan` and `Kymo` are not affected. * Fixed a bug where [`ImageStack.plot_correlated()`](https://lumicks-pylake.readthedocs.io/en/v1.3.0/_api/lumicks.pylake.ImageStack.html#lumicks.pylake.ImageStack.plot_correlated) was not excluding the dead time between frames. * Changed the `DateTime` tag on TIFFs exported with Pylake from `Scan` and `Kymo` objects. Before the change, the start and end of the scanning period in nanoseconds was stored. After the change, we store the starting timestamp of the frame, followed by the starting timestamp of the next frame to be consistent with data exported from Bluelake. The scanning time is stored in the field `Exposure time (ms)` on the Description tag. +* Fixed tests to be compatible with `pytest>=8.0.0`. ## v1.3.1 | 2023-12-07 diff --git a/lumicks/pylake/force_calibration/tests/test_touchdown.py b/lumicks/pylake/force_calibration/tests/test_touchdown.py index aa2665ab3..adf05b20f 100644 --- a/lumicks/pylake/force_calibration/tests/test_touchdown.py +++ b/lumicks/pylake/force_calibration/tests/test_touchdown.py @@ -145,6 +145,8 @@ def test_exp_sine_fits(decay, amplitude, frequency, phase_shift): np.testing.assert_allclose(par, frequency, rtol=1e-6) +@pytest.mark.filterwarnings("ignore:Covariance of the parameters could not be estimated") +@pytest.mark.filterwarnings("ignore:Surface detection failed") def test_insufficient_data(mack_parameters): stage_positions, simulation = simulate_touchdown(102.5, 103.5, 0.01, mack_parameters) diff --git a/lumicks/pylake/kymotracker/tests/conftest.py b/lumicks/pylake/kymotracker/tests/conftest.py index b0812408f..f5d1d953b 100644 --- a/lumicks/pylake/kymotracker/tests/conftest.py +++ b/lumicks/pylake/kymotracker/tests/conftest.py @@ -66,7 +66,7 @@ def two_gaussians_1d(): @pytest.fixture def blank_kymo(): - return generate_kymo( + kymo = generate_kymo( "", np.ones((1, 10)), pixel_size_nm=1000, @@ -75,6 +75,8 @@ def blank_kymo(): samples_per_pixel=1, line_padding=0, ) + kymo._motion_blur_constant = 0 + return kymo @pytest.fixture diff --git a/lumicks/pylake/kymotracker/tests/test_kymotrack.py b/lumicks/pylake/kymotracker/tests/test_kymotrack.py index 6e57a3acf..c680d19bb 100644 --- a/lumicks/pylake/kymotracker/tests/test_kymotrack.py +++ b/lumicks/pylake/kymotracker/tests/test_kymotrack.py @@ -867,7 +867,9 @@ def test_fit_binding_times_nonzero(blank_kymo, blank_kymo_track_args): r"analysis. If you wish to not see this warning, filter the tracks with " r"`lk.filter_tracks` with a minimum length of 2 samples.", ): - dwelltime_model = tracks.fit_binding_times(1) + dwelltime_model = tracks.fit_binding_times( + n_components=1, observed_minimum=True, discrete_model=False + ) np.testing.assert_equal(dwelltime_model.dwelltimes, [4, 4, 4, 4]) np.testing.assert_equal(dwelltime_model._observation_limits[0], 4) np.testing.assert_allclose(dwelltime_model.lifetimes[0], [0.4]) @@ -1145,6 +1147,7 @@ def test_kymotrack_group_diffusion_filter(): image = np.random.randint(0, 20, size=(10, 10, 3)) kwargs = dict(line_time_seconds=10e-3, start=np.int64(20e9), pixel_size_um=0.05, name="test") kymo = _kymo_from_array(image, "rgb", **kwargs) + kymo._motion_blur_constant = 0 base_coordinates = ( np.arange(1, 10), @@ -1407,8 +1410,15 @@ def test_invalid_ensemble_diffusion(blank_kymo): def test_ensemble_diffusion_different_attributes(): line_times = (1, 0.5) pixel_sizes = (0.1, 0.05) - kwargs = [{"line_time_seconds": t, "pixel_size_um": s} for t in line_times for s in pixel_sizes] - kymos = [_kymo_from_array(np.random.poisson(5, (25, 25, 3)), "rgb", **k) for k in kwargs] + multi_kwargs = [ + {"line_time_seconds": t, "pixel_size_um": s} for t in line_times for s in pixel_sizes + ] + kymos = [] + for kwargs in multi_kwargs: + kymo = _kymo_from_array(np.random.poisson(5, (25, 25, 3)), "rgb", **kwargs) + kymo._motion_blur_constant = 0 + kymos.append(kymo) + tracks = [ KymoTrackGroup( [KymoTrack(np.arange(5), np.random.uniform(3, 5, 5), k, "green", 0) for _ in range(5)]