diff --git a/changelog.md b/changelog.md index f7673482f..c4debfc91 100644 --- a/changelog.md +++ b/changelog.md @@ -1,39 +1,39 @@ # Changelog -## v1.6.0 | t.b.d. +## v1.6.0 | 2025-01-09 #### New features -* Added model to correct for bead-bead coupling when using active calibration deep in bulk with two beads. See [`tutorial`](https://lumicks-pylake.readthedocs.io/en/latest/tutorial/force_calibration.html#active-calibration-with-two-beads-far-away-from-the-surface) and [`theory`](https://lumicks-pylake.readthedocs.io/en/latest/theory/force_calibration/active.html#bead-bead-coupling) for more information. -* Added option to highlight a region on a time plot using [`Slice.highlight_time_range()`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.channel.Slice.html#lumicks.pylake.channel.Slice.highlight_time_range). For more information see the [`tutorial`](https://lumicks-pylake.readthedocs.io/en/latest/tutorial/file.html#highlight-time-range). -* Added `__array__` to [`Slice`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.channel.Slice.html). This allows passing slices directly to `numpy` functions such as `np.mean()`or `np.sum()`. -* Added parameter `allow_overwrite` to [`lk.download_from_doi()`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.download_from_doi.html#lumicks.pylake.download_from_doi) to allow re-downloading only those files where the checksum does not match. +* Calibration results and parameters are now accessible via properties which are listed when items are printed. See [calibration results](https://lumicks-pylake.readthedocs.io/en/v1.6.0/_api/lumicks.pylake.force_calibration.power_spectrum_calibration.CalibrationResults.html) and [calibration item](https://lumicks-pylake.readthedocs.io/en/v1.6.0/_api/lumicks.pylake.calibration.ForceCalibrationItem.html) API documentation for more information. +* Added property `diode_calibration` to access the diode calibration model, and `trap_power` to access the used trap power in [calibration item](https://lumicks-pylake.readthedocs.io/en/v1.6.0/_api/lumicks.pylake.calibration.ForceCalibrationItem.html). See the new [tutorial](https://lumicks-pylake.readthedocs.io/en/v1.6.0/tutorial/force_calibration/diode_model.html) and [theory](https://lumicks-pylake.readthedocs.io/en/v1.6.0/theory/force_calibration/diode.html) for more information. +* Added model to correct for bead-bead coupling when using active calibration deep in bulk with two beads. See [tutorial](https://lumicks-pylake.readthedocs.io/en/v1.6.0/tutorial/force_calibration/index.html), [theory](https://lumicks-pylake.readthedocs.io/en/v1.6.0/theory/force_calibration/active.html#bead-bead-coupling) and [example](https://lumicks-pylake.readthedocs.io/en/v1.6.0/examples/bead_coupling/coupling.html) for more information. +* Added option to highlight a region on a time plot using [`Slice.highlight_time_range()`](https://lumicks-pylake.readthedocs.io/en/v1.6.0/_api/lumicks.pylake.channel.Slice.html#lumicks.pylake.channel.Slice.highlight_time_range). For more information see the [tutorial](https://lumicks-pylake.readthedocs.io/en/v1.6.0/tutorial/file.html#highlighting). +* Added `__array__` to [`Slice`](https://lumicks-pylake.readthedocs.io/en/v1.6.0/_api/lumicks.pylake.channel.Slice.html). This allows passing slices directly to `numpy` functions such as `np.mean()`or `np.sum()`. +* Added parameter `allow_overwrite` to [`lk.download_from_doi()`](https://lumicks-pylake.readthedocs.io/en/v1.6.0/_api/lumicks.pylake.download_from_doi.html#lumicks.pylake.download_from_doi) to allow re-downloading only those files where the checksum does not match. * Added force calibration information to channels accessed directly via the square bracket notation (e.g. `file["Force HF"]["Force 1x"].calibration`). -* Calibration results and parameters are now accessible via properties which are listed when items are printed. See [calibration results](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.force_calibration.power_spectrum_calibration.CalibrationResults.html) and [calibration item](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.calibration.ForceCalibrationItem.html) API documentation for more information. -* Added `applied_at` property to a [calibration item](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.calibration.ForceCalibrationItem.html) obtained from a force slice. This property returns the timestamp in nanoseconds at which the force calibration was applied. -* Added property `diode_calibration` to access diode calibration model, and `trap_power` to access the used trap power in [calibration item](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.calibration.ForceCalibrationItem.html). -* Added parameter `titles` to customize title of each subplot in [`Kymo.plot_with_channels()`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.kymo.Kymo.html#lumicks.pylake.kymo.Kymo.plot_with_channels). -* Added [`KymoTrack.sample_from_channel()`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.kymotracker.kymotrack.KymoTrack.html#lumicks.pylake.kymotracker.kymotrack.KymoTrack.sample_from_channel) to downsample channel data to the time points of a kymotrack. -* Added support for file names with spaces in [`lk.download_from_doi()`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.download_from_doi.html#lumicks.pylake.download_from_doi). -* Show the ranges that were excluded from a power spectrum or calibration fit by passing `show_excluded=True` to [`PowerSpectrum.plot()`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.force_calibration.power_spectrum.PowerSpectrum.html#lumicks.pylake.force_calibration.power_spectrum.PowerSpectrum.plot) or [`CalibrationResults.plot()`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.force_calibration.power_spectrum_calibration.CalibrationResults.html#lumicks.pylake.force_calibration.power_spectrum_calibration.CalibrationResults.plot). -* Plot the active calibration peak for a calibration result using `show_active_peak=True` with [`CalibrationResults.plot()`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.force_calibration.power_spectrum_calibration.CalibrationResults.html#lumicks.pylake.force_calibration.power_spectrum_calibration.CalibrationResults.plot). -* Added function to import a [`KymoTrackGroup`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.kymotracker.kymotrack.KymoTrackGroup.html) from a `CSV` file using [`load_tracks`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.load_tracks.html). -* Added function to load tracks into the kymotracker widget using [`KymoWidgetGreedy.load_tracks()`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.KymoWidgetGreedy.html#lumicks.pylake.KymoWidgetGreedy.load_tracks). +* Added `applied_at` property to a [calibration item](https://lumicks-pylake.readthedocs.io/en/v1.6.0/_api/lumicks.pylake.calibration.ForceCalibrationItem.html) obtained from a force slice. This property returns the timestamp in nanoseconds at which the force calibration was applied. +* Added parameter `titles` to customize the title of each subplot in [`Kymo.plot_with_channels()`](https://lumicks-pylake.readthedocs.io/en/v1.6.0/_api/lumicks.pylake.kymo.Kymo.html#lumicks.pylake.kymo.Kymo.plot_with_channels). +* Added [`KymoTrack.sample_from_channel()`](https://lumicks-pylake.readthedocs.io/en/v1.6.0/_api/lumicks.pylake.kymotracker.kymotrack.KymoTrack.html#lumicks.pylake.kymotracker.kymotrack.KymoTrack.sample_from_channel) to downsample channel data to the time points of a kymotrack. +* Added support for file names with spaces in [`lk.download_from_doi()`](https://lumicks-pylake.readthedocs.io/en/v1.6.0/_api/lumicks.pylake.download_from_doi.html#lumicks.pylake.download_from_doi). +* Show the ranges that were excluded from a power spectrum or calibration fit by passing `show_excluded=True` to [`PowerSpectrum.plot()`](https://lumicks-pylake.readthedocs.io/en/v1.6.0/_api/lumicks.pylake.force_calibration.power_spectrum.PowerSpectrum.html#lumicks.pylake.force_calibration.power_spectrum.PowerSpectrum.plot) or [`CalibrationResults.plot()`](https://lumicks-pylake.readthedocs.io/en/v1.6.0/_api/lumicks.pylake.force_calibration.power_spectrum_calibration.CalibrationResults.html#lumicks.pylake.force_calibration.power_spectrum_calibration.CalibrationResults.plot). +* Plot the active calibration peak for a calibration result using `show_active_peak=True` with [`CalibrationResults.plot()`](https://lumicks-pylake.readthedocs.io/en/v1.6.0/_api/lumicks.pylake.force_calibration.power_spectrum_calibration.CalibrationResults.html#lumicks.pylake.force_calibration.power_spectrum_calibration.CalibrationResults.plot). +* Added function to import a [`KymoTrackGroup`](https://lumicks-pylake.readthedocs.io/en/v1.6.0/_api/lumicks.pylake.kymotracker.kymotrack.KymoTrackGroup.html) from a `CSV` file using [`load_tracks`](https://lumicks-pylake.readthedocs.io/en/v1.6.0/_api/lumicks.pylake.load_tracks.html). +* Added function to load tracks into the kymotracker widget using [`KymoWidgetGreedy.load_tracks()`](https://lumicks-pylake.readthedocs.io/en/v1.6.0/_api/lumicks.pylake.KymoWidgetGreedy.html#lumicks.pylake.KymoWidgetGreedy.load_tracks). #### Improvements * Added improved printing of calibration items under `channel.calibration` providing a more convenient overview of the items associated with a `Slice`. * Added improved printing of calibrations performed with `Pylake`. -* Improved error message that includes the name of the model when trying to access a model that was not added in an [`FdFit`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.FdFit.html) using angular brackets. -* Allow customizing the minimum step size during step size determination for [`DwelltimeModel.profile_likelihood()`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.DwelltimeModel.html#lumicks.pylake.DwelltimeModel.profile_likelihood) and choose a more sensible default. Also ensured that the warning only gets emitted at most once per direction. +* Improved [`FdFit`](https://lumicks-pylake.readthedocs.io/en/v1.6.0/_api/lumicks.pylake.FdFit.html) error message that includes the name of the model when trying to access a model that was not added in an [`FdFit`](https://lumicks-pylake.readthedocs.io/en/v1.6.0/_api/lumicks.pylake.FdFit.html) using angular brackets. +* Allow customizing the minimum step size during step size determination for [`DwelltimeModel.profile_likelihood()`](https://lumicks-pylake.readthedocs.io/en/v1.6.0/_api/lumicks.pylake.DwelltimeModel.html#lumicks.pylake.DwelltimeModel.profile_likelihood) and set a more sensible default. Also ensured that the warning only gets emitted at most once per direction. #### Bug fixes -* Ensure that operators such as (e.g. `+`, `-`, `/`) work on [`Slice`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.channel.Slice.html) with all types that are convertible to scalars. Previously these failed with zero dimensional numpy arrays and other convertible objects. -* Fixed a bug where bead edge determination could fail with an unhandled exception during background estimation. This raised a `np.linalg.LinAlgError` when determining the background failed rather than the expected `RuntimeError`. In this case, a simple median is used as a fallback option. -* Fix a bug to ensure that [`lk.GaussianMixtureModel`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.GaussianMixtureModel.html) can also be used with a single state. * Fixed bug that prevented opening the force distance widgets when using them with the `widget` backend on `matplotlib >= 3.9.0`. -* Prevent near `0/0` during fitting when components of a [`DwelltimeModel`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.DwelltimeModel.html) are near zero. Note that these only occurred during the computation of the model derivatives during the fitting procedure and should not impact the model simulation itself. +* Ensure that operators such as (e.g. `+`, `-`, `/`) work on [`Slice`](https://lumicks-pylake.readthedocs.io/en/v1.6.0/_api/lumicks.pylake.channel.Slice.html) with all types that are convertible to scalars. Previously these failed with zero dimensional numpy arrays and other convertible objects. +* Fixed a bug where bead edge determination could fail with an unhandled exception during background estimation. This raised a `np.linalg.LinAlgError` when determining the background failed rather than the expected `RuntimeError`. In this case, a simple median is used as a fallback option. +* Fixed a bug to ensure that [`lk.GaussianMixtureModel`](https://lumicks-pylake.readthedocs.io/en/v1.6.0/_api/lumicks.pylake.GaussianMixtureModel.html) can also be used with a single state. +* Fixed a bug that could result in a near `0/0` during fitting when components of a [`DwelltimeModel`](https://lumicks-pylake.readthedocs.io/en/v1.6.0/_api/lumicks.pylake.DwelltimeModel.html) are near zero. Note that these only occurred during the computation of the model derivatives during the fitting procedure and should not impact the model simulation itself. ## v1.5.3 | 2024-10-29 diff --git a/docs/theory/force_calibration/fitting.rst b/docs/theory/force_calibration/fitting.rst index 52ccc160f..e1b73beaf 100644 --- a/docs/theory/force_calibration/fitting.rst +++ b/docs/theory/force_calibration/fitting.rst @@ -56,8 +56,10 @@ frequency :cite:`berg2004power`. .. math:: + \begin{eqnarray} \bar{f} &= \frac{1}{n_b} \sum_{f \in \mathrm{block}} f\\ \bar{P}_\mathrm{meas} &= \frac{1}{n_b} \sum_{f \in \mathrm{block}} P_\mathrm{meas}(f) + \end{eqnarray} Setting the number of points per block too low results in a bias from insufficient averaging :cite:`berg2004power`. Insufficient averaging would result in an overestimation of the force response :math:`R_f` and an diff --git a/docs/whatsnew/1.6.0/1_6_0.rst b/docs/whatsnew/1.6.0/1_6_0.rst index 2d9ed8bc2..6d0d92427 100644 --- a/docs/whatsnew/1.6.0/1_6_0.rst +++ b/docs/whatsnew/1.6.0/1_6_0.rst @@ -3,7 +3,7 @@ Pylake 1.6.0 .. only:: html -Here is a sneak preview of features that will likely be in Pylake `v1.6.0`. +Here is an overview of features that were released in Pylake `v1.6.0`. New example notebooks --------------------- diff --git a/lumicks/pylake/__about__.py b/lumicks/pylake/__about__.py index 6fd9f19c6..6629891bd 100644 --- a/lumicks/pylake/__about__.py +++ b/lumicks/pylake/__about__.py @@ -1,9 +1,9 @@ __title__ = "lumicks.pylake" -__version__ = "1.5.3" +__version__ = "1.6.0" __summary__ = "Bluelake data analysis tools" __url__ = "https://github.com/lumicks/pylake" __author__ = "Lumicks B.V." -__copyright__ = "2024, " + __author__ +__copyright__ = "2025, " + __author__ __email__ = "devteam@lumicks.com" __license__ = "Apache 2.0" diff --git a/pyproject.toml b/pyproject.toml index 057759a5f..871679b78 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ classifiers=[ "Programming Language :: Python :: Implementation :: CPython", ] dependencies = [ - "pytest>=3.5", + "pytest>=7.4", "h5py>=3.4, <4", "numpy>=1.24", # 1.24 is needed for dtype in vstack/hstack (Dec 18th, 2022) "scipy>=1.9, <2", # 1.9.0 needed for lazy imports (July 29th, 2022) diff --git a/release.md b/release.md index c82293e6f..7c408ab54 100644 --- a/release.md +++ b/release.md @@ -13,10 +13,10 @@ Within the Pylake repo dir: - Update the date of the new release. - Review the changelog entries. Make sure everything is clear and informative for users. - Consider grouping some related entries if it makes sense. -- Bump the version number in `./pyproject.toml`. +- Bump the version number in `__about__.py`. - Commit changes with message "release: release Pylake v". - Check whether any dependencies of Pylake have changed and check if required packages do exist on anaconda: - - `git diff v setup.py` to check changed dependencies. + - `git diff v pyproject.toml` to check changed dependencies. - Check availability of package versions on [anaconda](https://anaconda.org/) in the channel `anaconda` and `conda-forge`. - Run `pytest` with `pytest --runpreflight --runslow ./lumicks/pylake` and verify that all tests pass (none may be skipped). - Build the docs (see `docs/readme.md`) and verify that they build without warnings.