piblin-jax


Namepiblin-jax JSON
Version 0.0.3 PyPI version JSON
download
home_pageNone
SummaryModern JAX-Powered Framework for Measurement Data Science
upload_time2025-10-24 06:18:31
maintainerNone
docs_urlNone
authorNone
requires_python>=3.12
licenseMIT
keywords scientific-computing data-analysis rheology jax bayesian-inference uncertainty-quantification
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # piblin-jax

**Modern JAX-Powered Framework for Measurement Data Science**

[![Python Version](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

---

> **Acknowledgement**: piblin-jax is an enhanced fork of [piblin](https://github.com/3mcloud/piblin) by 3M. We gratefully acknowledge the original piblin project for establishing the foundational concepts and API design that piblin-jax builds upon. piblin-jax extends piblin with JAX-powered performance improvements, advanced Bayesian inference capabilities, and modern Python features while maintaining backward compatibility.

---

## Overview

**piblin-jax** is a high-performance framework for measurement data science, providing a complete reimplementation of piblin with dramatic performance improvements and advanced Bayesian uncertainty quantification capabilities.

Built on JAX, piblin-jax delivers 5-10x CPU speedup and 50-100x GPU acceleration while maintaining 100% backward compatibility with piblin. Whether you're analyzing rheological data, performing uncertainty quantification, or building complex data transformation pipelines, piblin-jax provides the tools you need with modern Python ergonomics.

## Key Features

- **JAX-Powered Performance**: Leverage automatic differentiation and GPU/TPU acceleration
  - 5-10x speedup on CPU compared to piblin
  - 50-100x speedup on GPU for large datasets
  - Automatic JIT compilation for optimized execution

- **Bayesian Uncertainty Quantification**: Rigorous statistical inference with NumPyro
  - Built-in rheological models (Power Law, Arrhenius, Cross, Carreau-Yasuda)
  - Full posterior distributions for parameter estimates
  - Uncertainty propagation through transformations

- **100% piblin Compatibility**: Drop-in replacement for existing code
  ```python
  import piblin_jax as piblin  # Just change the import!
  ```

- **Modern Python 3.12+**: Type-safe, functional programming approach
  - Runtime: Python 3.12+ supported
  - Development: Python 3.13+ required for pre-commit hooks
  - Comprehensive type hints throughout
  - NumPy-style docstrings
  - Immutable data structures

- **Flexible Transform Pipeline**: Composable data transformations
  - Dataset transformations (smoothing, interpolation, calculus)
  - Region-based operations
  - Custom lambda transforms
  - Pipeline composition and reuse

- **Rich Data Structures**: Hierarchical data organization
  - Datasets (0D, 1D, 2D, 3D, composite, distributions)
  - Measurements and measurement sets
  - Experiments and experiment sets
  - Metadata and provenance tracking

## Installation

### Basic Installation

Install piblin-jax with JAX CPU support using pip:

```bash
pip install piblin-jax
```

**Note**: The package name is `piblin-jax` on PyPI, and you import it as `piblin_jax`:

```python
import piblin_jax  # Package installation: pip install piblin-jax
# or for piblin compatibility:
import piblin_jax as piblin
```

### GPU Support (Linux + CUDA 12+ Only)

**Platform Constraints:**
- ✅ **Linux + NVIDIA GPU + CUDA 12**: Full GPU acceleration (50-100x speedup)
- ❌ **macOS**: CPU backend only (no NVIDIA GPU support, still 5-10x faster than piblin)
- ❌ **Windows**: CPU backend only (CUDA support experimental/unstable in JAX)

**Requirements for GPU Acceleration:**
- Linux operating system
- NVIDIA GPU with CUDA Compute Capability 7.5 or newer
- CUDA 12.1-12.9 installed on system
- NVIDIA driver >= 525

**Performance Impact:** 50-100x speedup for large datasets (>1M points)

---

#### ✅ Recommended: Makefile Installation (All Package Managers)

**From repository (works with pip, uv, conda/mamba):**

```bash
git clone https://github.com/piblin/piblin-jax.git
cd piblin-jax
make init
make install-gpu-cuda  # Handles everything automatically
```

This single command:
- ✓ Validates platform (Linux only)
- ✓ Detects package manager (uv/conda/pip)
- ✓ Uninstalls CPU-only JAX
- ✓ Installs GPU-enabled JAX with CUDA 12
- ✓ Verifies GPU detection
- ✓ Shows installation summary

---

#### ⚙️ Manual Installation (Advanced Users)

**Why manual installation requires uninstall:** JAX has separate CPU and GPU builds. You MUST remove the CPU build before installing GPU to prevent silent failures where you think you have GPU but are actually using CPU.

**Using pip:**
```bash
# Step 1: Uninstall CPU-only version (REQUIRED - prevents conflicts)
pip uninstall -y jax jaxlib

# Step 2: Install GPU-enabled JAX
pip install "jax[cuda12-local]>=0.8.0,<0.9.0"

# Step 3: Install piblin-jax (if not already installed)
pip install piblin-jax

# Step 4: Verify GPU detection
python -c "import jax; print('Devices:', jax.devices())"
# Expected: [cuda(id=0)] NOT [CpuDevice(id=0)]
```

**Using uv:**
```bash
uv pip uninstall -y jax jaxlib
uv pip install "jax[cuda12-local]>=0.8.0,<0.9.0"
python -c "import jax; print(jax.devices())"
```

**Using conda/mamba:**

Option A: Using environment file (recommended):
```bash
# Using conda
conda env create -f environment-gpu.yml
conda activate piblin-jax-gpu

# Using mamba (faster)
mamba env create -f environment-gpu.yml
mamba activate piblin-jax-gpu
```

Option B: Manual within conda environment:
```bash
conda activate your-env
pip uninstall -y jax jaxlib
pip install "jax[cuda12-local]>=0.8.0,<0.9.0"
```

**Note:** Conda's extras syntax is not supported. Always use pip within your conda environment for JAX GPU installation.

---

#### 🔍 Verify GPU Installation

After installation, verify GPU is detected:

```bash
python -c "from piblin_jax.backend import get_device_info; print(get_device_info())"
```

**Expected output:**
```python
{'backend': 'jax', 'device_type': 'gpu', 'device_count': 1, ...}
```

**If you see `'device_type': 'cpu'`**, GPU installation failed. See troubleshooting below.

---

#### 🔧 Troubleshooting

**Issue: "GPU not detected" warning or `device_type: 'cpu'`**

```bash
# 1. Check GPU hardware
nvidia-smi  # Should show your GPU

# 2. Check CUDA version (need 12.1-12.9)
nvcc --version

# 3. Verify JAX sees GPU
python -c "import jax; print(jax.devices())"
# Expected: [cuda(id=0)]
# If showing: [CpuDevice(id=0)] → JAX is using CPU

# 4. If still CPU, reinstall with explicit uninstall:
pip uninstall -y jax jaxlib
pip install "jax[cuda12-local]>=0.8.0,<0.9.0"
```

**Issue: ImportError or "CUDA library not found"**

```bash
# Set CUDA library path
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

# Make permanent (add to ~/.bashrc)
echo 'export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH' >> ~/.bashrc
source ~/.bashrc
```

**Issue: "An NVIDIA GPU may be present... but a CUDA-enabled jaxlib is not installed"**

This means you have GPU hardware but CPU-only JAX. Solution:
```bash
pip uninstall -y jax jaxlib
pip install "jax[cuda12-local]>=0.8.0,<0.9.0"
```

**Issue: Works in one environment but not another**

Different package managers may install different versions. Always use the same installation method:
- **Development**: `make install-gpu-cuda` (recommended)
- **Production**: Docker with explicit JAX version
- **Notebooks**: Manual pip installation with version pinning

**Note**: The package name on PyPI is `piblin-jax`, and the import name is `piblin_jax`.

### Development Installation

**Prerequisites:**
- **Runtime**: Python 3.12+ supported
- **Development**: Python 3.13+ required (for pre-commit hooks)
- **Package Manager**: uv recommended for development (not pip or conda)

For development with all optional dependencies:

```bash
git clone https://github.com/piblin/piblin-jax.git
cd piblin-jax

# Using uv (recommended for development)
uv pip install -e ".[dev]"

# Or using pip
pip install -e ".[dev]"
```

## Quick Start

### Basic Usage

```python
import piblin_jax

# Read experimental data
data = piblin_jax.read_file('experiment.csv')

# Create a transform pipeline
from piblin_jax.transform import Pipeline, Interpolate1D, GaussianSmoothing

pipeline = Pipeline([
    Interpolate1D(new_x=new_points),
    GaussianSmoothing(sigma=2.0)
])

# Apply transformations
result = pipeline.apply_to(data)

# Visualize results
result.visualize()
```

### Bayesian Parameter Estimation

```python
from piblin_jax.bayesian import PowerLawModel
import numpy as np

# Your experimental data
shear_rate = np.array([0.1, 1.0, 10.0, 100.0])
viscosity = np.array([50.0, 15.8, 5.0, 1.58])

# Fit power-law model with uncertainty quantification
model = PowerLawModel(n_samples=2000, n_warmup=1000)
model.fit(shear_rate, viscosity)

# Get parameter estimates with credible intervals
summary = model.summary()
print(summary)

# Make predictions with uncertainty
new_shear_rate = np.logspace(-1, 2, 50)
predictions = model.predict(new_shear_rate)

# Visualize fit with uncertainty
model.plot_fit(shear_rate, viscosity, show_uncertainty=True)
```

### piblin Migration

Migrating from piblin is seamless:

```python
# Old code
import piblin
data = piblin.read_file('data.csv')

# New code - just change the import!
import piblin_jax as piblin
data = piblin.read_file('data.csv')
# All your existing piblin code works unchanged
```

## Performance Comparison

| Operation | piblin (CPU) | piblin-jax (CPU) | piblin-jax (GPU) | Speedup (GPU) |
|-----------|--------------|---------------|---------------|---------------|
| Dataset creation | 180 μs | 70 μs | - | 2.6x |
| Gaussian smoothing | 2000 μs | 1100 μs | 50 μs | 40x |
| Pipeline execution | 5 ms | 1.2 ms | 100 μs | 50x |
| Bayesian fitting | 45 s | 4.5 s | 0.5 s | 90x |

*Benchmarks on M1 Max (CPU) and NVIDIA A100 (GPU)*

## Documentation

Full documentation is available at [piblin-jax.readthedocs.io](https://piblin-jax.readthedocs.io)

- [Installation Guide](https://piblin-jax.readthedocs.io/en/latest/user_guide/installation.html)
- [Quick Start Tutorial](https://piblin-jax.readthedocs.io/en/latest/user_guide/quickstart.html)
- [Core Concepts](https://piblin-jax.readthedocs.io/en/latest/user_guide/concepts.html)
- [API Reference](https://piblin-jax.readthedocs.io/en/latest/api/)
- [Examples](https://piblin-jax.readthedocs.io/en/latest/tutorials/)

## Examples

Explore complete, runnable examples in the [`examples/`](examples/) directory:

- **basic_usage_example.py** - Core workflow: data loading, transforms, visualization
- **transform_pipeline_example.py** - Composable transform pipelines
- **bayesian_rheological_models.py** - Rheological model fitting (Power Law, Cross, Carreau-Yasuda, Arrhenius)
- **bayesian_parameter_estimation.py** - Advanced Bayesian inference techniques
- **uncertainty_propagation_example.py** - Propagating uncertainty through pipelines
- **piblin_migration_example.py** - Migrating from piblin to piblin-jax
- **gpu_acceleration_example.py** - Leveraging GPU for 10-100x speedups (Linux + CUDA 12+ only)
- **custom_transforms_example.py** - Building domain-specific transforms

Each example is fully documented and can be run directly:

```bash
cd examples
python basic_usage_example.py
```

See [`examples/README.md`](examples/README.md) for detailed descriptions and usage instructions.

## Development

### Prerequisites

**Python Version Requirements:**
- **Runtime**: Python 3.12+ supported for using the library
- **Development**: Python 3.13+ required for pre-commit hooks

**Package Manager:**
- **Recommended**: uv (not pip or conda) for development
- **User Installation**: pip is fine for end users

### Setup Development Environment

```bash
# Verify Python 3.13+ is available
python3.13 --version

# Clone and install in development mode with uv (recommended)
git clone https://github.com/piblin/piblin-jax.git
cd piblin-jax
uv pip install -e ".[dev]"

# Or with pip
pip install -e ".[dev]"

# Install pre-commit hooks (requires Python 3.13+)
pre-commit install
```

### Running Tests

```bash
# Run all tests
pytest

# Run with coverage
pytest --cov=piblin_jax --cov-report=html

# Run only fast tests (skip slow/GPU tests)
pytest -m "not slow and not gpu"

# Run benchmarks
pytest -m benchmark
```

### Code Quality

piblin-jax maintains high code quality standards:

- **Test Coverage**: >95% required
- **Type Checking**: mypy strict mode
- **Code Formatting & Linting**: ruff (line length 100, 10-100x faster than legacy tools)
- **Documentation**: NumPy-style docstrings

Pre-commit hooks enforce these standards automatically.

## Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

**Quick Contribution Checklist:**
- Tests pass with >95% coverage
- Type hints added
- NumPy-style docstrings
- Pre-commit hooks pass
- Documentation updated

## Roadmap

- [x] Core data structures and transforms
- [x] JAX backend with automatic differentiation
- [x] NumPyro Bayesian inference integration
- [x] piblin compatibility layer
- [ ] Additional rheological models
- [ ] Time series analysis tools
- [ ] Advanced visualization capabilities
- [ ] Distributed computing support
- [ ] Real-time data acquisition integration

## Citation

If you use piblin-jax in your research, please cite:

```bibtex
@software{piblin_jax2025,
  author = {Chen, Wei},
  title = {piblin-jax: Modern JAX-Powered Framework for Measurement Data Science},
  year = {2025},
  url = {https://github.com/piblin/piblin-jax}
}
```

## License

piblin-jax is licensed under the [MIT License](LICENSE).

## Acknowledgments

- Forked from [piblin](https://github.com/3mcloud/piblin) by 3M - the original framework for measurement data science
- Built on [JAX](https://github.com/google/jax) for high-performance numerical computing
- Uses [NumPyro](https://github.com/pyro-ppl/numpyro) for Bayesian inference

## Support

- **Documentation**: [piblin-jax.readthedocs.io](https://piblin-jax.readthedocs.io)
- **Issues**: [GitHub Issues](https://github.com/piblin/piblin-jax/issues)
- **Discussions**: [GitHub Discussions](https://github.com/piblin/piblin-jax/discussions)

---

Made with ❤️ by Wei Chen and the piblin-jax developers

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "piblin-jax",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": null,
    "keywords": "scientific-computing, data-analysis, rheology, jax, bayesian-inference, uncertainty-quantification",
    "author": null,
    "author_email": "Wei Chen <wchen@anl.gov>",
    "download_url": "https://files.pythonhosted.org/packages/ed/ea/96b8a3a963f378476e5b27e142a5ec78bdb1024eb0d33c9cc8915685841b/piblin_jax-0.0.3.tar.gz",
    "platform": null,
    "description": "# piblin-jax\n\n**Modern JAX-Powered Framework for Measurement Data Science**\n\n[![Python Version](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n\n---\n\n> **Acknowledgement**: piblin-jax is an enhanced fork of [piblin](https://github.com/3mcloud/piblin) by 3M. We gratefully acknowledge the original piblin project for establishing the foundational concepts and API design that piblin-jax builds upon. piblin-jax extends piblin with JAX-powered performance improvements, advanced Bayesian inference capabilities, and modern Python features while maintaining backward compatibility.\n\n---\n\n## Overview\n\n**piblin-jax** is a high-performance framework for measurement data science, providing a complete reimplementation of piblin with dramatic performance improvements and advanced Bayesian uncertainty quantification capabilities.\n\nBuilt on JAX, piblin-jax delivers 5-10x CPU speedup and 50-100x GPU acceleration while maintaining 100% backward compatibility with piblin. Whether you're analyzing rheological data, performing uncertainty quantification, or building complex data transformation pipelines, piblin-jax provides the tools you need with modern Python ergonomics.\n\n## Key Features\n\n- **JAX-Powered Performance**: Leverage automatic differentiation and GPU/TPU acceleration\n  - 5-10x speedup on CPU compared to piblin\n  - 50-100x speedup on GPU for large datasets\n  - Automatic JIT compilation for optimized execution\n\n- **Bayesian Uncertainty Quantification**: Rigorous statistical inference with NumPyro\n  - Built-in rheological models (Power Law, Arrhenius, Cross, Carreau-Yasuda)\n  - Full posterior distributions for parameter estimates\n  - Uncertainty propagation through transformations\n\n- **100% piblin Compatibility**: Drop-in replacement for existing code\n  ```python\n  import piblin_jax as piblin  # Just change the import!\n  ```\n\n- **Modern Python 3.12+**: Type-safe, functional programming approach\n  - Runtime: Python 3.12+ supported\n  - Development: Python 3.13+ required for pre-commit hooks\n  - Comprehensive type hints throughout\n  - NumPy-style docstrings\n  - Immutable data structures\n\n- **Flexible Transform Pipeline**: Composable data transformations\n  - Dataset transformations (smoothing, interpolation, calculus)\n  - Region-based operations\n  - Custom lambda transforms\n  - Pipeline composition and reuse\n\n- **Rich Data Structures**: Hierarchical data organization\n  - Datasets (0D, 1D, 2D, 3D, composite, distributions)\n  - Measurements and measurement sets\n  - Experiments and experiment sets\n  - Metadata and provenance tracking\n\n## Installation\n\n### Basic Installation\n\nInstall piblin-jax with JAX CPU support using pip:\n\n```bash\npip install piblin-jax\n```\n\n**Note**: The package name is `piblin-jax` on PyPI, and you import it as `piblin_jax`:\n\n```python\nimport piblin_jax  # Package installation: pip install piblin-jax\n# or for piblin compatibility:\nimport piblin_jax as piblin\n```\n\n### GPU Support (Linux + CUDA 12+ Only)\n\n**Platform Constraints:**\n- \u2705 **Linux + NVIDIA GPU + CUDA 12**: Full GPU acceleration (50-100x speedup)\n- \u274c **macOS**: CPU backend only (no NVIDIA GPU support, still 5-10x faster than piblin)\n- \u274c **Windows**: CPU backend only (CUDA support experimental/unstable in JAX)\n\n**Requirements for GPU Acceleration:**\n- Linux operating system\n- NVIDIA GPU with CUDA Compute Capability 7.5 or newer\n- CUDA 12.1-12.9 installed on system\n- NVIDIA driver >= 525\n\n**Performance Impact:** 50-100x speedup for large datasets (>1M points)\n\n---\n\n#### \u2705 Recommended: Makefile Installation (All Package Managers)\n\n**From repository (works with pip, uv, conda/mamba):**\n\n```bash\ngit clone https://github.com/piblin/piblin-jax.git\ncd piblin-jax\nmake init\nmake install-gpu-cuda  # Handles everything automatically\n```\n\nThis single command:\n- \u2713 Validates platform (Linux only)\n- \u2713 Detects package manager (uv/conda/pip)\n- \u2713 Uninstalls CPU-only JAX\n- \u2713 Installs GPU-enabled JAX with CUDA 12\n- \u2713 Verifies GPU detection\n- \u2713 Shows installation summary\n\n---\n\n#### \u2699\ufe0f Manual Installation (Advanced Users)\n\n**Why manual installation requires uninstall:** JAX has separate CPU and GPU builds. You MUST remove the CPU build before installing GPU to prevent silent failures where you think you have GPU but are actually using CPU.\n\n**Using pip:**\n```bash\n# Step 1: Uninstall CPU-only version (REQUIRED - prevents conflicts)\npip uninstall -y jax jaxlib\n\n# Step 2: Install GPU-enabled JAX\npip install \"jax[cuda12-local]>=0.8.0,<0.9.0\"\n\n# Step 3: Install piblin-jax (if not already installed)\npip install piblin-jax\n\n# Step 4: Verify GPU detection\npython -c \"import jax; print('Devices:', jax.devices())\"\n# Expected: [cuda(id=0)] NOT [CpuDevice(id=0)]\n```\n\n**Using uv:**\n```bash\nuv pip uninstall -y jax jaxlib\nuv pip install \"jax[cuda12-local]>=0.8.0,<0.9.0\"\npython -c \"import jax; print(jax.devices())\"\n```\n\n**Using conda/mamba:**\n\nOption A: Using environment file (recommended):\n```bash\n# Using conda\nconda env create -f environment-gpu.yml\nconda activate piblin-jax-gpu\n\n# Using mamba (faster)\nmamba env create -f environment-gpu.yml\nmamba activate piblin-jax-gpu\n```\n\nOption B: Manual within conda environment:\n```bash\nconda activate your-env\npip uninstall -y jax jaxlib\npip install \"jax[cuda12-local]>=0.8.0,<0.9.0\"\n```\n\n**Note:** Conda's extras syntax is not supported. Always use pip within your conda environment for JAX GPU installation.\n\n---\n\n#### \ud83d\udd0d Verify GPU Installation\n\nAfter installation, verify GPU is detected:\n\n```bash\npython -c \"from piblin_jax.backend import get_device_info; print(get_device_info())\"\n```\n\n**Expected output:**\n```python\n{'backend': 'jax', 'device_type': 'gpu', 'device_count': 1, ...}\n```\n\n**If you see `'device_type': 'cpu'`**, GPU installation failed. See troubleshooting below.\n\n---\n\n#### \ud83d\udd27 Troubleshooting\n\n**Issue: \"GPU not detected\" warning or `device_type: 'cpu'`**\n\n```bash\n# 1. Check GPU hardware\nnvidia-smi  # Should show your GPU\n\n# 2. Check CUDA version (need 12.1-12.9)\nnvcc --version\n\n# 3. Verify JAX sees GPU\npython -c \"import jax; print(jax.devices())\"\n# Expected: [cuda(id=0)]\n# If showing: [CpuDevice(id=0)] \u2192 JAX is using CPU\n\n# 4. If still CPU, reinstall with explicit uninstall:\npip uninstall -y jax jaxlib\npip install \"jax[cuda12-local]>=0.8.0,<0.9.0\"\n```\n\n**Issue: ImportError or \"CUDA library not found\"**\n\n```bash\n# Set CUDA library path\nexport LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH\n\n# Make permanent (add to ~/.bashrc)\necho 'export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH' >> ~/.bashrc\nsource ~/.bashrc\n```\n\n**Issue: \"An NVIDIA GPU may be present... but a CUDA-enabled jaxlib is not installed\"**\n\nThis means you have GPU hardware but CPU-only JAX. Solution:\n```bash\npip uninstall -y jax jaxlib\npip install \"jax[cuda12-local]>=0.8.0,<0.9.0\"\n```\n\n**Issue: Works in one environment but not another**\n\nDifferent package managers may install different versions. Always use the same installation method:\n- **Development**: `make install-gpu-cuda` (recommended)\n- **Production**: Docker with explicit JAX version\n- **Notebooks**: Manual pip installation with version pinning\n\n**Note**: The package name on PyPI is `piblin-jax`, and the import name is `piblin_jax`.\n\n### Development Installation\n\n**Prerequisites:**\n- **Runtime**: Python 3.12+ supported\n- **Development**: Python 3.13+ required (for pre-commit hooks)\n- **Package Manager**: uv recommended for development (not pip or conda)\n\nFor development with all optional dependencies:\n\n```bash\ngit clone https://github.com/piblin/piblin-jax.git\ncd piblin-jax\n\n# Using uv (recommended for development)\nuv pip install -e \".[dev]\"\n\n# Or using pip\npip install -e \".[dev]\"\n```\n\n## Quick Start\n\n### Basic Usage\n\n```python\nimport piblin_jax\n\n# Read experimental data\ndata = piblin_jax.read_file('experiment.csv')\n\n# Create a transform pipeline\nfrom piblin_jax.transform import Pipeline, Interpolate1D, GaussianSmoothing\n\npipeline = Pipeline([\n    Interpolate1D(new_x=new_points),\n    GaussianSmoothing(sigma=2.0)\n])\n\n# Apply transformations\nresult = pipeline.apply_to(data)\n\n# Visualize results\nresult.visualize()\n```\n\n### Bayesian Parameter Estimation\n\n```python\nfrom piblin_jax.bayesian import PowerLawModel\nimport numpy as np\n\n# Your experimental data\nshear_rate = np.array([0.1, 1.0, 10.0, 100.0])\nviscosity = np.array([50.0, 15.8, 5.0, 1.58])\n\n# Fit power-law model with uncertainty quantification\nmodel = PowerLawModel(n_samples=2000, n_warmup=1000)\nmodel.fit(shear_rate, viscosity)\n\n# Get parameter estimates with credible intervals\nsummary = model.summary()\nprint(summary)\n\n# Make predictions with uncertainty\nnew_shear_rate = np.logspace(-1, 2, 50)\npredictions = model.predict(new_shear_rate)\n\n# Visualize fit with uncertainty\nmodel.plot_fit(shear_rate, viscosity, show_uncertainty=True)\n```\n\n### piblin Migration\n\nMigrating from piblin is seamless:\n\n```python\n# Old code\nimport piblin\ndata = piblin.read_file('data.csv')\n\n# New code - just change the import!\nimport piblin_jax as piblin\ndata = piblin.read_file('data.csv')\n# All your existing piblin code works unchanged\n```\n\n## Performance Comparison\n\n| Operation | piblin (CPU) | piblin-jax (CPU) | piblin-jax (GPU) | Speedup (GPU) |\n|-----------|--------------|---------------|---------------|---------------|\n| Dataset creation | 180 \u03bcs | 70 \u03bcs | - | 2.6x |\n| Gaussian smoothing | 2000 \u03bcs | 1100 \u03bcs | 50 \u03bcs | 40x |\n| Pipeline execution | 5 ms | 1.2 ms | 100 \u03bcs | 50x |\n| Bayesian fitting | 45 s | 4.5 s | 0.5 s | 90x |\n\n*Benchmarks on M1 Max (CPU) and NVIDIA A100 (GPU)*\n\n## Documentation\n\nFull documentation is available at [piblin-jax.readthedocs.io](https://piblin-jax.readthedocs.io)\n\n- [Installation Guide](https://piblin-jax.readthedocs.io/en/latest/user_guide/installation.html)\n- [Quick Start Tutorial](https://piblin-jax.readthedocs.io/en/latest/user_guide/quickstart.html)\n- [Core Concepts](https://piblin-jax.readthedocs.io/en/latest/user_guide/concepts.html)\n- [API Reference](https://piblin-jax.readthedocs.io/en/latest/api/)\n- [Examples](https://piblin-jax.readthedocs.io/en/latest/tutorials/)\n\n## Examples\n\nExplore complete, runnable examples in the [`examples/`](examples/) directory:\n\n- **basic_usage_example.py** - Core workflow: data loading, transforms, visualization\n- **transform_pipeline_example.py** - Composable transform pipelines\n- **bayesian_rheological_models.py** - Rheological model fitting (Power Law, Cross, Carreau-Yasuda, Arrhenius)\n- **bayesian_parameter_estimation.py** - Advanced Bayesian inference techniques\n- **uncertainty_propagation_example.py** - Propagating uncertainty through pipelines\n- **piblin_migration_example.py** - Migrating from piblin to piblin-jax\n- **gpu_acceleration_example.py** - Leveraging GPU for 10-100x speedups (Linux + CUDA 12+ only)\n- **custom_transforms_example.py** - Building domain-specific transforms\n\nEach example is fully documented and can be run directly:\n\n```bash\ncd examples\npython basic_usage_example.py\n```\n\nSee [`examples/README.md`](examples/README.md) for detailed descriptions and usage instructions.\n\n## Development\n\n### Prerequisites\n\n**Python Version Requirements:**\n- **Runtime**: Python 3.12+ supported for using the library\n- **Development**: Python 3.13+ required for pre-commit hooks\n\n**Package Manager:**\n- **Recommended**: uv (not pip or conda) for development\n- **User Installation**: pip is fine for end users\n\n### Setup Development Environment\n\n```bash\n# Verify Python 3.13+ is available\npython3.13 --version\n\n# Clone and install in development mode with uv (recommended)\ngit clone https://github.com/piblin/piblin-jax.git\ncd piblin-jax\nuv pip install -e \".[dev]\"\n\n# Or with pip\npip install -e \".[dev]\"\n\n# Install pre-commit hooks (requires Python 3.13+)\npre-commit install\n```\n\n### Running Tests\n\n```bash\n# Run all tests\npytest\n\n# Run with coverage\npytest --cov=piblin_jax --cov-report=html\n\n# Run only fast tests (skip slow/GPU tests)\npytest -m \"not slow and not gpu\"\n\n# Run benchmarks\npytest -m benchmark\n```\n\n### Code Quality\n\npiblin-jax maintains high code quality standards:\n\n- **Test Coverage**: >95% required\n- **Type Checking**: mypy strict mode\n- **Code Formatting & Linting**: ruff (line length 100, 10-100x faster than legacy tools)\n- **Documentation**: NumPy-style docstrings\n\nPre-commit hooks enforce these standards automatically.\n\n## Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n**Quick Contribution Checklist:**\n- Tests pass with >95% coverage\n- Type hints added\n- NumPy-style docstrings\n- Pre-commit hooks pass\n- Documentation updated\n\n## Roadmap\n\n- [x] Core data structures and transforms\n- [x] JAX backend with automatic differentiation\n- [x] NumPyro Bayesian inference integration\n- [x] piblin compatibility layer\n- [ ] Additional rheological models\n- [ ] Time series analysis tools\n- [ ] Advanced visualization capabilities\n- [ ] Distributed computing support\n- [ ] Real-time data acquisition integration\n\n## Citation\n\nIf you use piblin-jax in your research, please cite:\n\n```bibtex\n@software{piblin_jax2025,\n  author = {Chen, Wei},\n  title = {piblin-jax: Modern JAX-Powered Framework for Measurement Data Science},\n  year = {2025},\n  url = {https://github.com/piblin/piblin-jax}\n}\n```\n\n## License\n\npiblin-jax is licensed under the [MIT License](LICENSE).\n\n## Acknowledgments\n\n- Forked from [piblin](https://github.com/3mcloud/piblin) by 3M - the original framework for measurement data science\n- Built on [JAX](https://github.com/google/jax) for high-performance numerical computing\n- Uses [NumPyro](https://github.com/pyro-ppl/numpyro) for Bayesian inference\n\n## Support\n\n- **Documentation**: [piblin-jax.readthedocs.io](https://piblin-jax.readthedocs.io)\n- **Issues**: [GitHub Issues](https://github.com/piblin/piblin-jax/issues)\n- **Discussions**: [GitHub Discussions](https://github.com/piblin/piblin-jax/discussions)\n\n---\n\nMade with \u2764\ufe0f by Wei Chen and the piblin-jax developers\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Modern JAX-Powered Framework for Measurement Data Science",
    "version": "0.0.3",
    "project_urls": {
        "Bug Tracker": "https://github.com/piblin/piblin-jax/issues",
        "Documentation": "https://piblin-jax.readthedocs.io",
        "Homepage": "https://github.com/piblin/piblin-jax",
        "Repository": "https://github.com/piblin/piblin-jax"
    },
    "split_keywords": [
        "scientific-computing",
        " data-analysis",
        " rheology",
        " jax",
        " bayesian-inference",
        " uncertainty-quantification"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "10552e0743e0131d59efaea2c3a013bc54bfc7d63daf491cec05bae08da7880a",
                "md5": "1e195ac595448c6858b0eb52bbb4e754",
                "sha256": "9453c6479fb97ce90ae013092148c9ee0b6530befbc122d8aea72959a9cf1cdc"
            },
            "downloads": -1,
            "filename": "piblin_jax-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1e195ac595448c6858b0eb52bbb4e754",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 121855,
            "upload_time": "2025-10-24T06:18:29",
            "upload_time_iso_8601": "2025-10-24T06:18:29.801389Z",
            "url": "https://files.pythonhosted.org/packages/10/55/2e0743e0131d59efaea2c3a013bc54bfc7d63daf491cec05bae08da7880a/piblin_jax-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "edea96b8a3a963f378476e5b27e142a5ec78bdb1024eb0d33c9cc8915685841b",
                "md5": "07750c73feea355cdf98ea7b53278b00",
                "sha256": "6220944fe968e76840923e446e0354d3949579bcd7c954de2e74cf6a1e7a10ae"
            },
            "downloads": -1,
            "filename": "piblin_jax-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "07750c73feea355cdf98ea7b53278b00",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 100609,
            "upload_time": "2025-10-24T06:18:31",
            "upload_time_iso_8601": "2025-10-24T06:18:31.057799Z",
            "url": "https://files.pythonhosted.org/packages/ed/ea/96b8a3a963f378476e5b27e142a5ec78bdb1024eb0d33c9cc8915685841b/piblin_jax-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-24 06:18:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "piblin",
    "github_project": "piblin-jax",
    "github_not_found": true,
    "lcname": "piblin-jax"
}
        
Elapsed time: 0.74682s