TDA4j is a platform for algorithm development and research in topological data analysis, not only a library to call. This guide is for reading, reviewing and extending its code, assuming you know persistent homology. Scala 3.7+'s context-abstraction syntax is most of the gap; the first page covers it.
How to use this guide
-
The Scala 3 syntax.
Type is TypeClass,type Self: Ordering as ordering,given [bounds] => Body = value, opaque types, extension methods. Start with the Scala 3 primer. -
Where a given piece of functionality lives, and what layer it's in. The library is built in clear layers — algebra, then complex construction (streams), then the persistence engines that consume a stream — and each has its own source directory (one package; simplicial sets are the
ssetadd-on). See Architecture. -
Which persistence algorithm, and which implementation, to build on. The persistence engines are independent implementations with different assumptions and intended roles; they are not layers on one shared core. See Persistence engines.
-
What traps look fine, compile fine, and only produce a wrong answer on specific inputs. Ordering and reduction code is where they hide. Read Hard-won invariants before changing it.
-
Whether a surprising result is a bug or the mathematically correct answer on a degenerate input. See Degeneracies.
-
What a user meets first, and the rules for new public API. The
Persistenceverb, thePersistenceDiagramit returns, the labs, and the "easy, not simple" principles behind them. See The public API. -
The add-ons. Nerves of monoids, groups and categories, persistent group homology and Brown's collapse are in Nerves and group homology. Plots and the live viewer are in Plotting internals.
-
How to measure a speed or memory claim. The A/B method, the benchmark specs, the profile drivers and the cross-library harness are in Measuring performance.
-
Extending the library. What each extension point asks of you and what it gives back: Extending the facades (MATLAB, the command line, JavaScript and Python), Contracts (the rules that are documented rather than checked), and Adding an engine or a complex.
-
Working on both platforms and getting a change merged. JVM and Scala.js, Testing conventions and the pull request workflow.
Contributing
How to set up, the commands, the path from an issue to a merged pull request, the changelog and the review principles are in the repository's CONTRIBUTING.md. Open questions, known limitations and planned work are issues.
Naming convention: tda4j/TDA4j, never Tda4j
"TDA4j" is the acronym TDA ("topological data analysis") plus the conventional 4j suffix (log4j, slf4j) — not an ordinary English word, so don't let a titlecasing habit turn it into Tda4j. Use tda4j (all lowercase) for the package name, the executable/artifact name, the repo name, and ordinary prose; use TDA4j (acronym preserved) for Scala identifiers that must start with a capital letter — class/object/trait names such as TDA4j (the MATLAB/Java facade), TDA4jConf/TDA4jCLI (the CLI). Tda4j is never correct.
The same rule applies to any identifier that's itself an acronym: CSV (comma-separated values) and cli.TDA4jCLI (command-line interface) are both fully capitalized for the same reason. Gudhi/Dipha/ Ripser/Perseus are ordinary proper nouns (the external projects those file formats belong to) and stay titlecased in their own conventional spelling instead.