Package: topological-signal-compression
A persistent homology-based signal compression method.InstallationInstalling from PyPIBase PackageThe base package can be installed via PyPI by running:$pipinstalltopological-signal-compressionwhich will only install the dependencies that support the TSC compression and reconstruction algorithms.[extras] InstallationThere is also an option to install additionalpipdependencies to support running:Counterfactual signal compression algorithms.Data readers.Visualization of persistence diagrams.These extra dependencies can be installed by running:$pipinstalltopological-signal-compression[extras]WARNING: additional [extras] dependencies thatcannotbe installed withpipNote, that the counterfactual compression code, specifically the Opus compression method,
also depends on installing theopus-toolsandffmpegpackages, both of which are
available forcondainstallation by running:$condainstall-cconda-forgeopus-tools
$condainstall-cconda-forgeffmpegfrom within acondaenvironment. There are other unix-equivalent installations that can be done to maintain
functionality, but we only test against theconda-based installation.Development EnvironmentTo install thecondaenvironment and thejupyterkernel with the full development environment,
clone the repo and run:$cdpath/to/topological-signal-compression
$bashinstall.shNote, this installation script requiresmamba(for faster installation), but you can also run the./install.shscript by
changingmambatocondato remove that dependency.To uninstall the environment and kernel, be sure to deactivate thecondaenvironment, then run:$cdpath/to/topological-signal-compression
$bashuninstall.shDocumentationOnce the repo is cloned,sphinxdocumentation can be built after installing thecondaenvironment after installing
the[docs]dependencies:$sourceactivatetsc
$cdpath/to/topological-signal-compression
$pipinstall-e.[extras,docs]$bashbuild_sphinx_docs.shIt can also be built after installing the[docs]version of the code fromPyPI:$pipinstalltopological-signal-compression[extras,docs]$cdpath/to/topological-signal-compression
$bashbuild_sphinx_docs.shThen, open up<path/to/topological-signal-compression>/public/index.htmlin a web browser to view the documentation.NotebooksAll jupyter notebooks are contained in the./notebooksdirectory. These are tested to make sure they run end-to-end
without error, and can be run in thePython (tsc)kernel that is created by./install.sh. These notebooks are also
embedded in thesphinxdocumentation (see the "Documentation" section for more information).TestingTesting is broken into several sets of tests. There are unit tests on the code as well as end-to-end tests on the maintainedjupyternotebooks in./notebooks.Note, running the tests requires additional dependencies. These are built into thecondaenvironment (tsc.yml) installed viainstall.sh, or the testing dependencies can instead be installed by running:$pipinstalltopological-signal-compression[testing]Once the testing dependencies are installed, there are several options for testing.To run the unit tests on the fulltopological-signal-compression[extras]package
(including the counterfactual compression algorithms, keep in mind the "WARNING" section above), run:$cdpath/to/topological-signal-compression
$pytest-ctests/pytest_tsc.iniTo run the unit tests ononlythetopological-signal-compressionbase installation:$cdpath/to/topological-signal-compression
$pytest-ctests/pytest_tsc_base_only.iniTo run the notebooks tests:$cdpath/to/topological-signal-compression
$pytest-ctests/pytest_notebooks.ini