git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #62052 from timokau/rl-coach-init

python.pkgs.rl-coach: init at 0.12.0

commit28b4f7b6ace4d7854294f96c190a4b6379136271 authorTimo Kaufmann <timokau@zoho.com> dateSat 25 May 2019, 22:45 (7 years ago) parentd9153a6700e8bc
3 files changed+128
pkgs/development/python-modules/annoy/default.nix+26 pkgs/development/python-modules/rl-coach/default.nix+98 pkgs/top-level/python-packages.nix+4
pkgs/development/python-modules/annoy/default.nixnew file+26
@@ -0,0 +1,26 @@
1+{ stdenv
2+, buildPythonPackage
3+, fetchPypi
4+, nose
5+}:
6+
7+buildPythonPackage rec {
8+ version = "1.15.2";
9+ pname = "annoy";
10+
11+ src = fetchPypi {
12+ inherit pname version;
13+ sha256 = "1i5bkf8mwd1pyrbhfwncir2r8yq8s9qz5j13vv2qz92n9g57sr3m";
14+ };
15+
16+ checkInputs = [
17+ nose
18+ ];
19+
20+ meta = with stdenv.lib; {
21+ description = "Approximate Nearest Neighbors in C++/Python optimized for memory usage and loading/saving to disk";
22+ homepage = https://github.com/spotify/annoy;
23+ license = licenses.asl20;
24+ maintainers = with maintainers; [ timokau ];
25+ };
26+}
pkgs/development/python-modules/rl-coach/default.nixnew file+98
@@ -0,0 +1,98 @@
1+{ stdenv
2+, lib
3+, buildPythonPackage
4+, pythonOlder
5+, fetchPypi
6+, tensorflow
7+, annoy
8+, pillow
9+, matplotlib
10+, numpy
11+, pandas
12+, pygame
13+, pyopengl
14+, scipy
15+, scikitimage
16+, gym
17+, bokeh
18+, kubernetes
19+, redis
20+, minio
21+, pytest
22+, psutil
23+}:
24+
25+buildPythonPackage rec {
26+ version = "0.12.0";
27+ pname = "rl-coach";
28+
29+ src = fetchPypi {
30+ inherit pname version;
31+ sha256 = "0kfm699rsy63726hpz3fyppl7zbl0fzf0vk2kkfgg718mcjxmdnh";
32+ };
33+
34+ propagatedBuildInputs = [
35+ tensorflow
36+ annoy
37+ pillow
38+ matplotlib
39+ numpy
40+ pandas
41+ pygame
42+ pyopengl
43+ scipy
44+ scikitimage
45+ gym
46+ bokeh
47+ kubernetes
48+ redis
49+ minio
50+ psutil
51+ ];
52+
53+ checkInputs = [
54+ pytest
55+ ];
56+
57+ # run only some tests that do not need any optional dependencies
58+ # available tests: https://github.com/NervanaSystems/coach/tree/master/rl_coach/tests
59+ testsToRun = [
60+ # test only the tensorflow backend (not mxnet)
61+ "architectures/tensorflow_components"
62+ "agents"
63+ "exploration_policies"
64+ "filters"
65+ "memories"
66+ "utils"
67+ ];
68+ checkPhase = let
69+ fullTestPaths = map (testfile: "rl_coach/tests/${testfile}") testsToRun;
70+ escapedPaths = map lib.escapeShellArg fullTestPaths;
71+ pytestArgs = builtins.concatStringsSep " " escapedPaths;
72+ in
73+ ''
74+ pytest ${pytestArgs}
75+ '';
76+
77+ postPatch = ''
78+ # pinned to 8.0.1 for unknown reason, at least basic functionallity seems to work without it
79+ # https://github.com/NervanaSystems/coach/pull/149#issuecomment-495915804
80+ sed -i '/kubernetes/d' requirements.txt
81+
82+ # this is just an "intel-optimized" version of tensorflow, e.g. an implementation detail
83+ sed -i 's/intel-tensorflow/tensorflow/g' setup.py
84+
85+ # backports of python3 features not needed
86+ # https://github.com/NervanaSystems/coach/issues/324
87+ sed -i '/futures/d' requirements.txt
88+ '';
89+
90+ disabled = pythonOlder "3.5"; # minimum required version
91+
92+ meta = with stdenv.lib; {
93+ description = "Enables easy experimentation with state of the art Reinforcement Learning algorithms";
94+ homepage = "https://nervanasystems.github.io/coach/";
95+ license = licenses.asl20;
96+ maintainers = with maintainers; [ timokau ];
97+ };
98+}
pkgs/top-level/python-packages.nix+4
@@ -5274,8 +5274,12 @@ in {
52745274
52755275 sigtools = callPackage ../development/python-modules/sigtools { };
52765276
5277+ annoy = callPackage ../development/python-modules/annoy { };
5278+
52775279 clize = callPackage ../development/python-modules/clize { };
52785280
5281+ rl-coach = callPackage ../development/python-modules/rl-coach { };
5282+
52795283 zerobin = callPackage ../development/python-modules/zerobin { };
52805284
52815285 tensorflow-estimator = callPackage ../development/python-modules/tensorflow-estimator { };