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

Notebooks for every day #73

Closed
ramon-astudillo opened this issue Jan 30, 2018 · 8 comments
Closed

Notebooks for every day #73

ramon-astudillo opened this issue Jan 30, 2018 · 8 comments
Assignees
Projects

Comments

@ramon-astudillo
Copy link
Member

ramon-astudillo commented Jan 30, 2018

As @davidbp has been suggested for a while, we should have all days in jupyter notebooks.

I did this fir the new pytorch deep days see labs/notebooks/non_linear_classifiers/ and labs/notebooks/non_linear_sequence_classifiers/.

There is also a script labs/convert_notebooks.sh to automatically create the *.py version for those who want to work remote.

It seems a good idea to try to derive the unit tests for each day in a similar way, see #72

@ramon-astudillo
Copy link
Member Author

@davidbp what do you think?. Note that unlike un your case, where you put the formulas, here the notebooks only reproduce the text of the exercise.

@davidbp
Copy link
Member

davidbp commented Feb 8, 2018

Good idea,

Since all notebook are in /labs/notebooks/folder_topic, we could start each notebook with a

import sys
sys.path.append("../../../")

to ensure that import lxmls just works.

@ramon-astudillo
Copy link
Member Author

Actually I am thinking of using python setup.py develop. This will symbolically link the code so that changes take effect immediately and modules can be imported anywhere (notebooks need to be reload still).

My only worry is compatibility with anaconda and less python fluent students.

@davidbp
Copy link
Member

davidbp commented Feb 8, 2018

In anaconda it just works.

Let me investigate a bit the easiest way to set all up.

@davidbp
Copy link
Member

davidbp commented Feb 8, 2018

It seems that in order to do python setup.py develop you need to be sudoer.

I created a user to test the installation as if I was a new student.
This is what I get

testuser:lxmls-toolkit test$ python setup.py "develop"
running develop
Checking .pth file support in /Library/Python/2.7/site-packages/
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-2000.pth'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /Library/Python/2.7/site-packages/

Perhaps your account does not have write access to this directory?  If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account.  If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.

For information on other options, you may wish to consult the
documentation at:

  https://pythonhosted.org/setuptools/easy_install.html

Please make the appropriate changes for your system and try again.

If that is the case I would simply add to the PYTHONPATH the folder containing lxmls. This would allow to use the package to be imported anywhere.

@ramon-astudillo
Copy link
Member Author

ramon-astudillo commented Feb 8, 2018 via email

@dcferreira
Copy link
Contributor

There should be no need for sudo:

dferreira@2018-02-08 11:56:11:/tmp$ virtualenv test
Using base prefix '/home/dferreira/.pyenv/versions/3.5.2'
New python executable in /tmp/test/bin/python3.5
Also creating executable in /tmp/test/bin/python
Installing setuptools, pip, wheel...done.
dferreira@2018-02-08 11:56:21:/tmp$ cd test/
dferreira@2018-02-08 11:56:25:/tmp/test$ source bin/activate
(test) dferreira@2018-02-08 11:56:47:/tmp/test$ git clone git@github.com:LxMLS/lxmls-toolkit.git
Cloning into 'lxmls-toolkit'...
X11 forwarding request failed on channel 0
remote: Counting objects: 2624, done.
remote: Compressing objects: 100% (93/93), done.
remote: Total 2624 (delta 76), reused 105 (delta 55), pack-reused 2476
Receiving objects: 100% (2624/2624), 21.80 MiB | 7.84 MiB/s, done.
Resolving deltas: 100% (1706/1706), done.
Checking connectivity... done.
(test) dferreira@2018-02-08 11:57:01:/tmp/test$ cd lxmls-toolkit/
(test) dferreira@2018-02-08 11:57:16:/tmp/test/lxmls-toolkit$ python setup.py develop
running develop
running egg_info
creating LxMLS_Toolkit.egg-info
writing LxMLS_Toolkit.egg-info/PKG-INFO
writing top-level names to LxMLS_Toolkit.egg-info/top_level.txt
writing dependency_links to LxMLS_Toolkit.egg-info/dependency_links.txt
writing manifest file 'LxMLS_Toolkit.egg-info/SOURCES.txt'
file lxmls.py (for module lxmls) not found
reading manifest file 'LxMLS_Toolkit.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.txt' under directory 'docs'
warning: manifest_maker: MANIFEST.in, line 3: 'recursive-include' expects <dir> <pattern1> <pattern2> ...

writing manifest file 'LxMLS_Toolkit.egg-info/SOURCES.txt'
running build_ext
Creating /tmp/test/lib/python3.5/site-packages/LxMLS-Toolkit.egg-link (link to .)
Adding LxMLS-Toolkit 0.0.1 to easy-install.pth file

Installed /tmp/test/lxmls-toolkit
Processing dependencies for LxMLS-Toolkit==0.0.1
Finished processing dependencies for LxMLS-Toolkit==0.0.1

@ramon-astudillo
Copy link
Member Author

import sys
sys.path.append("../../../")

Removed these and added instructions to install also the student version. This closes the issue.

@ramon-astudillo ramon-astudillo moved this from WIP to DONE in lxmls 2018 Mar 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

3 participants