I found these two things save me some time while developing,
bash kernel for notebooks
git clone firstname.lastname@example.org:takluyver/bash_kernel.git cd bash_kernel source activate fastai python -m bash_kernel.install --sys-prefix
This is handy because I often find bash easiest for certain tasks, and building a script in a notebook is easier than running commands in the shell and copying them into an editor
The benefit over python notebook + shell is the syntax becomes simpler when saving or passing variables, and the syntax highlighting is better. Of course, if someone else has a better way, I’m all ears.
ctag vim navigation
Also, unrelated, I found this guide useful for explaining how to do the navigation Jeremy did in Vim with Ctrl+] to move around source code via “tags”
Basically, something like this,
sudo apt-get install exuberant-ctags ctags -R -o ~/ctags ~/fastai-pytorch/fastai/ ~/anaconda3/envs/fastai/lib/python3.6/ echo --python-kinds=-i > ~/.ctags
Add to crontab (might need to change ~ to full path),
1 * * * * ~/ctags ~/fastai-pytorch/fastai/ ~/anaconda3/envs/fastai/lib/python3.6/ 2>/dev/null
-i in the ~/.ctags file means “ignore imports” as discussed here. You might also add -v
this doesn’t seem to work for python core libraries, for example, if I put the cursor on
os.path.joinit takes me to the definition of
ntpath.py(which has the code for os.path), but at least it works for jumping around fastai code. Perhaps better still is to use an IDE like Pycharm
Again, if there is an easier or more correct way to set this up, I’m happy to hear it.