From d5f89aec5c51bce4b654fc5fa7e5f0f43298b35a Mon Sep 17 00:00:00 2001 From: Jonas Eschle 'Mayou36 Date: Mon, 19 Nov 2018 19:18:00 +0100 Subject: [PATCH] Change deps --- .travis.yml | 2 +- README.md | 96 ------------------------------------------------ README.rst | 44 ++++++++-------------- requirements.txt | 1 + setup.py | 4 +- 5 files changed, 19 insertions(+), 128 deletions(-) delete mode 100644 README.md diff --git a/.travis.yml b/.travis.yml index f0cab90..ace6fd8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -84,7 +84,7 @@ install: #- pip uninstall pandas -y || echo pandas not installed #- pip install xgboost > tmp.txt && echo "alive" #- pip install -U -r requirements.txt -#- pip install git+https://github.com/REPlegacy/rep -U +- pip install git+https://github.com/REPlegacy/rep -U - pip install .[all] script: diff --git a/README.md b/README.md deleted file mode 100644 index b64e3c0..0000000 --- a/README.md +++ /dev/null @@ -1,96 +0,0 @@ -[![Code Health](https://landscape.io/github/mayou36/raredecay/master/landscape.svg?style=flat)](https://landscape.io/github/mayou36/raredecay/master) -[![Build Status](https://travis-ci.org/mayou36/raredecay.svg?branch=master)](https://travis-ci.org/mayou36/raredecay) -[![PyPI version](https://badge.fury.io/py/raredecay.svg)](https://badge.fury.io/py/raredecay) -[![Dependency Status](https://www.versioneye.com/user/projects/58273f1df09d22004f5914f9/badge.svg?style=flat-square)](https://www.versioneye.com/user/projects/58273f1df09d22004f5914f9) - - - - -# raredecay # - -This package consists of several tools for the event selection of particle decays, mostly built on machine learning techniques. -It contains: - -- a **data-container** holding data, weights, labels and more and implemented root-to-python data conversion as well as plots and KFold-data splitting -- **reweighting** tools from the hep_ml-repository wrapped in a KFolding structure and with metrics to evaluate the reweighting quality -- **classifier optimization** tools for hyper-parameters as well as feature selection involving a backward-elimination -- an **output handler** which makes it easy to add text as well as figures into your code and automatically save them to a file -- ... and more - -## HowTo examples ## - -To get an idea of the package, have a look at the howto notebooks: -[HTML version](https://mayou36.bitbucket.io/raredecay/howto/) or the -[IPython Notebooks](https://github.com/mayou36/raredecay/tree/master/howto) - -## Minimal example ## -Want to test whether your reweighting did overfit? Use train_similar: - -```python -import raredecay as rd - -mc_data = rd.data.HEPDataStorage(df, weights=*pd.Series weights*, target=0) -real_data = rd.data.HEPDataStorage(df, weights=*pd.Series weights*, target=1) - -score = rd.score.train_similar(mc_data, real_data, old_mc_weights=1 *or whatever weights the mc had before*) -``` - - -## Getting started right now ## - -If you want it the easy, fast way, have a look at the -[Ready-to-use scripts](https://github.com/mayou36/raredecay/tree/master/scripts_readyToUse). -All you need to do is to have a look at every "TODO" task and probably change them. Then you can run the script without the need of coding at all. - -## Documentation and API ## - -The API as well as the documentation: -[Documentation](https://mayou36.github.io/raredecay/) - -## Setup and installation ## - - -### Anaconda ### -Easiest way: use conda to install everything (except of the rep, which has to be upgraded with pip for some functionalities) - -``` -conda install raredecay -c mayou36 -``` - -### PyPI ### - -The package with all extras requires root_numpy as well as rootpy (and therefore a ROOT installation with python-bindings) to be installed on your system. If that is not the case, some functions won't work. - -If you want to install all the extra, first install the very newest version of REP (may also needed with conda install) -(the -U can be omitted, but is recommended to have the newest dependencies): -``` -pip install -U https://github.com/yandex/rep/archive/stratifiedkfold.zip -``` - - -Then, install the raredecay package (without ROOT-support) via - -``` -pip install raredecay -``` - -To make sure you can convert ROOT-NTuples, use - -``` -pip install raredecay[root] # *use raredecay\[root\] in a zsh-console* -``` - -or, instead of root/additionally (comma separated) `reweight` or `reweight` for the specific functionalities. - -In order to have all functionalities, use - -``` -pip install raredecay[all] -``` -As it is a young package still under developement, it may receive regular updates and improvements and it is probably a good idea to regularly download the newest package. - - -[pandas.DataFrame]: http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html -[LabeledDataStorage]: http://yandex.github.io/rep/data.html#module-rep.data.storage -[numpy.array]: http://docs.scipy.org/doc/numpy-1.10.1/user/basics.rec.html -[rootTree]: https://root.cern.ch/doc/v606/classTTree.html diff --git a/README.rst b/README.rst index 9086641..ff8706b 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,4 @@ -|Code Health| |Build Status| |PyPI version| |Dependency Status| +|Code Health| |Build Status| |PyPI version| raredecay ========= @@ -34,10 +34,10 @@ Want to test whether your reweighting did overfit? Use train\_similar: .. code:: python - import raredecay as rd + import raredecay as rd - mc_data = rd.data.HEPDataStorage(df, weights=*pd.Series weights*, target=0) - real_data = rd.data.HEPDataStorage(df, weights=*pd.Series weights*, target=1) + mc_data = rd.data.HEPDataStorage(df, weights=*pd.Series weights*, target=0) + real_data = rd.data.HEPDataStorage(df, weights=*pd.Series weights*, target=1) score = rd.score.train_similar(mc_data, real_data, old_mc_weights=1 *or whatever weights the mc had before*) @@ -59,16 +59,6 @@ The API as well as the documentation: Setup and installation ---------------------- -Anaconda -~~~~~~~~ - -Easiest way: use conda to install everything (except of the rep, which -has to be upgraded with pip for some functionalities) - -:: - - conda install raredecay -c mayou36 - PyPI ~~~~ @@ -76,19 +66,24 @@ The package with all extras requires root\_numpy as well as rootpy (and therefore a ROOT installation with python-bindings) to be installed on your system. If that is not the case, some functions won't work. -If you want to install all the extra, first install the very newest -version of REP (may also needed with conda install) (the -U can be -omitted, but is recommended to have the newest dependencies): +Recommended installation (requires ROOT): + :: - pip install -U https://github.com/yandex/rep/archive/stratifiedkfold.zip + pip install raredecay[all] --process-dependency-links -Then, install the raredecay package (without ROOT-support) via +Anaconda +~~~~~~~~ + +Easiest way: use conda to install everything (except of the rep, which +has to be upgraded with pip for some functionalities) :: - pip install raredecay + conda install raredecay -c mayou36 + + To make sure you can convert ROOT-NTuples, use @@ -99,15 +94,6 @@ To make sure you can convert ROOT-NTuples, use or, instead of root/additionally (comma separated) ``reweight`` or ``reweight`` for the specific functionalities. -In order to have all functionalities, use - -:: - - pip install raredecay[all] - -As it is a young package still under developement, it may receive -regular updates and improvements and it is probably a good idea to -regularly download the newest package. .. |Code Health| image:: https://landscape.io/github/mayou36/raredecay/master/landscape.svg?style=flat :target: https://landscape.io/github/mayou36/raredecay/master diff --git a/requirements.txt b/requirements.txt index 0ff2b9c..c9486e4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,5 @@ numpy matplotlib future xgboost +rep>0.7.0 hep_ml>=0.5.0 diff --git a/setup.py b/setup.py index ca2cd31..231fc15 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ here = os.path.abspath(os.path.dirname(__file__)) with io.open(os.path.join(here, 'requirements.txt')) as f: - requirements = f.read().split('\n') + requirements = f.read().splitlines() def readme(): @@ -67,7 +67,7 @@ def readme(): author='Jonas Eschle', author_email='mayou36@jonas.eschle.com', license='Apache-2.0 License', - dependency_links=['https://github.com/REPlegacy/rep/tarball/master#egg=rep'], + dependency_links=['https://github.com/REPlegacy/rep/tarball/master#egg=rep-0.7.1'], install_requires=requirements, extras_require=extras_require, packages=['raredecay',