semvec/pypi-packages huggingface dataset:
pcalg-py 0.0.1
A Python implementation of the PC algorithm for causal structure learning, ported from the R pcalg package.
Requires Python: >=3.8


# pcalg-py

A Python implementation of the PC algorithm for causal structure learning, ported from the R package `pcalg`.

This package provides a strict re-implementation of the PC algorithm (Spirtes et al., 2000) and related functions (Skeleton estimation, separation sets, etc.), verified to match the reference R implementation exactly.

## Features

*   **PC Algorithm**: Estimate the equivalence class of a DAG (Patterns/PDAG) from observational data.
*   **Skeleton Estimation**: Infer the undirected skeleton graph.
*   **Separation Sets**: Record condition sets that d-separate variables.
*   **Parsimonious**: Strict port of the `stable` method from `pcalg` ensuring order-independence.
*   **Verified**: Numerically comparable to R output (see `COMPARISON_REPORT.md`).

## Installation

You can install the package via pip (after building or if published):

```bash
pip install pcalg-py
```

Or install from source:

```bash
git clone https://github.com/yourusername/pcalg-py.git
cd pcalg-py
pip install .
```

## Usage

```python
import numpy as np
import pandas as pd
from pcalg_py.pc import pc
from pcalg_py.indep_test import gaussCItest, SuffStat

# 1. Prepare Data (Correlation matrix and sample size)
# Example: Generate random data
np.random.seed(42)
data = np.random.randn(100, 5)
C = np.corrcoef(data.T)
n = 100
labels = [str(i) for i in range(5)]

# 2. Create Sufficient Statistics object
suffStat = SuffStat(C=C, n=n)

# 3. Run PC Algorithm
# alpha is the significance level for the independence test
res = pc(suffStat, gaussCItest, alpha=0.01, labels=labels, verbose=True)

# 4. Access Results
graph = res["graph"] # NetworkX DiGraph (CPDAG)
pdag_matrix = res["pdag_matrix"]
sepset = res["skel"]["sepset"]

print("Edges:", graph.edges())
```

## Structure

*   `src/pcalg_py/`: Source code.
*   `tests/`: Verification scripts comparing R vs Python.

## License

GPLv2 (Derived from `pcalg` R package)
Topsis-Pragati-102303310 1.0.0
A Python package for TOPSIS decision making

# TOPSIS-Python
By Pragati Arora

## Installation
`pip install Topsis-Pragati-102303310`

## Usage
Run the following command in your terminal:
`python -m topsis.topsis <InputDataFile> <Weights> <Impacts> <OutputResultFileName>`
yprint 0.1.1
Prefix stdout/stderr lines with call stack context.
Requires Python: >=3.8

# yprint

yprint prefixes stdout/stderr lines with a colored call stack breadcrumb. It does this by preloading a small C shim that intercepts writes and lets the Python runtime update a per-thread prefix.

## Install

```bash
pip install yprint
```

## Usage

```bash
yprint -- python your_script.py
yprint -- bash -c 'python your_script.py'
```

### Options

- `--only PATH` (repeatable): Only show frames under the given path(s).
- `--prefix-width N`: Fixed width for the prefix column.

### Environment

- `YPRINT_ONLY`: Colon-separated list of allowed paths (same as `--only`).
- `YPRINT_PREFIX_WIDTH`: Fixed width for the prefix column.
- `YPRINT_COLOR`: `always` or `never` to force color on/off.
- `YPRINT_CACHE_DIR`: Override where the preload library is compiled.
- `YPRINT_ENABLE`: Set to `1` to auto-enable via `sitecustomize`.

yprint compiles the preload library on first run; a C compiler (`cc`) must be available.

## Dev / Release

```bash
pip install -e ".[dev]"
python -m build
python -m twine upload dist/*
```