semvec/pypi-packages huggingface dataset:
vsup 0.1.0
Value-Suppressing Uncertainty Palettes for Python
Requires Python: >=3.8

# VSUP: Value-Suppressing Uncertainty Palettes

A Python package for visualizing data with uncertainty using Value-Suppressing Uncertainty Palettes (VSUPs). Inspired by https://github.com/uwdata/vsup.

## Installation
Coming soon...

### Development

The project is developed with [uv](https://docs.astral.sh/uv/).

To check for a local python environment, run:

```bash
uv run python
```

Also install the [pre-commit](https://pre-commit.com/) hooks with:

```bash
uv tool install pre-commit
pre-commit install
```

## Usage

```python
from vsup import VSUP
import numpy as np
import matplotlib.pyplot as plt

# Create a grid of values and uncertainties for better visualization
n_points = 50
step = 1/n_points
values = np.linspace(step/2, 1-step/2, n_points)
uncertainties = np.linspace(step/2, 1-step/2, n_points)

# Create a 2D grid
values, uncertainties = np.meshgrid(values, uncertainties)

# Colorize the data
axs = plt.subplots(3, 3, figsize=(9, 9))[1]

for row, quantization in zip(axs, [None, 'linear','tree']):
    for ax, mode in zip(row, ["us", "ul", "usl"]):

        vsup = VSUP(palette='flare', mode=mode, quantization=quantization)

        colors = vsup(values, uncertainties)
        ax.pcolormesh(values, uncertainties, colors)
        # ax.set_title(f"{mode}")  #\n({description})")
        ax.set_xlabel("Value")
        ax.set_ylabel("Uncertainty")
```
![flare example](examples/flare_example.png)

## Features

- Three visualization modes:
  - USL: Uncertainty mapped to Saturation (chroma) and Lightness
  - US: Uncertainty mapped to Saturation
  - UL: Uncertainty mapped to Lightness
- Two quantization mods:
  - Linear: independent binning of values and uncertainties
  - Tree: value bins depend on uncertainty bin: lower uncertainty, higher value resolution
- Support for any matplotlib and seaborn colormaps

## Citation

If you use this package in your research, please cite the original VSUP paper:

```
@inproceedings{2018-uncertainty-palettes,
 title = {Value-Suppressing Uncertainty Palettes},
 author = {Michael Correll AND Dominik Moritz AND Jeffrey Heer},
 booktitle = {ACM Human Factors in Computing Systems (CHI)},
 year = {2018},
 url = {http://idl.cs.washington.edu/papers/uncertainty-palettes},
}
```

## License

MIT License
TwoPy 1.0.8
Python project builder with encryption capability.
Requires Python: >=3.7

# Install
```shell
pip install TwoPy==version
```


## Example
```python
import argparse
import os
from TwoPy import PythonProjectBuilder

def main():
    parser = argparse.ArgumentParser(description="TwoPy")
    parser.add_argument(
        "project_path",
        nargs='?',
        default="src"
    )
    parser.add_argument("--rename", nargs='*')
    parser.add_argument("--move", nargs='*')
    parser.add_argument("--output", default="project.zip")
    parser.add_argument("--encrypt", action='store_false')
    parser.add_argument("--encrypted_output", default="project.enc")

    args = parser.parse_args()

    if not os.path.exists(args.project_path):
        print(f"Error: Project path '{args.project_path}' not found!")
        return

    builder = PythonProjectBuilder(args.project_path)

    rename_map = {}
    if args.rename:
        for pair in args.rename:
            if "=" in pair:
                old, new = pair.split("=", 1)
                rename_map[old] = new
            else:
                print(f"Invalid rename format: {pair}")

    move_map = {}
    if args.move:
        for pair in args.move:
            if "=" in pair:
                item, new_path = pair.split("=", 1)
                move_map[item] = new_path
            else:
                print(f"Invalid move format: {pair}")

    builder.adapt_structure(rename_map=rename_map, move_map=move_map)
    builder.compress(args.output)

    if args.encrypt:
        key = builder.encrypt(args.output, args.encrypted_output)
        print(f"Decryption key: {key.decode()}")

    builder.cleanup()

if __name__ == "__main__":
    main()
```



### ChangeLog

> [!NOTE] 1.0.0
> - First version