Skip to content

Commit

Permalink
🚚 cpac-py → cpac
Browse files Browse the repository at this point in the history
  • Loading branch information
shnizzedy committed Jul 23, 2020
1 parent 06b3437 commit 194c359
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
apt-get update && apt-get -y install git rsync python-dev graphviz libgraphviz-dev pkg-config python3-sphinx
pip install --user -r https://raw.githubusercontent.com/FCP-INDI/C-PAC/develop/requirements.txt
pip install --user git+https://github.com/FCP-INDI/C-PAC.git sphinx m2r numpydoc PyGithub sphinxcontrib-programoutput
pip install cpac-py
pip install cpac
git clone https://github.com/FCP-INDI/C-PAC.git
- setup_remote_docker
- run:
Expand Down
39 changes: 29 additions & 10 deletions docs/user/_sources/appendix.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ Before You Start

C-PAC can be run without installing through any of these three options:

* With a Docker container
* With a Docker or Singularity container
* optionally with :doc:`a simple Python commandline interface <cpac>`
* On the Amazon AWS Cloud
* Through OpenNeuro

Expand Down Expand Up @@ -42,7 +43,7 @@ A Note About the \*nix Command Line

Overview
--------
If you are using Ubuntu (version 12/14) you can download and run `cpac_install.sh <https://github.com/FCP-INDI/C-PAC/blob/master/scripts/cpac_install.sh?raw=true>`__ with the following terminal commands as root:
If you are using Ubuntu (version 12/14) you can download and run `cpac_install.sh <https://github.com/FCP-INDI/C-PAC/blob/master/scripts/cpac_install.sh?raw=true>`__ with the following terminal commands as root:

.. code-block:: console

Expand All @@ -53,7 +54,9 @@ If you are using Ubuntu (version 12/14) you can download and run `cpac_install.

This will install all of the prerequisites and resources listed below. If you have previously installed versions of these, they will not be reinstalled, and the script will not check the release version to match the requirements of C-PAC.

**Note**: This script is intended for Ubuntu Linux 12/14, but it may work for older releases of Ubuntu.
.. note::

This script is intended for Ubuntu Linux 12/14, but it may work for older releases of Ubuntu.

**For other operating systems**, this page will guide you through the following C-PAC installation steps:

Expand Down Expand Up @@ -129,9 +132,15 @@ OS-Specific Instructions

Installing Python Dependencies
""""""""""""""""""""""""""""""
Please ensure that you are using Python 2.7 and above, but not Python 3 (since it is not backwards-compatible). Though many computers come with Python pre-installed, C-PAC relies on a number of special-purpose packages, which are listed below. Packages with an asterisk can be installed through `easy_install <https://pythonhosted.org/setuptools/easy_install.html>`__ or pip. Installing `Anaconda <https://store.continuum.io/cshop/anaconda/>`__ (**64-bit version only**), `Miniconda <http://conda.pydata.org/miniconda.html>`__ or `Enthought Canopy <https://www.enthought.com/products/canopy/>`__ and using a package manager can simplify installation greatly. Instructions for Miniconda are given below.
Please ensure that you are using Python 3.6 and above. Though many computers come with Python pre-installed, C-PAC relies on a number of special-purpose packages, which are listed below. Packages with an asterisk can be installed through `easy_install <https://pythonhosted.org/setuptools/easy_install.html>`__ or pip. Installing `Anaconda <https://store.continuum.io/cshop/anaconda/>`__ (**64-bit version only**), `Miniconda <http://conda.pydata.org/miniconda.html>`__ or `Enthought Canopy <https://www.enthought.com/products/canopy/>`__ and using a package manager can simplify installation greatly. Instructions for Miniconda are given below.

.. note::

:doc:`cpac (the simple Python commandline interface) <cpac>` and a local installation of C-PAC will conflict if installed in the same environment because both use the same commandline command (``cpac``).

