semvec/pypi-packages huggingface dataset:
cpgdata 0.6.0
Cell painting gallery data handling and validation
Requires Python: <4.0,>=3.10

# Cell painting gallery data handling and validation

## Getting started


### Install `cpgdata` package

```bash
pip install cpgdata
```

### Sync pre-generated index files

```bash
cpg index sync -o "path to save index files"
```

### Example of using the index for filtering files to download from the Cell painting gallery

```python
from pathlib import Path
from pprint import pprint

import polars as pl
from cpgdata.utils import download_s3_files, parallel

index_dir = Path("path to dir containing index files")
index_files = [file for file in index_dir.glob("*.parquet")]
df = pl.scan_parquet(index_files)

df = (
    df
    .filter(pl.col("dataset_id").eq("cpg0016-jump"))
    .filter(pl.col("source_id").eq("source_4"))
    .filter(pl.col("leaf_node").str.contains("Cells.csv"))
    .select(pl.col("key"))
    .collect()
)

# print first 10 results
pprint(df.to_dicts()[0:10])

# Download filtered files
download_keys = list(df.to_dict()["key"])
parallel(download_keys, download_s3_files, ["cellpainting-gallery", Path("path to save downloaded files")], jobs=20)

```
rich-heatmap 0.1.3
A simple rich renderable Heatmap.
Requires Python: >=3.10

[![PyPI version](https://badge.fury.io/py/rich-heatmap.svg)](https://badge.fury.io/py/rich-heatmap)


# rich_heatmap

A simple Heatmap renderable for projects using
[rich](https://github.com/Textualize/rich).

# Installing

Install with `pip` or your favorite package manager:

```bash
python -m pip install rich_heatmap
```
```bash
uv add rich_heatmap
```

# Usage

Create `HeatmapCell` objects containing your data:

```python
for row, col in itertools.product(range(30), range(20)):
    value = noise.snoise2(col / 10, row / 15)
    cells.append(heatmap.HeatmapCell(row, col, value, None, f"{value:0.1f}"))
```

Values will be normalized into `[0, 1]` and then mapped to a color
using a colormap function:

```python
EMBER = matplotlib.colormaps['cmr.ember']
def colormap(value: float) -> tuple[float, float, float]:
	rgba = EMBER(value)
	return rich.color.Color.from_rgb(
		255 * rgba[0],
		255 * rgba[1],
		255 * rgba[2],
	)
```

And then print a `Heatmap` containing those cells:

```python
print(heatmap.Heatmap(cells=cells, colormap=colormap))
```

Row and column values will be sorted before printing, so you can
accumulate a stream of data and feed it in without any more trouble:

![Heatmap example image](images/numbers.png)

If you don't provide text, the library will produce rectangular cells:

![Heatmap example image](images/blobs.png)