Documentation of Michiel Cottaar’s code¶
general utilities
Script interface for all mcot submodules |
|
Math stuff |
|
Interface to Bibtex file |
neuroimaging utilities
Utilities for working with cortical meshes |
|
CIFTI tools |
neuroimaging applications
Gyral coordinate system |
|
Module to analyse DIffusion-Prepared Phase Imaging (DIPPI) data |
General package¶
The personal utilities and libraries from Michiel Cottaar.
This code contains many different packages which can either be installed separately using pip install mcot.<package> or as one whole pip install mcot.
Command line scripts¶
Command line scripts are all available through a single executable: mcot .
This executable will be installed irrespective of the package you install (it is part of mcot.utils
, which is required by all other packages).
You can run a specific script using:
mcot $SCRIPTNAME
Many scripts are grouped together, in which case they can be called as:
mcot $GROUP $SCRIPTNAME
To list the installed scripts just type:
mcot
Developer’s notes¶
All packages are managed as a single monorepo available at https://git.fmrib.ox.ac.uk/ndcn0236/mcot. Testing and packaging is handled through the pants build system https://www.pantsbuild.org/. First make sure to be in the top-level directory and then run the following to test:
./pants test ::
or to build the packages:
./pants package ::
To bump the version number of a package run:
./bump_project.sh <package> <part>
where <part> is one of “major”, “minor”, or “patch”. This will bump the version of both the package and the mcot complete package, which can then be uploaded using twine.
Adding a new package¶
Create a new directory in “src/mcot”
Add a README.rst and VERSION file with a description and the version number.
Use
mcot.utils.build.load_info()
in __init__.py to import the README and version numberfrom mcot.utils.build import load_info __doc__, __version__ = load_info(__name__) del load_info
Copy an existing .bumpversion.cfg from another directory and update the current version number
Copy a BUILD script from another package (e.g., mcot.surface) and adjust the contents accordingly
Copy BUILD script to test directory from test directory of another project (e.g., “src/mcot/surface/tests”)
Add the package to the BUILD script in the top-level directory
Add package requirements to “requirements.txt”
Add the package to documenation in doc/index.rst
Run the tests for this package
./pants test src/mcot/<package name>/tests/:
Test the package build:
./pants package src/mcot/<package name>:
Build the documentation
python doc/publish.py