Metadata-Version: 2.4
Name: uratools
Version: 1.0.0
Summary: Tools to simplify the use of URANIE with python
License: LGPL
License-File: LICENSE
Author: Uranie Team
Author-email: rudy.chocat@cea.fr
Requires-Python: >=3.11
Classifier: Environment :: Console
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development
Classifier: Topic :: Scientific/Engineering
Requires-Dist: numpy
Project-URL: Homepage, https://gitlab.com/uranie-cea/uratools/
Description-Content-Type: text/markdown

# uratools

This Python module provides tools to simplify the use of URANIE with Python

`uratools` aims to provide a multitude of utilities designed to enhance the user experience, particularly by facilitating ports to NumPy, interfacing Uranie with Python machine learning libraries (PyTorch, TensorFlow, and scikit-learn), and providing tools for fitting empirical distributions and generating plots easily. It will be updated regularly.



## URANIE

 - Website: https://uranie.cea.fr/
 - Python documentation: https://uranie.cea.fr/documentation/userManual_Py/index 
 - Installation: https://gitlab.com/uranie-cea/publication/-/wikis/home
 - Uratools documentation https://uratools-508bc1.gitlab.io/

## Installation

```bash
pip install uratools
```

## How to use it

Before using the package, ensure that URANIE is installed and properly sourced.

The python command to use the package is the following

```python
from uratools import converter
```

Documentation is available on this page
https://uratools-508bc1.gitlab.io/

## Example

```python
import numpy as np
import ROOT
from ROOT.URANIE import DataServer, Sampler
from uratools import converter

## == np.array to DataServer
mA = np.random.randn(10,2)
tds = converter.np2ds(mA, "x1:x2") ## a DataServer.TDataServer is created from np.array

## == DataServer to np.array 
tds = DataServer.TDataServer()
tds.addAttribute(DataServer.TUniformDistribution("x1",0.0, 5.0))
tds.addAttribute(DataServer.TNormalDistribution("x2",-2.0, 0.5))
sam = Sampler.TSampling(tds,"lhs",20)
sam.generateSample()

npA = converter.ds2np(tds) ## a np.array is created from a DataServer.TDataServer
```

## Support

support-uranie@cea.fr


