pysto
are a few miscellaneous processing python functions.
The name is a play of words on "pisto", a Manchego dish made of tomatoes, onions, courgettes, green and red peppers and olive oil.
-
Install the latest pysto PyPI package
pip install pysto
-
Uninstall the package
pip uninstall pysto
-
If you get the error
pip error: Cannot locate installed-files.txt
, remove pysto manually. For example, if you are in a conda environmentrm -rf ${CONDA_PREFIX}/lib/python3.6/site-packages/pysto*
We provide scripts install_pysto_environment.sh
and build_SimpleElastix.sh
to help install necessary software, and a Makefile
to simplify testing and releasing.
-
If you want to develop code for pysto, instead of installing the PyPI package, you want to clone the github repository
git clone https://github.com/rcasero/pysto.git
-
Install the development dependencies (this creates local conda environments
pysto_2.7
andpysto_3.6
, for python 2.7 and 3.6, respectively and installs several Ubuntu and python packages). There are two options, depending on what SimpleITK you want:-
If you are happy with the official SimpleITK package, just run (this is very fast)
cd pysto/tools ./install_pysto_environment.sh
-
If you prefer SimpleElastix (an extension of SimpleITK with elastix registration software)
cd pysto/tools ./install_pysto_environment.sh SimpleElastix
-
-
Install the pysto code to one or both of the local environments
conda activate pysto_2.7 pip install --upgrade . conda activate pysto_3.6 pip install --upgrade .
-
You need to have a local file
~/.pypirc
(replace<the password>
by the password). This will be used bytwine
to release packages to PyPI[distutils] index-servers = pypi pypitest [pypi] username=rcasero password=<the password> [pypitest] repository = https://test.pypi.org/legacy/ username=rcasero password=<the password>
-
Protect the file so that it can be read only by you
chmod 600 ~/.pypirc
-
Delete the conda local environments (this will delete all the python packages inside the environments)
source deactivate conda remove --name pysto_2.7 --all conda remove --name pysto_3.6 --all
-
Activate one of the pysto local environments
cd ~/Software/pysto source activate pysto_3.6
-
Launch the development IDE, e.g.
pycharm-community &
-
In your code, import the pysto modules/functions in the usual way, e.g.
import pysto.imgproc as pym import pysto.imgprocITK as pymITK [...] imf = pym.imfuse(im1, im2) pymITK.imshow(im3)
-
While developing, you can run all tests (both for python 2.7 and 3.6) from the command line with
make test
-
We assume that you have made some changes to the code, and commit/pushed them to the GitHub repository.
-
Update
version
anddownload_url
insetup.py
with new release number. If something else has changed in the project, update other relevant fields insetup.py
.setup( ... version='1.0.0', download_url='https://github.com/rcasero/pysto/archive/1.0.0.tar.gz', ... )
-
Update
ChangeLog.md
with the main changes to this release, in markdown format. -
Commit and push all changes to the repository.
-
Make a test package. (This will also tag the release in github, create the test package/wheel and upload to the test PyPI server), that you can see in https://test.pypi.org/project/pysto/
make test-package
-
If everything has gone well, make the release package, that you can see in https://pypi.org/project/pysto/
make package
-
Go to pysto GitHub release tags, click on "Edit release notes" and copy and paste the new entry from the
ChangeLog.md