High-level description

This directory contains unit tests for various simulators and data generators in the Cassiopeia project. The tests cover different aspects of tree simulation, spatial data simulation, lineage tracing, and leaf subsampling. These tests ensure the correct functionality of the simulators and help maintain the integrity of the Cassiopeia package.

What does it do?

The test suite in this directory verifies the following functionalities:

  1. Birth-death tree simulation
  2. Brownian spatial data simulation
  3. CRISPR/Cas9 lineage tracing simulation
  4. Clonal spatial simulation
  5. Complete binary tree simulation
  6. ecDNA birth-death simulation
  7. Sequential lineage tracing simulation
  8. Simple fit subclone simulation
  9. Spatial leaf subsampling
  10. Supercellular sampling
  11. Uniform leaf subsampling

Each test file contains multiple test cases that check for correct initialization, error handling, and output generation for the respective simulators and data generators.

Entry points

The main entry points for these tests are the individual test files, each corresponding to a specific simulator or data generator. Some key files include:

  1. birth_death_simulator_test.py: Tests for the birth-death tree simulator
  2. brownian_spatial_simulator_test.py: Tests for the Brownian spatial data simulator
  3. cas9_lineage_tracing_simulator_test.py: Tests for the CRISPR/Cas9 lineage tracing simulator
  4. ecdna_birth_death_simulator_test.py: Tests for the ecDNA birth-death simulator
  5. sequential_lineage_tracing_simulator_test.py: Tests for the sequential lineage tracing simulator
  6. spatial_leaf_subsampler_test.py: Tests for the spatial leaf subsampler

These test files can be run individually or as part of a larger test suite to ensure the correct functionality of the Cassiopeia package.

Dependencies

The test suite relies on the following main dependencies:

  1. unittest: The Python unit testing framework
  2. numpy: For numerical operations and random number generation
  3. networkx: For graph operations and tree structures
  4. pandas: For handling data frames and character matrices
  5. cassiopeia: The main package being tested, including its various modules and classes

Configuration

The tests do not require specific configuration files. However, they often use random seeds to ensure reproducibility of test results. For example:

np.random.seed(41)

This ensures that random number generation produces consistent results across test runs.

In summary, this test suite provides comprehensive coverage for the various simulators and data generators in the Cassiopeia project, ensuring their correct functionality and helping maintain the overall quality of the package.