> ## Documentation Index
> Fetch the complete documentation index at: https://demo.agenticlabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# local_test.py

Here's a comprehensive documentation for the `test/plotting_tests/local_test.py` file:

## High-level description

This file contains unit tests for the local plotting functionality in the Cassiopeia package. It tests various aspects of the local plotting module, including color strip creation, indel heatmap generation, and the main plotting functions for both matplotlib and plotly.

## Code Structure

The main class `TestLocalPlotting` inherits from `unittest.TestCase` and contains multiple test methods. Each method tests a specific functionality of the local plotting module. The class uses a `setUp` method to create a sample `CassiopeiaTree` and allele table for testing purposes.

## Symbols

### TestLocalPlotting

#### Description

A test class that contains unit tests for the local plotting functionality in Cassiopeia.

#### Internal Logic

1. Sets up a sample `CassiopeiaTree` and allele table in the `setUp` method.
2. Contains multiple test methods, each testing a specific aspect of the local plotting module.

### setUp

#### Description

Initializes the test environment by creating a sample allele table, graph, cell metadata, and a `CassiopeiaTree` object.

### test\_compute\_colorstrip\_size

#### Description

Tests the `compute_colorstrip_size` function for various locations (up, right, left, polar).

### test\_create\_categorical\_colorstrip

#### Description

Tests the `create_categorical_colorstrip` function for creating a color strip based on categorical data.

### test\_create\_continous\_colorstrip

#### Description

Tests the `create_continuous_colorstrip` function for creating a color strip based on continuous data. Also tests for a warning when invalid vmin and vmax are provided.

### test\_create\_indel\_heatmap

#### Description

Tests the `create_indel_heatmap` function for generating a heatmap of indels.

### test\_plot\_matplotlib

#### Description

Tests the `plot_matplotlib` function with various parameters and checks for error handling with invalid metadata.

### test\_plot\_plotly

#### Description

Tests the `plot_plotly` function with various parameters.

### test\_create\_clade\_colors

#### Description

Tests the `create_clade_colors` function for generating node and branch colors based on clades.

## Dependencies

* unittest
* mock
* networkx
* numpy
* pandas
* cassiopeia

## Error Handling

The test methods include assertions to check for expected behavior and error handling. For example, `test_plot_matplotlib` checks for `PlottingError` when invalid metadata is provided.

## Logging

The test file doesn't implement any specific logging mechanisms, but it uses assertions and unittest's built-in reporting for test results.

## TODOs

There are no explicit TODOs in the code.

This test file is crucial for ensuring the correctness and robustness of the local plotting functionality in the Cassiopeia package. It covers various aspects of the plotting module, including color generation, heatmap creation, and the main plotting functions for both matplotlib and plotly backends.
