What’s new in the package

A catalog of new features, improvements, and bug-fixes in each release. Follow links to the relevant GitHub issue or pull request for specific code changes and any related discussion.

v0.6.2

trackpy v0.6.2 includes bug fixes, and compatibility fixes with newer dependency versions.

A special thanks to everyone who reported the issues fixed in this release!

Bug fixes

  • Fixed an issue with feature-finding in 4D image sequences (@VeraMTitze, #739)

  • Fixed a rare issue in which subtract_drift() with multiple particles resulted in a Pandas indexing error. (@kevin-duclos, #735)

Dependencies

  • Adds official support for Python 3.12. (@caspervdw, #747)

  • Adds support for latest Pandas, NumPy, and SciPy (@marcocaggioni, #740; @nkeim, #743, @vivarose and @rodrigo-j-goncalves, #742; @caspervdw, #747)

  • Drops official support for Python 3.7 and earlier, NumPy 1.17 and earlier, Pandas 0.x, and SciPy 1.3 and earlier.

v0.6.1

trackpy v0.6.1 is functionally equivalent to v0.6.0. It is being released to fix an issue with Zenodo, so that this trackpy release has a citable DOI.

v0.6.0

This release adds an efficient way to use custom distance metrics during linking, and fixes bugs and some inconsistencies in the prediction capabilities. Some existing code that used prediction may now fail to run until a (minor) update is made.

This release includes contributions by @magnunor, @freemansw1, @crisp-snakey, @rbnvrw, @caspervdw, @tacaswell, and @nkeim.

Enhancements

  • Linking can now use any DistanceMetric class from sklearn to compute distances (#692 by @freemansw1)

  • Several documentation fixes by @magnunor and @nkeim

API Changes

  • When supplying an initial velocity guess to NearestVelocityPredict or DriftPredict, you must also supply the pos_columns argument to identify the names of the columns in your array. (For example, “pos_columns = [‘y’, ‘x’]”.) Otherwise, creating the predictor will raise an exception that explains this change. If you provide pos_columns when creating the predictor, you do not have to supply it when subsequently using the link_df() or link_df_iter() methods to link your features. (@nkeim, #710)

  • reconnect_traj_patch() is now available as trackpy.reconnect_traj_patch and is described in the API documentation. (@nkeim, #648)

Bug Fixes

  • When linking with prediction, the predictor now correctly uses the same position columns as the linker, and correctly handles the pos_columns argument if specified. (@nkeim, #710)

  • The link_df() method of predictor objects now works correctly. This is reflected in the updated prediction tutorial. (@nkeim, #710)

Dependencies

  • trackpy is now being tested in conda environments with Python 3.10.

  • trackpy is no longer tested with Python 3.6.

  • trackpy now requires the looseversion package to work with newer scipy (@crisp-snakey, #706)

  • Much work on testing and packaging infrastructure by @tacaswell and @caspervdw

v0.5

This is a major release focused on enhancements. Most notably, parallel processing is now turned on by default for “trackpy.batch” and “trackpy.locate_brightfield_ring”, resulting in a large performance increase for many users. Another minor speedup changes the way in which particle numbers are generated, which may cause issues with reproducibility in some existing workflows (see “API Changes” below).

Note that Python 2 reached end-of-life in 2020, and it is no longer officially supported by trackpy. Also, trackpy dropped support for older NumPy, Scipy and Pandas. The current minimum requirements are: python>=3.6 numpy>=1.14 scipy>=1.1 pandas>=0.22.

Enhancements

  • “compute_drift()” now accepts list-like “pos_columns” (e.g. tuples). (GH579)

  • “trackpy.locate_brightfield_ring” now defaults to parallel execution with all available CPUs, as controlled by the optional “processes” argument (GH602)

  • “refine_brightfield_ring()” now uses the 5th percentile for edge detection instead of the minimum, resulting in a more robust tracking for low contrast images. (GH602)

API Changes

  • “trackpy.batch” now defaults to parallel execution with all available CPUs (“processes=’auto’”). For most users this should be a noticeable speedup. Revert to the previous behavior with “processes=1”. (GH605)

  • During linking, particles are not sorted before assigning new trajectories. This greatly speeds up linking under certain conditions. The actual coordinates and linked trajectories are not affected by this change, but the unique number assigned to a trajectory (in the “particle” column) may vary from run to run. The most reproducible way to identify a specific particle is still the particle’s coordinates at an instant in time. To make the numbering stable again, set the “PYTHONHASHSEED” environment variable before starting Python. (GH597, GH601)

v0.4.2

This is a minor release with two major new features: parallel processing to speed up feature-finding, and a new method for locating features in bright-field microscopy. There is also an overhaul of the walkthrough and other tutorials, and compatibility with the latest version of Pandas (0.25.1).

API Changes

  • “trackpy.locate” and associated functions now report “ep” to be NaN when there is only one usable background pixel to sample. (GH519)

  • “trackpy.legacy.linking.link_df” does not copy a DataFrame automatically anymore if the provided DataFrame is a view. (GH503)

  • The “locate” options in “trackpy.batch” are now collected in “**kwargs” (except for “diameter”) and passed to the wrapped “trackpy.locate” function. This means when using the “meta” option of “trackpy.batch” only explicitly given options for the wrapped “trackpy.locate” are saved to the file; unspecified options using default values from “locate” aren’t saved. (GH499)

Enhancements

  • Added support for multiprocessing to “trackpy.batch”. (GH499)

  • “trackpy.locate_brightfield_ring” enables precise tracking of large particles in bright-field microscopy. There is a new tutorial to demonstrate it. (GH527)

  • Added “trackpy.linking.link_partial” to allow linking a movie in separate pieces. (GH445)

  • Many updates and improvements to the tutorials. Most notably, the walkthrough is revised and updated for the latest versions of trackpy and pims, and code from all tutorials should now run in recent Python environments. (GH567, GH524, GH539, GH543, GH541, GH532, GH157, GH558, GH505, GH525). Most of these changes were made in the trackpy-examples repository on GitHub.

  • Smaller improvements to other documentation for the linking and feature-finding APIs. (GH545, GH551, GH550, GH522, GH540, GH542)

Bug fixes

  • Fixed incompatibility with recent Pandas (GH529, GH538)

  • Removed warnings in case Pandas 0.23 is used (GH503)

  • Removed warnings in case Pandas 0.25 is used (GH545)

  • “trackpy.diag.dependencies” now gives information about a more complete set of packages.

v0.4.1

This is a minor release with some important fixes. Additionally, PIMS is no longer a required dependency, which makes installation easier.

API Changes

  • PIMS (Python IMage Sequence) is no longer a required dependency (GH492)

Enhancements

  • Improved performance of adaptive search (GH489)

  • Reduced memory usage during linking (GH489)

Bug fixes

  • Fix enable_numba on Py3.6 and MS Windows systems (GH486)

v0.4.0

This is a major release that includes new choices for linking and feature-finding algorithms, as well as many performance increases and clean-ups. It is recommended for all trackpy users, but may require minor changes to existing code, as detailed below.

API Changes

  • locate has a more modular structure that makes it easier to customize feature-finding (GH400, GH406)

  • The default value of smoothing_size is smaller, and more consistent with other implementations of this algorithm. In general, particle mass values will be different. The new minmass_v04_change function helps update minmass values in existing code (GH401, GH465)

  • The “minmass” parameter now has a default value of 0 (GH400)

  • The “filter_before” option is no longer supported (GH400)

  • Major refactor of the linking code giving linking a better API (GH416, GH414)

  • Linking diagnostics are no longer supported (GH414)

  • link_df always creates a copy of the data; it can no longer work in-place (GH414)

Enhancements

  • Improved performance of feature finding (GH361)

  • Improved performance of linking (GH400, GH406)

  • New refinement method using least squares optimization (GH407)

  • New linker that combines feature-finding with linking (FindLinker) (GH407, GH410, GH411, GH416, GH428)

  • Linking in non-Euclidean coordinate systems and curved metrics (GH448)

Bug fixes

  • Fix compute_drift if dataframes are not sorted (GH409)

  • Fix double counting of non-linking penalty in non-numba linkers (GH430)

  • Fix the N column for emsd (GH434)