Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace %env magic with os.environ #283

Merged
merged 1 commit into from
Sep 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion week01_intro/crossentropy_method.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"import os\n",
"if type(os.environ.get(\"DISPLAY\")) is not str or len(os.environ.get(\"DISPLAY\")) == 0:\n",
" !bash ../xvfb start\n",
" %env DISPLAY = : 1"
" os.environ['DISPLAY'] = ':1'"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion week01_intro/deep_crossentropy_method.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"import os\n",
"if type(os.environ.get(\"DISPLAY\")) is not str or len(os.environ.get(\"DISPLAY\")) == 0:\n",
" !bash ../xvfb start\n",
" %env DISPLAY = : 1"
" os.environ['DISPLAY'] = ':1'"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion week01_intro/seminar_gym_interface.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"import os\n",
"if type(os.environ.get(\"DISPLAY\")) is not str or len(os.environ.get(\"DISPLAY\")) == 0:\n",
" !bash ../xvfb start\n",
" %env DISPLAY = : 1"
" os.environ['DISPLAY'] = ':1'"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions week03_model_free/homework.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"import os\n",
"if type(os.environ.get(\"DISPLAY\")) is not str or len(os.environ.get(\"DISPLAY\")) == 0:\n",
" !bash ../xvfb start\n",
" %env DISPLAY = : 1\n",
" os.environ['DISPLAY'] = ':1'\n",
"\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
Expand Down Expand Up @@ -428,7 +428,7 @@
"import os\n",
"if type(os.environ.get(\"DISPLAY\")) is not str or len(os.environ.get(\"DISPLAY\")) == 0:\n",
" !bash ../xvfb start\n",
" %env DISPLAY = : 1\n",
" os.environ['DISPLAY'] = ':1'\n",
"\n",
"%load_ext autoreload\n",
"%autoreload 2\n",
Expand Down
2 changes: 1 addition & 1 deletion week03_model_free/seminar_qlearning.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"import os\n",
"if type(os.environ.get(\"DISPLAY\")) is not str or len(os.environ.get(\"DISPLAY\")) == 0:\n",
" !bash ../xvfb start\n",
" %env DISPLAY = : 1\n",
" os.environ['DISPLAY'] = ':1'\n",
"\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
Expand Down
2 changes: 1 addition & 1 deletion week04_approx_rl/homework_lasagne.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"\n",
" !bash ../xvfb start",
"\n",
" %env DISPLAY = : 1"
" os.environ['DISPLAY'] = ':1'"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion week04_approx_rl/homework_pytorch_debug.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"import os\n",
"if type(os.environ.get(\"DISPLAY\")) is not str or len(os.environ.get(\"DISPLAY\")) == 0:\n",
" !bash ../xvfb start\n",
" %env DISPLAY = : 1"
" os.environ['DISPLAY'] = ':1'"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion week04_approx_rl/homework_pytorch_main.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"import os\n",
"if type(os.environ.get(\"DISPLAY\")) is not str or len(os.environ.get(\"DISPLAY\")) == 0:\n",
" !bash ../xvfb start\n",
" %env DISPLAY = : 1"
" os.environ['DISPLAY'] = ':1'"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion week04_approx_rl/homework_tf.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"\n",
" !bash ../xvfb start",
"\n",
" %env DISPLAY = : 1"
" os.environ['DISPLAY'] = ':1'"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion week04_approx_rl/seminar_lasagne.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"\n",
" !bash ../xvfb start",
"\n",
" %env DISPLAY = : 1"
" os.environ['DISPLAY'] = ':1'"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion week04_approx_rl/seminar_pytorch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"import os\n",
"if type(os.environ.get(\"DISPLAY\")) is not str or len(os.environ.get(\"DISPLAY\")) == 0:\n",
" !bash ../xvfb start\n",
" %env DISPLAY = : 1"
" os.environ['DISPLAY'] = ':1'"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion week04_approx_rl/seminar_tf.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"import os\n",
"if type(os.environ.get(\"DISPLAY\")) is not str or len(os.environ.get(\"DISPLAY\"))==0:\n",
" !bash ../xvfb start\n",
" %env DISPLAY=:1"
" os.environ['DISPLAY'] = ':1'"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion week06_policy_based/a2c-optional.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"import os\n",
"if type(os.environ.get(\"DISPLAY\")) is not str or len(os.environ.get(\"DISPLAY\")) == 0:\n",
" !bash ../xvfb start\n",
" %env DISPLAY = : 1"
" os.environ['DISPLAY'] = ':1'"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion week06_policy_based/reinforce_lasagne.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"\n",
" !bash ../xvfb start",
"\n",
" %env DISPLAY = : 1"
" os.environ['DISPLAY'] = ':1'"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion week06_policy_based/reinforce_pytorch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"import os\n",
"if type(os.environ.get(\"DISPLAY\")) is not str or len(os.environ.get(\"DISPLAY\")) == 0:\n",
" !bash ../xvfb start\n",
" %env DISPLAY = : 1"
" os.environ['DISPLAY'] = ':1'"
]
},
{
Expand Down
3 changes: 1 addition & 2 deletions week06_policy_based/reinforce_tensorflow.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@
"metadata": {},
"outputs": [],
"source": [
"%env THEANO_FLAGS = 'floatX=float32'\n",
"import os\n",
"if type(os.environ.get(\"DISPLAY\")) is not str or len(os.environ.get(\"DISPLAY\")) == 0:\n",
" !bash ../xvfb start\n",
" %env DISPLAY = : 1"
" os.environ['DISPLAY'] = ':1'"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion week08_pomdp/practice_pytorch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"import os\n",
"if type(os.environ.get(\"DISPLAY\")) is not str or len(os.environ.get(\"DISPLAY\")) == 0:\n",
" !bash ../xvfb start\n",
" %env DISPLAY = : 1"
" os.environ['DISPLAY'] = ':1'"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion week08_pomdp/practice_tensorflow.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"\n",
" !bash ../xvfb start",
"\n",
" %env DISPLAY = : 1"
" os.environ['DISPLAY'] = ':1'"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion week08_pomdp/practice_theano.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"\n",
" !bash ../xvfb start",
"\n",
" %env DISPLAY = : 1"
" os.environ['DISPLAY'] = ':1'"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion week09_policy_II/ppo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"import os\n",
"if type(os.environ.get(\"DISPLAY\")) is not str or len(os.environ.get(\"DISPLAY\")) == 0:\n",
" !bash ../xvfb start\n",
" %env DISPLAY = : 1"
" os.environ['DISPLAY'] = ':1'"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion week09_policy_II/seminar_TRPO_pytorch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"import os\n",
"if type(os.environ.get(\"DISPLAY\")) is not str or len(os.environ.get(\"DISPLAY\")) == 0:\n",
" !bash ../xvfb start\n",
" %env DISPLAY = : 1"
" os.environ['DISPLAY'] = ':1'"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion week09_policy_II/seminar_TRPO_tensorflow.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"import os\n",
"if type(os.environ.get(\"DISPLAY\")) is not str or len(os.environ.get(\"DISPLAY\")) == 0:\n",
" !bash ../xvfb start\n",
" %env DISPLAY = : 1"
" os.environ['DISPLAY'] = ':1'"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion week09_policy_II/seminar_TRPO_theano.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"import os\n",
"if type(os.environ.get(\"DISPLAY\")) is not str or len(os.environ.get(\"DISPLAY\")) == 0:\n",
" !bash ../xvfb start\n",
" %env DISPLAY = : 1"
" os.environ['DISPLAY'] = ':1'"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion week10_planning/seminar_MCTS.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"import os\n",
"if type(os.environ.get(\"DISPLAY\")) is not str or len(os.environ.get(\"DISPLAY\")) == 0:\n",
" !bash ../xvfb start\n",
" %env DISPLAY = : 1\n",
" os.environ['DISPLAY'] = ':1'\n",
"\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
Expand Down