Metadata-Version: 2.1
Name: hydra-callbacks
Version: 0.1.2
Summary: A collection of usefull hydra callbacks for hydra configuration
Author-email: Pierre-Antoine Comby <pierre-antoine.comby@cea.fr>
Project-URL: Homepage, https://github.com/paquiteau/hydra-callbacks
Project-URL: Bug Reports, https://github.com/paquiteau/hydra-callbacks/issues
Project-URL: Sources, https://github.com/paquiteau/hydra-callbacks
Keywords: hydra,configuration,callback
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: hydra-core
Requires-Dist: GitPython
Requires-Dist: pandas
Provides-Extra: dev
Requires-Dist: black ; extra == 'dev'
Requires-Dist: isort ; extra == 'dev'
Requires-Dist: ruff ; extra == 'dev'
Provides-Extra: test
Requires-Dist: pytest ; extra == 'test'
Requires-Dist: pytest-cov ; extra == 'test'
Requires-Dist: pytest-xdist ; extra == 'test'
Requires-Dist: pytest-sugar ; extra == 'test'

# Hydra Callbacks 


[![style](https://img.shields.io/badge/style-black-black)](https://github.com/psf/black)
[![framework](https://img.shields.io/badge/framework-hydra-blue)](https://hydra.cc)


A collection of usefulls callbacks for the [https://hydra.cc/](hydra) configuration framework.


## Installation 


``` shell
pip install git+https://github.com/paquiteau/hydra-callbacks
```

## Usage 

In your hydra root config file add the following: 

``` yaml
hydra: 
  # ... 
  callbacks: 
    git_info:
      _target_: hydra_callbacks.GitInfo 
      clean: true
    latest_link:
      _target_: hydra_callbacks.LatestRunLink
```


## Available Callbacks 

| Name               | Action                                     | Author                                    |
|:-------------------|:-------------------------------------------|-------------------------------------------|
| GitInfo            | Check status of Repository                 | [paquiteau](https://github.com/paquiteau) |
| LatestRunLink      | Get a link to the latest run               | [paquiteau](https://github.com/paquiteau) |
| MultiRunGatherer   | Gather results json file in a single table | [paquiteau](https://github.com/paquiteau) |
| RuntimePerformance | Get Execution time for each run            | [paquiteau](https://github.com/paquiteau) |

And more to come ! 

## Also Available 
  
  - `PerfLogger` : A simple to use performance logger
  
```python
  
from hydra_callbacks import PerfLogger 
import logging

log = logging.getLogger(__name__)
def main_app(cfg):
    with PerfLogger(log, "step1"):
        sleep(1)

    with PerfLogger(log, "step2"):
        sleep(2)
    log.info(PerfLogger.recap())

```

## You too, have cool Callbacks, or idea for one ? 

Open a PR or an issue !

