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

added executables in bin folder #1253

Merged
merged 4 commits into from
Nov 18, 2014
Merged
Changes from 2 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
10 changes: 5 additions & 5 deletions bin/pylearn2-plot-monitor
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from theano.compat.six import exec_

from pylearn2.scripts import plot_monitor
if plot_monitor.__file__.endswith('pyc'):
f = open(plot_monitor.__file__[:-1])
else:
f = open(plot_monitor.__file__)
exec f
filename = plot_monitor.__file__
f = open(filename[:-1 if filename.endswith('.pyc') else None])
exec_(f.read())
10 changes: 5 additions & 5 deletions bin/pylearn2-print-monitor
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from theano.compat.six import exec_

from pylearn2.scripts import print_monitor
if print_monitor.__file__.endswith('pyc'):
f = open(print_monitor.__file__[:-1])
else:
f = open(print_monitor.__file__)
exec f
filename = print_monitor.__file__
f = open(filename[:-1 if filename.endswith('.pyc') else None])
exec_(f.read())
10 changes: 5 additions & 5 deletions bin/pylearn2-show-examples
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from theano.compat.six import exec_

from pylearn2.scripts import show_examples
if show_examples.__file__.endswith('pyc'):
f = open(show_examples.__file__[:-1])
else:
f = open(show_examples.__file__)
exec f
filename = show_examples.__file__
f = open(filename[:-1 if filename.endswith('.pyc') else None])
exec_(f.read())
12 changes: 6 additions & 6 deletions bin/pylearn2-show-weights
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from pylearn2.scripts import show_weights
if show_weights.__file__.endswith('pyc'):
f = open(show_weights.__file__[:-1])
else:
f = open(show_weights.__file__)
exec f
from theano.compat.six import exec_

from pylearn2.scripts import show_weights
filename = show_weights.__file__
f = open(filename[:-1 if filename.endswith('.pyc') else None])
exec_(f.read())
10 changes: 5 additions & 5 deletions bin/pylearn2-train
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from theano.compat.six import exec_

from pylearn2.scripts import train
if train.__file__.endswith('pyc'):
f = open(train.__file__[:-1])
else:
f = open(train.__file__)
exec f
filename = train.__file__
f = open(filename[:-1 if filename.endswith('.pyc') else None])
exec_(f.read())
42 changes: 22 additions & 20 deletions setup.py
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@
from setuptools.command.install import install
import numpy

from theano.compat.six.moves import input

# Because many people neglected to run the pylearn2/utils/setup.py script
# separately, we compile the necessary Cython extensions here but because
# Cython is not a strict dependency, we issue a warning when it is not
@@ -35,30 +37,30 @@
# Inform user of setup.py develop preference
class pylearn2_install(install):
def run(self):
print ("Because Pylearn2 is under heavy development, we generally do "
"not advice using the `setup.py install` command. Please "
"consider using the `setup.py develop` command instead for the "
"following reasons:\n\n1. Using `setup.py install` creates a "
"copy of the Pylearn2 source code in your Python installation "
"path. In order to update Pylearn2 afterwards you will need to "
"rerun `setup.py install` (!). Simply using `git pull` to "
"update your local copy of Pylearn2 code will not suffice. \n\n"
"2. When using `sudo` to install Pylearn2, all files, "
"including the tutorials, will be copied to a directory owned "
"by root. Not only is running tutorials as root unsafe, it "
"also means that all Pylearn2-related environment variables "
"which were defined for the user will be unavailable.\n\n"
"Pressing enter will continue the installation of Pylearn2 in "
"`develop` mode instead. Note that this means that you need to "
"keep this folder with the Pylearn2 code in its current "
"location. If you know what you are doing, and are very sure "
"that you want to install Pylearn2 using the `install` "
"command instead, please type `install`.\n")
print("Because Pylearn2 is under heavy development, we generally do "
"not advice using the `setup.py install` command. Please "
"consider using the `setup.py develop` command instead for the "
"following reasons:\n\n1. Using `setup.py install` creates a "
"copy of the Pylearn2 source code in your Python installation "
"path. In order to update Pylearn2 afterwards you will need to "
"rerun `setup.py install` (!). Simply using `git pull` to "
"update your local copy of Pylearn2 code will not suffice. \n\n"
"2. When using `sudo` to install Pylearn2, all files, "
"including the tutorials, will be copied to a directory owned "
"by root. Not only is running tutorials as root unsafe, it "
"also means that all Pylearn2-related environment variables "
"which were defined for the user will be unavailable.\n\n"
"Pressing enter will continue the installation of Pylearn2 in "
"`develop` mode instead. Note that this means that you need to "
"keep this folder with the Pylearn2 code in its current "
"location. If you know what you are doing, and are very sure "
"that you want to install Pylearn2 using the `install` "
"command instead, please type `install`.\n")
mode = None
while mode not in ['', 'install', 'develop', 'cancel']:
if mode is not None:
print("Please try again")
mode = raw_input("Installation mode: [develop]/install/cancel: ")
mode = input("Installation mode: [develop]/install/cancel: ")
if mode in ['', 'develop']:
self.distribution.run_command('develop')
if mode == 'install':