Go to file
Sylvain Tricot c9aa391634 Merge branch 'hotfix/1.7.post13' 2023-03-29 11:45:01 +02:00
CI Fix bugs in packaging procedure. 2020-03-12 16:16:28 +01:00
doc Updated the git repo link in 'install section' 2021-09-27 14:16:07 +02:00
src Fix new dtype values for Numpy. 2023-03-29 11:41:52 +02:00
tests/sprkkr Fix bug in atom_types. 2021-02-22 20:22:58 +01:00
utils Removed malloc NPH_M parameter. 2021-12-13 18:51:12 +01:00
.gitattributes Add .gitattributes 2019-11-15 16:53:41 +01:00
.gitignore Update gitignore. 2021-03-04 11:01:54 +01:00
Dockerfile Updated venv target in Makefile. 2021-09-27 15:50:52 +02:00
Jenkinsfile Tried to fix the broken 'syncing website' stage. 2021-09-27 14:17:25 +02:00
Makefile Fix numpy bug with alen() 2022-10-06 18:19:16 +02:00
README.md Updated installation instructions. 2021-09-24 16:04:34 +02:00
license.txt iUpdate the license info 2019-11-15 16:24:12 +01:00

README.md

Introduction

This is the Python MsSpec version with support for Python 3.x and dynamic memory allocation for Phagen and Spec

Installation

Requirements

To compile MsSpec shared libraries, you need:

  • Python >= 3.6
  • gfortran compiler
  • cairo library (runtime files and header files)

Depending on your OS and Python version, you may need all the requirements (runtime libraries and header files) to build wxPython (please consult your distribution's package list for the appropriate package names) and their dependencies:

  • python-dev (for your version of python)
  • gtk (preferably version 3, but depends on your needs)
  • gstreamer
  • gstreamer-plugins-base
  • glut
  • libwebkitgtk (matching your gtk version)
  • libjpeg
  • libpng
  • libtiff
  • libsdl
  • libnotify
  • libsm

You also need a tool to create and manage Python virtual environments. For now only virtualenv is supported. So if you plan to install msspec with the one-step command, you need to install it.

Fetching the code

You first need to clone the repository with the command below:

git clone https://git.ipr.univ-rennes1.fr/epsi/msspec_python3.git

If you want to pull the devel branch (unstable):

git clone --branch devel https://git.ipr.univ-rennes1.fr/epsi/msspec_python3.git

This will create a msspec_python3 folder with a local copy of the repository.

One step install

The command below will do all the stuff to install msspec in its dedicated Python virtual environment provided all the above requirements are fullfilled:

cd msspec_python3
make install

This will:

  • Create a Python virtual environment in your '~/.local/src' folder
  • Install all the required Python packages in this virtual environment.
  • Install (or even maybe build) wxPython for your OS and Python version in this virtual environment.
  • Build the msspec shared librarires.
  • Install the Python msspec package in this virtual environment.
  • Install a frontend script called 'msspec' in the '~/.local/bin' folder.

You can tweak the process by specifying space separated key=value pairs on the command line. Allowed keys are:

  • PYTHON, to give the executable name of the python interpreter to use rather than the default (python)
  • VERBOSE, set to 1 if you want the install process to be more verbose
  • NO_VENV, set to 1 to not create a virtual environment
  • VENV_PATH, specify the path to a virtual environment root folder
  • DEBUG, set to 1 to add debugging symbols
  • BUILDDIR, to set a different name than the default to store building artifacts (./build)
  • FC, the Fortran compiler to use (gfortran)
  • F2PY

To install msspec in developpment mode, use:

cd msspec_python3
make devel

This will do the same steps as above except that the virtual environment will be located in the "_venv" folder inside the "msspec_python3" folder and the frontend script will not be installed.

Working with msspec

Use the frontend command to process a Python script with msspec.

msspec -p myscript.py

This will execute the myscript.py inside the msspec virtual environment.

You can also load a hdf5 file with the '-l' option:

msspec -l results.hdf5

You can load an iPython console with "msspec -i". It is a good way to modify the virtual environment of MsSpec since you can add or remove packages withe the "%pip" command.

If you want to activate the MsSpec virtual environment in your current shell session:

eval $(msspec -e)

You can then run scripts using the 'python' command directly. Type in 'deactivate' to go back to your standard shell.

See the online tutorials for more information on how to use msspec.

Uninstall MsSpec

To remove MsSpec, use the command:

msspec -u

This will simply remove the virtual environment folder in '~/.local/src' and the frontend script in '~/.local/bin'.

When Installed in "devel mode", nothing is created outside the msspec_python3 folder, so you just have to remove that folder to get rid of msspec on your computer

Manual control over the install

If for any reason you want to control each step of the building process (for example you do not have virtualenv but you are using conda), here is how:

  • Create a virtual environment or use an existing one and activate it
  • Install the list of requirements that are listed in the src/pip.freeze file
  • Install wxPython
  • Build the msspec shared librarires with the command "make pybinding"
  • Install the msspec Python package with "pip install -e src/"

The last step can be replaced by adding the src/ path to your PYTHONPATH, but bear in mind that the package will then be also visible to other virtual environments no matter they fit the msspec requirements.