Metadata-Version: 2.4
Name: manticore_data
Version: 2.0.0
Summary: Manticore Data access
License: GPL
License-File: LICENSE
Author: Guilhem Lavaux
Author-email: guilhem.lavaux@iap.fr
Requires-Python: >=3.11,<4.0
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: boto3 (>=1.40.59,<2.0.0)
Requires-Dist: h5py (>=3.12,<4)
Requires-Dist: pydantic (>=2.12.3,<3.0.0)
Requires-Dist: pydantic-settings (>=2.11.0,<3.0.0)
Requires-Dist: requests (>=2.34.2,<3.0.0)
Requires-Dist: rich (>=14.2.0,<15.0.0)
Requires-Dist: tqdm (>=4.67.1,<5.0.0)
Description-Content-Type: text/markdown

# Manticore Data Module

A Python module for loading and managing data from an S3 bucket.

**ATTENTION (April 30th 2026):  BACKEND CHANGED. PLEASE UPDATE TO MANTICORE_DATA >=1.8.0**



## Overview

The `manticore_data` module is designed to load and manage data from an S3 bucket. It provides functionalities for handling different types of data products such as velocity fields, monofonic data, submit scripts, and whitenoise data.

## Installation

To install the module, clone the repository and install the required dependencies:

```bash
pip install git+https://git.aquila-consortium.org/Aquila-Consortium/manticore_data/
```

## Usage

### Initialization

First, import the module and initialize the `ManticoreDataLoader` class. The
campaign generation is chosen **once**, in the constructor, and the loader is
bound to it for its whole lifetime — no method takes a `generation` argument.
Create a second loader to read a different generation.

```python
from manticore_data import ManticoreDataLoader, ManticoreGeneration

loader = ManticoreDataLoader(ManticoreGeneration.Local)
```

### Loading Data

To load Halo catalog data from the S3 bucket:

```python
data = loader.get_soap_catalog_files(resolution=1024, snapshot_number=70)
```


To retrieve a file element of the main chain:
```python
mcmc = loader.get_product_files("chain", as_file_objects=True)
```

Be aware that these files are about 400 MB big each. 

One 

## Configuration

The module uses a `Settings` class to manage configuration settings. You can configure the mirror URL and cache directory by modifying the `.env` file or setting environment variables.

```python
from manticore_data.settings import settings

print(settings.manticore_data_mirror)
print(settings.cache_dir)
```

## Cache management

To clear the cache entirely:
```python
from manticore_data import ManticoreFile

ManticoreFile.clear_cache()
```

To get information on the cache
```python

ManticoreFile.get_cache_info()
```

## License

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

