semvec/pypi-packages huggingface dataset:
linalg-fromscratch 0.1.1
Cosine similarity and PCA (cov + SVD) from scratch in NumPy with tests
License: MIT
Requires Python: >=3.9
Keywords: numpy, linear algebra, pca, cosine similarity, education

## Run in Google Colab

[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](
https://colab.research.google.com/github/Izewdevlabs/Cosine_PCA/blob/main/notebooks/Cosine_PCA_FromScratch.ipynb
)


## Notebooks

Interactive demos are in the [`notebooks/`](./notebooks) folder.

- [Cosine_PCA_FromScratch.ipynb](./notebooks/Cosine_PCA_FromScratch.ipynb)  
  Demonstrates cosine similarity, PCA (covariance + SVD), explained variance plots, and reconstruction.

## Run in Binder

[![Binder](https://mybinder.org/badge_logo.svg)](
https://mybinder.org/v2/gh/Izewdevlabs/Cosine_PCA/HEAD?labpath=notebooks%2FCosine_PCA_FromScratch.ipynb
)


# Cosine_PCA

![Python tests](https://github.com/Izewdevlabs/Cosine_PCA/actions/workflows/python-tests.yml/badge.svg)


# linalg_fromscratch (NumPy) — Cosine + PCA with Tests

A tiny, dependency-light set of linear algebra utilities implemented from scratch in NumPy,
with a pytest suite you can drop into any repo.

## Structure
```
linalg_fromscratch/
├── src/
│   └── linalg_fromscratch/
│       ├── __init__.py
│       ├── cosine.py
│       └── pca.py
├── tests/
│   ├── test_cosine.py
│   └── test_pca.py
├── pytest.ini
├── requirements.txt
└── README.md
```

## Run tests
```bash
pip install -r requirements.txt
pytest
```

## Notes
- Cosine similarity guards against zero vectors.
- `PCA_FromScratch`: covariance eigendecomposition.
- `PCA_SVD`: SVD-based PCA. Tests confirm equivalence up to sign flips.
- Tests include:
  - Cosine edge cases
  - Orthonormality of components
  - Variance-along-PCs equals eigenvalues
  - Reconstruction error decreases with more components
  - Covariance-PCA vs SVD-PCA numerical equivalence
fastapi_yieldable_response 0.1.0
A middleware for FastAPI that sends early responses from route handlers.
License: MIT
Requires Python: >=3.10
Keywords: fastapi

# FastAPI Yieldable Response

A middleware for FastAPI that sends early responses from route handlers.

## Overview

FastAPI Yieldable Response allows you to send immediate responses to clients while continuing to execute background processing in your route handlers. This is particularly useful when you want to:

- Send quick acknowledgments to clients before performing time-consuming operations
- Improve perceived response times by returning data immediately
- Execute cleanup or logging tasks after the response has been sent

## Installation

```bash
pip install fastapi_yieldable_response
```

## Quick Start

```python
from fastapi import FastAPI
from fastapi_yieldable_response import yieldable_response

app = FastAPI()

@app.get("/")
@yieldable_response
async def root():
    # This response is sent immediately to the client
    yield {"message": "Hello!"}
    
    # This code runs in the background after the response is sent
    import time
    time.sleep(2)
    print("Background task completed!")
```

## How It Works

The `@yieldable_response` decorator transforms your route handler into a function that:

1. **Immediate Response**: The first `yield` statement sends an immediate response to the client
2. **Background Execution**: Any code after the `yield` continues executing as a background task
3. **Automatic Cleanup**: Uses FastAPI's `BackgroundTasks` to ensure proper resource management

## Features

-  **Zero Dependencies**: Only requires FastAPI (no additional dependencies)
-  **Async/Sync Support**: Works with both async and sync route handlers
-  **Type Safety**: Maintains original function signatures and type hints
-  **FastAPI Integration**: Uses FastAPI's built-in `BackgroundTasks` system
-  **Simple API**: Just add the decorator to your existing routes

## Usage Examples

### Async Route Handler

```python
@app.get("/async-example")
@yieldable_response
async def async_example():
    yield {"status": "processing", "id": 123}
    
    # Background processing
    await some_async_operation()
    await send_notification()
```

### Sync Route Handler

```python
@app.get("/sync-example/{item_id}")
@yieldable_response
def sync_example(item_id: str):
    yield {"message": f"Processing item {item_id}"}
    
    # Background processing
    process_item(item_id)
    log_operation(item_id)
```

### With Path Parameters

```python
@app.get("/users/{user_id}")
@yieldable_response
async def get_user(user_id: int):
    # Send immediate response
    yield {"user_id": user_id, "status": "found"}
    
    # Log access in background
    await log_user_access(user_id)
    await update_analytics(user_id)
```

## Requirements

- Python 3.10+
- FastAPI 0.68.0+

## License

MIT License - see [LICENSE](LICENSE) file for details.

## Contributing

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

## Repository

- **Homepage**: <https://github.com/lucamattiazzi/fastapi_yieldable_response>
- **Issues**: <https://github.com/lucamattiazzi/fastapi_yieldable_response/issues>
omnitrack 0.1.0
Unified logging and experiment tracking for research workflows
License: MIT
Requires Python: >=3.10

# Omnitrack 🚀

Unified logging and experiment tracking for ML research.  
Log once → sync everywhere (console, JSONL, W&B, …).

## Features
- 📊 Multi-sink logging (`ConsoleSink`, `JSONLSink`, `WandbSink`)
- 🌲 Hierarchical config & tags
- 🚀 Beautiful Rich-based console
- 🔌 Extensible sink interface
- ⚡ Efficient: batch logging, manual refresh

## Quickstart

```bash
pip install omnitrack
```

```python
from omnitrack import LogSession, record, step, push_config, set_tags
from omnitrack.sinks.console import ConsoleSink

with LogSession(sinks=[ConsoleSink()]):
    push_config({"lr": 1e-3, "batch_size": 64})
    set_tags(env="demo")

    for e in range(3):
        step("epoch")
        for b in range(10):
            step("batch")
            record(step_name="batch", loss=0.1, acc=0.9)
```

## Demo

Run the built-in demo:

```bash
omnitrack demo --jsonl logs/demo.jsonl
```