hyperpopy


Namehyperpopy JSON
Version 0.1.2 PyPI version JSON
download
home_pageNone
SummaryPoisson Hyperplane Model Package
upload_time2025-09-10 21:12:56
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords poisson hyperplane geometry probability monte-carlo
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # hyperpopy: Poisson Hyperplane Model Package

[![PyPI version](https://badge.fury.io/py/hyperpopy.svg)](https://badge.fury.io/py/hyperpopy)
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A Python package for working with Poisson hyperplane models, providing tools for analytical calculations, generation, visualization, and Monte Carlo simulation of Poisson hyperplane processes.

## Features

- **Analytical Calculations**: Compute conditional probability functions for color in Poisson hyperplane models
- **Generation & Visualization**: Generate and plot realizations of the Poisson hyperplane process
- **Monte Carlo Simulation**: Estimate connectivity distributions and color probabilities
- **Probability Landscapes**: Visualize conditional probability functions and convergence analysis
- **Multi-dimensional Support**: Works in 1D, 2D, and 3D spaces

## Installation

```bash
pip install --upgrade hyperpopy
```

## Quick Start

```python
import hyperpopy
import numpy as np

# Calculate the arrival rate of a Poisson hyperplane process
rate_2d = hyperpopy.rate(2, 1.0)  # 2D, radius 1.0
print(f"2D Poisson rate: {rate_2d}")

# Generate a 2D visualization of the Poisson hyperplane process
fig = hyperpopy.plot_hyperplanes_color_2d(
    radius=10,
    grid_resolution=100,
    colorcutoffs=np.array([0.5]),
    cmap_list=hyperpopy.frozen_lake_colors
)

# Calculate color distribution for given points
points = np.array([[0, 0], [1, 0], [0, 1]])
colors = (0, 1, 0)  # Known colors for first two points
color_dist = (0.5, 0.5)  # Equal probability for each color

prob_dist = hyperpopy.color_distribution(points, colors, color_dist)
print(f"Color probabilities: {prob_dist}")
```

## Key Functions

### Analytical Utilities
- `rate(dimension, radius)`: Calculate Poisson hyperplane arrival rate
- `color_distribution(points, colors, color_dist)`: Compute conditional color probabilities
- `hitrate_1d/2d/3d(points)`: Calculate hit rates for convex hulls
- `slash_rates(points)`: Return rates of hyperplane partitions

### Generation & Visualization
- `sample_from_ball(dimension, num_points)`: Sample points from unit ball
- `plot_hyperplanes_color_2d()`: Generate 2D Poisson hyperplane visualizations
- `hyperplane_partition(points, gridpoints)`: Partition space using hyperplanes

### Monte Carlo Simulation
- `monte_carlo_hyperplane_partitions()`: Estimate connectivity distributions
- `plot_mc_colors_with_errorbars()`: Plot convergence with error bars
- `probability_landscape()`: Visualize probability landscapes in 2D/3D

## Examples

See the `examples/` directory for comprehensive examples including:
- Figure generation from research papers
- Monte Carlo convergence analysis
- Probability landscape visualization
- Chord length statistics

## Requirements

- Python 3.8+
- NumPy >= 1.20.0
- SciPy >= 1.7.0
- Matplotlib >= 3.3.0
- scikit-learn >= 1.0.0
- Numba >= 0.50.0

## Development

To install in development mode:

```bash
git clone https://github.com/AlecShelley/hyperpopy.git
cd hyperpopy
pip install -e .
```

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Citation

If you use this package in your research, please cite:

```bibtex
@software{hyperpopy2024,
  title={HyperPopy: Poisson Hyperplane Model Package},
  author={Alec Shelley},
  year={2024},
  url={https://github.com/AlecShelley/hyperpopy}
}
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## Links

- [GitHub Repository](https://github.com/AlecShelley/hyperpopy)
- [PyPI Package](https://pypi.org/project/hyperpopy/)
- [Issue Tracker](https://github.com/AlecShelley/hyperpopy/issues)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "hyperpopy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Alec Shelley <ams01@stanford.edu>",
    "keywords": "poisson, hyperplane, geometry, probability, monte-carlo",
    "author": null,
    "author_email": "Alec Shelley <ams01@stanford.edu>",
    "download_url": "https://files.pythonhosted.org/packages/f6/a0/4333b382d19b67c0d41e5b6a3ccfc9b4fdc36929d86321a2144b10cb06b1/hyperpopy-0.1.2.tar.gz",
    "platform": null,
    "description": "# hyperpopy: Poisson Hyperplane Model Package\r\n\r\n[![PyPI version](https://badge.fury.io/py/hyperpopy.svg)](https://badge.fury.io/py/hyperpopy)\r\n[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\r\n\r\nA Python package for working with Poisson hyperplane models, providing tools for analytical calculations, generation, visualization, and Monte Carlo simulation of Poisson hyperplane processes.\r\n\r\n## Features\r\n\r\n- **Analytical Calculations**: Compute conditional probability functions for color in Poisson hyperplane models\r\n- **Generation & Visualization**: Generate and plot realizations of the Poisson hyperplane process\r\n- **Monte Carlo Simulation**: Estimate connectivity distributions and color probabilities\r\n- **Probability Landscapes**: Visualize conditional probability functions and convergence analysis\r\n- **Multi-dimensional Support**: Works in 1D, 2D, and 3D spaces\r\n\r\n## Installation\r\n\r\n```bash\r\npip install --upgrade hyperpopy\r\n```\r\n\r\n## Quick Start\r\n\r\n```python\r\nimport hyperpopy\r\nimport numpy as np\r\n\r\n# Calculate the arrival rate of a Poisson hyperplane process\r\nrate_2d = hyperpopy.rate(2, 1.0)  # 2D, radius 1.0\r\nprint(f\"2D Poisson rate: {rate_2d}\")\r\n\r\n# Generate a 2D visualization of the Poisson hyperplane process\r\nfig = hyperpopy.plot_hyperplanes_color_2d(\r\n    radius=10,\r\n    grid_resolution=100,\r\n    colorcutoffs=np.array([0.5]),\r\n    cmap_list=hyperpopy.frozen_lake_colors\r\n)\r\n\r\n# Calculate color distribution for given points\r\npoints = np.array([[0, 0], [1, 0], [0, 1]])\r\ncolors = (0, 1, 0)  # Known colors for first two points\r\ncolor_dist = (0.5, 0.5)  # Equal probability for each color\r\n\r\nprob_dist = hyperpopy.color_distribution(points, colors, color_dist)\r\nprint(f\"Color probabilities: {prob_dist}\")\r\n```\r\n\r\n## Key Functions\r\n\r\n### Analytical Utilities\r\n- `rate(dimension, radius)`: Calculate Poisson hyperplane arrival rate\r\n- `color_distribution(points, colors, color_dist)`: Compute conditional color probabilities\r\n- `hitrate_1d/2d/3d(points)`: Calculate hit rates for convex hulls\r\n- `slash_rates(points)`: Return rates of hyperplane partitions\r\n\r\n### Generation & Visualization\r\n- `sample_from_ball(dimension, num_points)`: Sample points from unit ball\r\n- `plot_hyperplanes_color_2d()`: Generate 2D Poisson hyperplane visualizations\r\n- `hyperplane_partition(points, gridpoints)`: Partition space using hyperplanes\r\n\r\n### Monte Carlo Simulation\r\n- `monte_carlo_hyperplane_partitions()`: Estimate connectivity distributions\r\n- `plot_mc_colors_with_errorbars()`: Plot convergence with error bars\r\n- `probability_landscape()`: Visualize probability landscapes in 2D/3D\r\n\r\n## Examples\r\n\r\nSee the `examples/` directory for comprehensive examples including:\r\n- Figure generation from research papers\r\n- Monte Carlo convergence analysis\r\n- Probability landscape visualization\r\n- Chord length statistics\r\n\r\n## Requirements\r\n\r\n- Python 3.8+\r\n- NumPy >= 1.20.0\r\n- SciPy >= 1.7.0\r\n- Matplotlib >= 3.3.0\r\n- scikit-learn >= 1.0.0\r\n- Numba >= 0.50.0\r\n\r\n## Development\r\n\r\nTo install in development mode:\r\n\r\n```bash\r\ngit clone https://github.com/AlecShelley/hyperpopy.git\r\ncd hyperpopy\r\npip install -e .\r\n```\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n## Citation\r\n\r\nIf you use this package in your research, please cite:\r\n\r\n```bibtex\r\n@software{hyperpopy2024,\r\n  title={HyperPopy: Poisson Hyperplane Model Package},\r\n  author={Alec Shelley},\r\n  year={2024},\r\n  url={https://github.com/AlecShelley/hyperpopy}\r\n}\r\n```\r\n\r\n## Contributing\r\n\r\nContributions are welcome! Please feel free to submit a Pull Request.\r\n\r\n## Links\r\n\r\n- [GitHub Repository](https://github.com/AlecShelley/hyperpopy)\r\n- [PyPI Package](https://pypi.org/project/hyperpopy/)\r\n- [Issue Tracker](https://github.com/AlecShelley/hyperpopy/issues)\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Poisson Hyperplane Model Package",
    "version": "0.1.2",
    "project_urls": {
        "Homepage": "https://github.com/AlecShelley/hyperpopy",
        "Issues": "https://github.com/AlecShelley/hyperpopy/issues",
        "Repository": "https://github.com/AlecShelley/hyperpopy"
    },
    "split_keywords": [
        "poisson",
        " hyperplane",
        " geometry",
        " probability",
        " monte-carlo"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3f0c42171556c840d14dcb359b0d2ee79e3506e6862917a1270c61fa08def252",
                "md5": "1f84371453ece189623a56675fdd853e",
                "sha256": "5153ab7b1ceaf3feb906fb865a29b5ba933a826db4728141ba2a716ba956b5b2"
            },
            "downloads": -1,
            "filename": "hyperpopy-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1f84371453ece189623a56675fdd853e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 23853,
            "upload_time": "2025-09-10T21:12:54",
            "upload_time_iso_8601": "2025-09-10T21:12:54.544603Z",
            "url": "https://files.pythonhosted.org/packages/3f/0c/42171556c840d14dcb359b0d2ee79e3506e6862917a1270c61fa08def252/hyperpopy-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f6a04333b382d19b67c0d41e5b6a3ccfc9b4fdc36929d86321a2144b10cb06b1",
                "md5": "50cf91e8a05e48fab20d8810139d9b4a",
                "sha256": "b39482a1a1b9a6bb41a872f32d9c5c25cf83d9d88135b004485435b108b7c8b7"
            },
            "downloads": -1,
            "filename": "hyperpopy-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "50cf91e8a05e48fab20d8810139d9b4a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 24016,
            "upload_time": "2025-09-10T21:12:56",
            "upload_time_iso_8601": "2025-09-10T21:12:56.062030Z",
            "url": "https://files.pythonhosted.org/packages/f6/a0/4333b382d19b67c0d41e5b6a3ccfc9b4fdc36929d86321a2144b10cb06b1/hyperpopy-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-10 21:12:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "AlecShelley",
    "github_project": "hyperpopy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "hyperpopy"
}
        
Elapsed time: 1.21533s