Skip to content

Change TopoStats dependency to pip package #131

Description

@ns-rse

When we started development of AFMSlicer it required us to use the in-development version of TopoStats which was
undergoing refactoring to introduce dataclasses. This is a bottleneck because cloning the TopoStats
repository
requires downloading 1.10Gb of data1.

These have now been merged into main and a release made to the Python Package Index
(PyPI)
. Here the source files and built wheels are ~240kb which is significantly
smaller than cloning the whole repository and so will install faster (but with a caveat, see below!)

As such we should now be able to switch out relying on installing TopoStats from GitHub to instead use the version on
PyPI which will increase the install time.

Changes

Current in pyproject.toml we have...

dependencies = [
  ...
  "topostats @ git+https://github.com/AFM-SPM/TopoStats",
  ...
]

We will require the Topostats >=2.4.2 version as a minimum and so we should switch to...

dependencies = [
  ...
  "topostats>=2.4.2",
  ...
]

Caveat

The caveat here is that TopoStats pulls in a dependency of Tensorflow which is used for
unet classification of entangled molecules (if I remember correctly!). The pre-built wheels/binaries for Tensorflow are
themselves considerable in size (typically around ~590Mb!) and so these still require downloading and installing even
though we have reduced the download required to install TopoStats itself. I have in the past suggested that this
dependency be broken out and made optional (see 916 Split ML functionality into optional
dependencies
) and will investigate doing so to improve the user
experience of installing AFMSlicer (and in turn napari-AFMSlicer) as currently Tensorflow is not required by AFMSlicer
at all.

Footnotes

  1. At various points in development files were mistakenly included in the repository history, there has been a
    long-standing issue to remove this bloat which saw some
    attention @tobyallwood but it was never merged to main to actually remove the bloat.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions