Collection of digital signal processing packages for analyzing data from Broad-Energy Germanium (BEGe) detectors
Open up your terminal and clone the repository locally
$ mkdir ~/work>/dev/null 2>&1 && cd ~/work
$ git clone git@github.com:giachero/BEGepro.git
-
Install the
virtualenv
tool with pip:$ pip install virtualenv
-
Create a new directory to work with:
$ mkdir ~/pvenv>/dev/null 2>&1 && cd ~/pvenv
-
Create a new virtual environment inside the directory
$ virtualenv -p `which python3.6` ~/pvenv/begenv3.6
or
$ virtualenv -p `which python3.7` ~/pvenv/begenv3.7
-
Activate the isolated environment
$ source ~/pvenv/begenv3.7/bin/activate (begenv3.7) $
Notice how your prompt is now prefixed with the name of your environment.
-
Use
requirements.txt
file to install all dependencies for a basilar python3 installation(begenv3.7) $ pip install -r ~/work/BEGepro/requirements.txt
This installs also the Matplotlib plotting library that needs tkinter to work properly.
According with your python3 version (in Ubuntu), install the tkinter library for python3 as follow(begenv3.7) $ sudo apt-get install python3-tk (begenv3.6) $ sudo apt-get install python3.6-tk (begenv3.7) $ sudo apt-get install python3.7-tk
-
To exit the isolated environment
(begenv3.7) $ deactivate
To install the package and then then being able to edit and update the code
(begenv3.7) $ cd ~/work/BEGepro/
(begenv3.7) $ python setup.py develop
The develop
option will not install the package but it will create a .egg-link in the deployment directory back to the project source code directory.
To install the packages for usage purpose wihtout the possibility to develop/modify/debug it
(begenv3.7) $ cd ~/work/BEGepro/
(begenv3.7) $ python setup.py install
To check if the begepro package is installed
(begenv3.7) $ pip freeze | grep begepro
and the ouput must be something similar to
begepro==0.0.1
To uninstall the packages
(begenv3.7) $ cd ~/work/BEGepro/
(begenv3.7) $ rm -rf build/ dist/ begepro.egg-info
(begenv3.7) $ pip uninstall begepro
- Structuring Your Project in python, from docs.python-guide.or and from Ken Reitz's site. Github example here.
- Making a Python Package, from readthedocs.io