Metadata-Version: 2.4
Name: etlup
Version: 4.2.9
Summary: Test definitions, plotting and documentation for the CMS MTD ETL project
Author: Hayden Swanson
Author-email: Hayden Swanson <hayden.swanson@cern.ch>
License-Expression: MIT AND (Apache-2.0 OR BSD-2-Clause)
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
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: requests>=2.31.0,<3 ; python_full_version < '3.13'
Requires-Dist: requests>=2.32.0,<3 ; python_full_version >= '3.13'
Requires-Dist: jinja2>=3.1.2,<4 ; python_full_version < '3.13'
Requires-Dist: jinja2>=3.1.4,<4 ; python_full_version >= '3.13'
Requires-Dist: pydantic>=2.8.2,<3 ; python_full_version < '3.13'
Requires-Dist: pydantic>=2.9.0,<3 ; python_full_version >= '3.13'
Requires-Dist: matplotlib>=3.7.0,<4 ; python_full_version < '3.13'
Requires-Dist: matplotlib>=3.9.0,<4 ; python_full_version >= '3.13'
Requires-Dist: numpy>=1.20.0,<3 ; python_full_version < '3.13'
Requires-Dist: numpy>=2.1.0,<3 ; python_full_version >= '3.13'
Requires-Dist: pytz>=2023.3 ; python_full_version < '3.13'
Requires-Dist: pytz>=2024.1 ; python_full_version >= '3.13'
Maintainer: Hayden Swanson, Naomi Gonzalez
Maintainer-email: Hayden Swanson <hayden.swanson@cern.ch>, Naomi Gonzalez <ngonzalz@bu.edu>
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# etlup

This project contains code for plotting for CMS MTD ETL project. To install you can do,

```bash
pip install etlup
```

Or if you are developing locally you can clone the repo and cd into it. Then do,
```
pip install -U -e ./
```

# Plotting

```python
from etlup.tamalero.Noisewidth import NoisewidthV0
from etlup import now_utc
nw = NoisewidthV0(
    user_created = "hayden",
    location = "CERN",
    measurement_date = now_utc(),
    module = "Module 206",
    pos_0 = [[4, 4, 3, 4, 3, 4, 2, 4, 3, 3, 3, 3, 4, 4, 3, 3,],
            [3, 4, 4, 3, 4, 4, 3, 4, 4, 4, 3, 4, 3, 3, 4, 3,],
            [3, 5, 4, 3, 3, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 4,],
            [3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 3, 3, 4, 3, 3, 3,],
            [3, 4, 3, 3, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3,],
            [3, 4, 4, 3, 4, 3, 3, 3, 3, 4, 3, 3, 3, 3, 4, 4,],
            [3, 4, 4, 4, 3, 3, 4, 4, 4, 5, 4, 4, 4, 4, 4, 3,],
            [3, 3, 3, 3, 2, 4, 3, 3, 4, 4, 3, 3, 4, 3, 3, 4,],
            [3, 4, 4, 4, 4, 3, 3, 4, 5, 3, 4, 3, 3, 4, 3, 3,],
            [4, 3, 3, 3, 3, 4, 4, 3, 3, 4, 4, 3, 3, 3, 4, 4,],
            [4, 4, 4, 4, 3, 4, 3, 4, 4, 4, 3, 3, 4, 3, 3, 4,],
            [3, 3, 4, 3, 3, 3, 3, 3, 3, 4, 3, 4, 4, 3, 3, 3,],
            [4, 3, 4, 3, 4, 3, 4, 3, 3, 3, 4, 3, 3, 4, 3, 3,],
            [3, 4, 5, 4, 3, 4, 3, 3, 4, 4, 3, 4, 3, 4, 3, 4,],
            [3, 3, 4, 4, 3, 4, 3, 4, 4, 3, 4, 3, 4, 3, 4, 3,],
            [4, 3, 3, 3, 3, 3, 3, 4, 4, 3, 3, 4, 3, 4, 3, 3,]]
    # there are the other three positions you can also give
    # pos_1, pos_2, pos_3
)
fig = nw.plot()
fig.savefig("noisewidth.png")
```

# Uploading to Database
In order for you to upload to the database you will need to create a `.env` file in the same directory as the script or pass in its path to the `Session`. Here is an example of a `.env` file:

```
API_TOKEN_ENV = "your token goes here"
```

To upload,
```
from etlup.tamalero.Noisewidth import NoisewidthV0
from etlup import prod_session

tests = [
    NoisewidthV0(...),
    ...
]

prod_session.add_all(tests)
prod_session.upload()
```