1. Clone repository
git clone https://github.com/sam-may/HistogramRestrictedLearning.git
cd HistogramRestrictedLearning
2. Install dependencies
Dependencies are listed in environment.yml
. Install with
conda env create -f environment.yml
and activate with
conda activate hrl
3. Install hrl
Users can install with:
python setup.py install
Developers are suggested to install with:
pip install -e .
to avoid rerunning the whole installation every time there is a change.
Once your setup is installed, you can activate your python environment with
conda activate hrl
and then two additional packages need to be installed via pip
:
pip install sklearn
pip install yahist
Note: CMSSW
environments can interfere with conda
environments. Recommended to unset your CMSSW environment (if any) by running
eval `scram unsetenv -sh`
before attempting installation and each time before activating the conda
environment.
Please comment code following this convention from sphinx
.
In the future, sphinx
can be used to automatically generate documentation pages for this project.
Logging currently uses the Python logging facility together with rich (for pretty printing) to provide useful information printed both to the console and a log file (optional).
Two levels of information can be printed: INFO
and DEBUG
. INFO
level displays a subset of the information printed by DEBUG
level.
A logger can be created in your script with
from hrl.utils import setup_logger
logger = setup_logger(<level>, <log_file>)
And printouts can be added to the logger with:
logger.info(<message>) # printed out only in INFO level
logger.debug(<message>) # printed out in both INFO and DEBUG levels