Note: Specific maximum versions are required for the following dependencies. C-PAC is currently (temporarily) not compatible with versions past the following:
.. note::

Specific maximum versions are required for the following dependencies. C-PAC is currently (temporarily) not compatible with versions past the following:

* `Nipype <http://nipype.readthedocs.io/en/latest/>`__ - version 1.1.2
* `NetworkX <http://networkx.lanl.gov/>`__ - version 1.11
Expand Down Expand Up @@ -214,9 +223,13 @@ For AFNI to be available globally on your machine, you should then add the follo

If you open a new shell and type `afni` the AFNI console should now appear. If not, double-check the lines added to `/etc/bash.bashrc` for typos and make sure that `/opt/afni` contains the AFNI commands.

**Note:** Regarding the Neurodebian repository: We have encountered compatibility issues in the past with the Neurodebian binary for AFNI. For this reason, it is suggested that you follow the installation instructions above or the instructions from the AFNI homepage.
.. note::

Regarding the Neurodebian repository: We have encountered compatibility issues in the past with the Neurodebian binary for AFNI. For this reason, it is suggested that you follow the installation instructions above or the instructions from the AFNI homepage.

**Note:** On some Ubuntu systems, AFNI can have trouble locating the libgsl.so.0 software library required for some of their tools (3dSkullStrip, and 3dHist). If you experience an error trying to run any of these tools, first attempt to re-install AFNI via the instructions on the AFNI homepage. If this does not resolve the issue, another solution involves locating your system's GSL library and re-configuring:
.. note::

On some Ubuntu systems, AFNI can have trouble locating the libgsl.so.0 software library required for some of their tools (3dSkullStrip, and 3dHist). If you experience an error trying to run any of these tools, first attempt to re-install AFNI via the instructions on the AFNI homepage. If this does not resolve the issue, another solution involves locating your system's GSL library and re-configuring:

.. code-block:: console

Expand Down Expand Up @@ -417,13 +430,17 @@ In a new terminal window, open iPython (or Python) and enter the command ``impor

Once you are able to successfully ``import CPAC`` it is safe to delete any setup files downloaded during the install process (e.g. Nipype and C-PAC downloads, FSL install scripts, etc.), as they are no longer needed.

**Note:** The test process described here only acts to confirm that the C-PAC python package has been correctly installed. To fully test C-PAC on your system, please see the :doc:`Benchmark Page </benchmark>`.
.. note::

The test process described here only acts to confirm that the C-PAC python package (the core package, not :doc:`the simple Python commandline interface with the same name <cpac>`) has been correctly installed. To fully test C-PAC on your system, please see the :doc:`Benchmark Page </benchmark>`.

Updating C-PAC
""""""""""""""
C-PAC is being actively developed, and new versions (containing bug fixes and new features) are often released. To update to the latest version, simply download it from the `C-PAC Homepage <http://fcp-indi.github.com/>`__ and repeat the instructions in the `Installing C-PAC` section above. A list of previous versions and the changes they contain is available on the :doc:`Release Notes Page </rnotes>`.

**Note: If you are using Anaconda/Miniconda you may also use the following command (replacing 'cpac' with your environment name) to remove an old environment before creating a new environment to replace it.**
.. note::

If you are using Anaconda/Miniconda you may also use the following command (replacing 'cpac' with your environment name) to remove an old environment before creating a new environment to replace it.**

.. code-block:: console

Expand All @@ -440,6 +457,8 @@ Some network centrality features will not be available without compiling the C-b

python setup.py build_ext --inplace

**Note:** Unfortunately, it is not possible at this time to use the C-PAC GUI without installing C-PAC.
.. note::

Unfortunately, it is not possible at this time to use the C-PAC GUI without installing C-PAC.

.. include:: benchmark.txt
22 changes: 8 additions & 14 deletions docs/user/_sources/cpac_py.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
cpac Python Package
-------------------
cpac (Python package)
---------------------

