# phutil 0.0.2

## New features

- New `as_diagram()` generic and methods for `persistence` and `PHom` classes,
  enabling round-trip conversion back to the `diagram` class used by
  [{TDA}](https://cran.r-project.org/package=TDA) (#53).

## Bug fixes

- `as_persistence.diagram()` now correctly handles `diagram` objects whose
  `Birth` and `Death` columns appear in a different order, which can occur with
  some {TDA} filtrations (#52).
- Graphics options are now properly restored to the user's original settings
  after being temporarily changed (#41).

## Minor improvements

- {TDA} functions are now called with explicit `TDA::` namespace prefixes and
  `print.progress = FALSE` for cleaner output (#41).
- Tests for {ripserr} integration are now run conditionally on {ripserr} being
  installed, removing it as a hard suggested dependency (#41).
- The vignette no longer requires {ggplot2} or {scales}, reducing optional
  dependencies for building the documentation (#46, closes #45).
- Vendored {cpp11} headers have been removed; the package now relies on the
  {cpp11} headers provided by the installed package, allowing it to benefit from
  updated versions. The `NO_LEGACY_NONAPI` flag is set to comply with the R API
  going forward (#55).
- Package description updated with references to the distance methods
  implemented (#41).

# phutil 0.0.1

This is a new submission to CRAN.

## Goals

The [{phutil}](https://tdaverse.github.io/phutil/) package is intended to be a
low-level package for hosting persistence data. It is part of the *TDAverse*
suite of packages, which are designed to provide a collection of packages for
enabling machine learning and data science tasks using persistent homology.

## Current features

The package currently exposes:

- a new data structure (the
[`persistence`](https://tdaverse.github.io/phutil/reference/persistence.html)
class) for hosting persistence data;
- a set of utility functions for coercing persistence data to and from
other data structures (e.g., `data.frame`, `tibble`, `list`, `matrix`,`PHom` and
`diagram` classes);
- a set of utility functions for computing Bottleneck and Wasserstein distances
between two persistence diagrams
([`bottleneck_distance()`](https://tdaverse.github.io/phutil/reference/distances.html)
and
[`wasserstein_distance()`](https://tdaverse.github.io/phutil/reference/distances.html))
and from a sample of persistence diagrams in a pairwise manner
([`bottleneck_pairwise_distance()`](https://tdaverse.github.io/phutil/reference/pairwise-distances.html)
and
[`wasserstein_pairwise_distance()`](https://tdaverse.github.io/phutil/reference/pairwise-distances.html)).

## Dependencies

Messages, warnings and errors are relayed to the user using the
[{rlang}](https://rlang.r-lib.org) package and the
[{cli}](https://cli.r-lib.org) package which are both licensed under the MIT
license and with no dependency trail.

Computation of distances is performed using the BSD-licensed
[Hera](https://github.com/anigmetov/hera) C++ library. The code interfacing R
and C++ is generated by the header-only [{cpp11}](https://cpp11.r-lib.org)
package which is MIT-licensed. Computation of pairwise distances is parallelized
over the number of pairs using [OpenMP](https://www.openmp.org/).
