From 08c6ea7a34aaaea910b0a999ee2ca324c97d88b9 Mon Sep 17 00:00:00 2001 From: sylvain tricot Date: Fri, 24 Sep 2021 16:04:34 +0200 Subject: [PATCH] Updated installation instructions. The README.md file contains now more information on how to install MsSpec (compilation and Python package) either in standard or devel mode. --- README.md | 76 +++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 52 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index ace7af2..531b120 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ Introduction This is the Python MsSpec version with support for Python 3.x and dynamic memory allocation for Phagen and Spec -Installation of the devel package -================================= +Installation +============ Requirements ------------ @@ -42,13 +42,14 @@ you need to install it. Fetching the code ----------------- -You first need to clone the devel branch with either 2 commands below: +You first need to clone the repository with the command below: ```Bash git clone https://git.ipr.univ-rennes1.fr/epsi/msspec_python3.git -git checkout devel ``` +If you want to pull the devel branch (unstable): + ```Bash git clone --branch devel https://git.ipr.univ-rennes1.fr/epsi/msspec_python3.git ``` @@ -61,21 +62,22 @@ 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 +virtual environment provided all the above requirements are fullfilled: ```Bash cd msspec_python3 -make devel +make install ``` This will: -- Create a Python virtual environment in the "\_venv" folder inside the msspec\_python3 folder. +- 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 msspec in *edit mode* in this virtual environment. +- 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: @@ -89,35 +91,61 @@ Allowed keys are: - FC, the Fortran compiler to use (gfortran) - F2PY - -Work with msspec ----------------- - -All you need to do each time you want to work with msspec is activating the virtual environment. - -For example, if *virtualenv* was used to create the virtual environment: - +To install msspec in developpment mode, use: ```Bash -source msspec_python3/_venv/bin/activate +cd msspec_python3 +make devel ``` -Then you can launch your script with +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. ```Bash -python myscript.py +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: + +```Bash +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: + +```Bash +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](https://msspec.cnrs.fr/tutorials/index.html) for more information on how to use msspec. -When you're done, you can deactivate the virtual environment with - -```Bash -deactivate -``` Uninstall MsSpec ---------------- +To remove MsSpec, use the command: + +```Bash +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