Installing Emacs on Ubuntu and Python in 2017

Now install Python packages required by elpy. The idea is to
deliberately keep these “elpy requirements” separate from the
packages required by each python project. This way, we can update
the “elpy packages” across the entire system in one go; and we can
list just the packages required by each project using
pip freeze --local.

(require 'package)
(add-to-list 'package-archives
'("elpy" . "http://jorgenschaefer.github.io/packages/"))
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(package-selected-packages (quote (elpy)))
)
;; eply
(package-initialize)
(elpy-enable)
(elpy-use-ipython)

Documenting code

sphinx-apidoc “is a
tool for automatic generation of Sphinx sources that, using the
autodoc extension, document a whole package in the style of other
automatic API documentation tools.”

Python libraries

Monary - need to install these
Ubuntu
packages,
then install
mongo-c-driver, then
create /etc/ld.so.conf.d/libmongoc.conf and write /usr/local/lib
in that file. Then run sudo ldconfig. Then run make test. Then
do pip install pkgconfig monary.

GPUStats - “gpustats is a
PyCUDA-based library
implementing functionality similar to that present in scipy.stats.
It implements a simple framework for specifying new CUDA kernels and
extending existing ones. Here is a (partial) list of target
functionality: Probability density functions (pdfs). These are
intended to speed up likelihood calculations in particular in
Bayesian inference applications, such as in PyMC, Random variable
generation using CURAND”

PyMC - “PyMC is a
python module that implements Bayesian statistical models and
fitting algorithms, including Markov chain Monte Carlo. Its
flexibility and extensibility make it applicable to a large suite
of problems. Along with core sampling functionality, PyMC includes
methods for summarizing output, plotting, goodness-of-fit and
convergence diagnostics.”

Python 2 versus 3

GUIs

From some very superficial searching, it looks like wxPython is the
prefered Python GUI for use with matplotlib (I could be
wrong though). One big disadvantage is that wxPython isn’t packaged
as standard with Python, whilst tkInter is.

Profiling

Packaging

distribute
aims to supercede setuptools. distribute is compatible with
Python 3, setuptools isn’t. My setup.py files are sufficiently
simple to mean that I don’t need to modify anything to allow users
to use either setuptools or distribute.

Notes for creating a package

Aims & Overview:

Upload just description of project to pypi using
python setup.py register.

Don’t upload code to pypi. Instead use download_url in
setup.py to point to github. e.g.:
download_url = "https://github.com/JackKelly/rfm_ecomanager_logger/tarball/master#egg=rfm_ecomanager_logger-dev"

Use git tags to track version numbers.

Automatically suck these version numbers into Python’s packaging
system and also into the project’s __version__ attribute.

Might need to use ConfigParse to parse setup.cfg (see this
example) to
extract the version number from setup.cfg

Figure out how to point download_url to the correct tag

It appears that two things are necessary to get upgrading to work
correctly: version (in setup.py) needs to incremement and
download_url needs to point to a URL with #egg=PROJECT-VERSION
appended to it (or upload all the files to pypi instead of
downloading from github, but that feels rather ugly to duplicate
lots of files)

I try to mitigate climate change using computer science. I am a Research Engineer at DeepMind, mostly working on energy problems. Previously, I worked on energy disaggregation as a post-doc at Imperial College London. Read more about me…