A `C-PAC Python package <https://pypi.org/project/cpac-py/>`_ is available so that you can easily run analyses without needing interact with the container platform that allows you to run C-PAC without installing all of the underlying software.
`cpac <https://pypi.org/project/cpac/>`_ is available so that you can easily run analyses without needing interact with the container platform that allows you to run C-PAC without installing all of the underlying software.

Currently the C-PAC Python package supports Singularity (version ≥ 2.5 ≤ 3.0) and Docker.
Currently the cpac supports Singularity (version ≥ 2.5 ≤ 3.0) and Docker.

The C-PAC Python package requires Python 3.6 or greater. To get the C-PAC Python package, simply
cpac requires Python 3.6 or greater. To get cpac, simply

.. code-block:: console

pip install cpac-py
pip install cpac

As a quick example, in order to run C-PAC in participant mode, for one participant, using a BIDS dataset stored on your machine or server, and using the container image's default pipeline configuration:

.. code-block:: console

cpac run /Users/You/local_bids_data /Users/You/some_folder_for_outputs participant

By default, the C-PAC Python package will try Docker first and fall back to Singularity if Docker fails. If both fail, an exception is raised.
By default, the cpac will try Docker first and fall back to Singularity if Docker fails. If both fail, an exception is raised.

You can specify a platform with the ``--platform docker`` or ``--platform singularity``. If you specify a platform without specifying an image, these are the defaults, using the first successfully found image:

Expand Down Expand Up @@ -84,10 +84,4 @@ Note that any of the optional arguments above will over-ride any pipeline settin

* The ``participant_label`` and ``participant_ndx`` arguments allow the user to specify which of the many datasets should be processed, which is useful when parallelizing the run of multiple participants.

* If you want to pass runtime options to your container plaform (Docker or Singularity), you can pass them with ``-o`` or ``--container_options``.

.. toctree::
:hidden:

/run/help.txt
/utils/help.txt
* If you want to pass runtime options to your container plaform (Docker or Singularity), you can pass them with ``-o`` or ``--container_options``.
2 changes: 1 addition & 1 deletion docs/user/_sources/quick.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ C-PAC Quickstart

.. include:: cpac_py.txt

For instructions to run in Docker or Singularity without installing the C-PAC Python package, see :ref:`All Run Options <running>`
For instructions to run in Docker or Singularity without installing cpac (Python package), see :ref:`All Run Options <running>`

Default Pipeline
----------------
Expand Down
2 changes: 1 addition & 1 deletion docs/user/_sources/quick_overview.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Let's Go!
---------

#. The recommended way to run C-PAC is through the use of a container such as Docker or Singularity. Using these containers can be facilitated by the C-PAC Python package.
#. The recommended way to run C-PAC is through the use of a container such as Docker or Singularity. Using these containers can be facilitated by :doc:`cpac`.

#. Containers are completely pre-built environments that help ensure reproducibility (same exact library versions, behavior, etc.).

Expand Down
2 changes: 1 addition & 1 deletion docs/user/_sources/subject_list_config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ or::

docker run -i --rm --user $(id -u) -v /path/to/data_config:/scratch -w="/scratch" fcpindi/c-pac:latest bids_dir outputs_dir cli -- utils data_config new_settings_template

If running a container directly (either of the latter options rather than the first option, which is through the :ref:`C-PAC Python package <cpac_py>`), ``bids_dir`` and ``outputs_dir`` are required but not used, so any non-null string will work for those positional arguments.
If running a container directly (either of the latter options rather than the first option, which is through :doc:`cpac (Python package) <cpac>`), ``bids_dir`` and ``outputs_dir`` are required but not used, so any non-null string will work for those positional arguments.

The Singularity command will create ``data_settings.yml`` in the current working directory you call the command from.

Expand Down

0 comments on commit 194c359

Please sign in to comment.