semvec/pypi-packages huggingface dataset:
monochrome-viewer 2025.1.17
Deprecated. Please use the 'monochrome' package instead.
Requires Python: >=3.6

# Monochrome: Viewer for Monochromatic Video Data
[![docs](https://readthedocs.org/projects/monochrome/badge/?version=latest&style=)](https://monochrome.readthedocs.org)
[![tests](https://github.com/sitic/monochrome/actions/workflows/build.yml/badge.svg)](https://github.com/sitic/monochrome/actions/workflows/build.yml)
[![PyPI](https://img.shields.io/pypi/v/monochrome.svg)](https://pypi.org/project/monochrome/)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/monochrome.svg)](https://python.org)

Monochrome is a lightweight and fast video viewer for scientific monochromatic videos with high-dynamic range (float, uint16, etc.).

**The `monochrome-viewer` package name is now deprecated. Please switch to the new and improved [`monochrome`](https://pypi.org/project/monochrome/) package and see the documentation there!**

### Upgrade from existing `monochrome-viewer` installation

If you have installed `monochrome-viewer`, here's how to upgrade to the new `monochrome` package:

1. Uninstall the old `monochrome-viewer` package:
```bash
pip uninstall monochrome-viewer
```

2. Install the new `monochrome` package:
```bash
pip install monochrome
```
pytorch-diff-checkpoint 1.2.0
A PyTorch helper library designed to save only the changes in a fine-tuned base model.
Requires Python: <4.0,>=3.9

# pytorch-diff-checkpoint

`pytorch-diff-checkpoint` is a simple library designed to efficiently save only the modified parameters of a fine-tuned base model and incur no additional VRAM overhead. This tool is particularly advantageous in scenarios where minimizing storage usage is crucial, as it ensures that only the altered parameters are stored.

It checks if a parameter is different by the "requires_grad" attribute, if the first element of the parameter is different, or if the parameter is not in the base model.

This automatically handles saving parameters changes by the optimizer or statistics like batch norm.

## Installation

```bash
poetry add pytorch-diff-checkpoint
```

## Usage

```python
import torch
from torch.nn import Module
from diff_checkpoint import DiffCheckpoint

class SimpleModel(Module):
    def __init__(self):
        super(SimpleModel, self).__init__()
        self.fc1 = torch.nn.Linear(10, 10)
        self.bn1 = torch.nn.BatchNorm1d(10)
        self.fc2 = torch.nn.Linear(10, 1)

    def forward(self, x):
        x = torch.relu(self.fc1(x))
        x = self.bn1(x)
        x = self.fc2(x)
        return x

model = SimpleModel()

# Create a DiffCheckpoint from the base model
diff_checkpoint = DiffCheckpoint.from_base_model(model)

# Train
# ...

# Save the differential checkpoint
diff_checkpoint.save(model, 'diff_checkpoint.pth')
```
data-download 0.1.0
Download ERA5 data from Copernicus API
Requires Python: >=3.6

# ERA5 Data Downloader

This Python package provides functionality to download **ERA5 reanalysis data** from the **Copernicus Climate Data Store (CDS)**. The package includes a robust system to handle retries, verify the integrity of NetCDF files, and log all operations for easy troubleshooting.

---

## Features

- Downloads ERA5 variables for a specified geographical area and time range.
- Supports:
  - `2m_temperature`
  - `10m_u_component_of_wind`
  - `10m_v_component_of_wind`
  - `total_precipitation`
  - Additional variables can be added easily.
- Automatically verifies the integrity of downloaded NetCDF files.
- Configurable retry mechanism for failed downloads.
- Detailed logging for debugging and monitoring.

---

## Installation

### Prerequisites

1. **Python**: Ensure you have Python 3.6 or above installed.
2. **Required Libraries**:
   Install the required dependencies using:
   ```bash
   pip install -r requirements.txt

# ERA5 Data Downloader

This Python package provides functionality to download **ERA5 reanalysis data** from the **Copernicus Climate Data Store (CDS)**. The package includes a robust system to handle retries, verify the integrity of NetCDF files, and log all operations for easy troubleshooting.

---

## **Required Dependencies**

The script uses the following Python libraries:

- **`cdsapi`**: For interacting with the Copernicus Climate Data Store API.
- **`xarray`**: For working with NetCDF files.
- **`logging`**: For detailed logging.
- **`netCDF4`**: For handling NetCDF files.

---

## **Configuration**

### **CDS API Key**

To use the `cdsapi` package, you must configure your CDS API key. Follow these steps:

1. Open your terminal and create a `.cdsapirc` file in your home directory:
   ```bash
   nano ~/.cdsapirc
102203162-topsis 0.2.0
A Python library for the TOPSIS decision-making method.
Requires Python: >=3.6

# TOPSIS Library

## Overview
The TOPSIS (Technique for Order Preference by Similarity to Ideal Solution) library provides an implementation of the TOPSIS decision-making method. This technique is used to rank alternatives based on multiple criteria by comparing their distance from an ideal best and an ideal worst solution.

## Features
- Normalize decision matrices
- Apply weights and impacts to criteria
- Calculate rankings and performance scores

## Installation
Install the library via pip:

```bash
pip install topsis-library
```

## Usage

Here’s a quick guide to using the library:

```python
from topsis.topsis import topsis

# Define the decision matrix
# Each row is an alternative, and each column is a criterion
data = [
    [250, 16, 12, 5],
    [200, 16, 8, 3],
    [300, 32, 16, 4],
    [275, 32, 8, 4],
    [225, 16, 16, 2]
]

# Define weights for each criterion
weights = [0.25, 0.25, 0.25, 0.25]

# Define impacts for each criterion ('+' for benefit, '-' for cost)
impacts = ['+', '+', '-', '+']

# Calculate rankings and scores
rankings, scores = topsis(data, weights, impacts)

print("Rankings:", rankings)
print("Scores:", scores)
```

### Output Example
```plaintext
Rankings: [3, 1, 4, 2, 5]
Scores: [0.7722, 0.5634, 0.8523, 0.6472, 0.4321]
```

## How It Works
1. **Normalization**: The decision matrix is normalized to make criteria comparable.
2. **Weight Application**: Each criterion is weighted to reflect its importance.
3. **Ideal Solutions**: The algorithm calculates the ideal best and worst values for each criterion.
4. **Distance Calculation**: Distances from the ideal best and worst solutions are computed.
5. **Performance Scores**: Scores are calculated based on proximity to the ideal solutions.
6. **Ranking**: Alternatives are ranked based on their scores.

## Testing
Run unit tests to ensure functionality:

```bash
python -m unittest discover tests
```

## Author
Raghav Manchanda
pulire 0.0.9
A lightweight DataFrame validation library.
Requires Python: <4.0,>=3.9

# Pulire

A lightweight DataFrame validation library for [Pandas](https://pandas.pydata.org/).

## Auto Formatting

```sh
poetry run black .
```

## Testing

Run the following command for unit tests:

```sh
poetry run pytest tests
```

## Schema

Pulire requires a `Schema` which describes all columns in a given `DataFrame`.

```py
from pulire import Schema, Column, validators, formatters

Schema([
    Column("temp", "Float64", [
        validators.minimum(-80),
        validators.maximum(65),
        formatters.decimals(1)
    ])
])
```

## Validate

Pulire automatically removes values which fail the validation. Let's use the `meteostat` library to get some data:

```py
from datetime import datetime
from meteostat import Hourly

df = Hourly("10637", datetime(2018, 1, 1), datetime(2018, 1, 1, 23, 59)).fetch()

print(df)
```

Now, we can get a valid copy of our Meteostat `DataFrame` by running our schema's `validate` method:

```py
df = myschema.validate(df)
```

### Lazy Validations

```py
try:
    schema.validate(df, lazy=True)
except ValueError as error:
    print(error.args[0])
```
oe-databank 0.2.0
A Python client for Oxford Economics' Databank API.
Requires Python: >=3.10

# oe-databank

[![PyPI version](https://img.shields.io/pypi/v/oe-databank?color=fe7200&labelColor=eeeeee)](https://pypi.python.org/pypi/oe-databank/)
![GitHub stars](https://img.shields.io/github/stars/tourismeconomics/oe-databank?color=fe7200&labelColor=eeeeee)

Python expression of Oxford Economics' Databank API.

## Installation

```bash
pip install oe-databank
```

## Usage

Queries can be sent synchronously or asynchronously.

```python
import asyncio
from oe_databank import (
    DatabankAsyncClient,
    DatabankClient,
    FileDownloadRequestDto,
    FileFormat,
    Frequency,
    ListingType,
    Order,
    Selection,
    SelectionSortOrder,
    SelectionType,
    Sequence,
)

request = FileDownloadRequestDto(
    selections=[
        Selection(
            selectionType=SelectionType.QUERY,
            isTemporarySelection=True,
            databankCode="IST",
            sequence=Sequence.EARLIEST_TO_LATEST,
            groupingMode=False,
            transposeColumns=False,
            order=Order.LOCATION_INDICATOR,
            indicatorSortOrder=SelectionSortOrder.ALPHABETICAL,
            locationSortOrder=SelectionSortOrder.ALPHABETICAL,
            format=0,
            legacyDatafeedFileStructure=False,
            variables=[],
            regions=[],
            listingType=ListingType.SHARED,
            isDataFeed=False,
            startYear=2023,
            endYear=2027,
            precision=5,
            frequency=Frequency.ANNUAL,
            stackedQuarters=False,
        )
    ],
    format=FileFormat.CSV,
    name="test-te-pull",
)

DatabankClient(api_key=...).query(request=request, to_path="sync_result.csv")

asyncio.run(DatabankAsyncClient(api_key=...).query(request=request, to_path="async_result.csv"))
```

You might run into issues with large downloads, so you can use retry options to handle errors during download.

```python
from oe_databank import DatabankClient

DatabankClient(api_key=...).query(
    request=request,
    to_path="sync_result.csv",
    download_attempts=3,
    download_retry_delay_seconds=2.0,
)
```