Skip to content

Commit ce117c0

Browse files
committed
🔀 Merge source into doc/apply-filter-more-broadly
2 parents 847f814 + e125342 commit ce117c0

File tree

16 files changed

+129
-68
lines changed

16 files changed

+129
-68
lines changed

.circleci/config.yml

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ commands:
55
- run:
66
name: 👽️ Getting user tutorials
77
command: |
8-
sudo apt-get update
9-
sudo apt-get -y install git pandoc
8+
apt-get update
9+
apt-get -y install git pandoc
1010
git clone --depth 1 https://github.com/FCP-INDI/C-PAC_tutorials.git docs/_sources/user/tutorials
1111
get-version:
1212
steps:
@@ -22,18 +22,21 @@ commands:
2222
name: ↑ Installing build dependencies
2323
# setuptools≤57.5.0 until traits>4.6.0 in C-PAC
2424
command: |
25-
sudo apt-get update && sudo apt-get -y install git python3-dev graphviz graphviz-dev libgraphviz-dev pkg-config python3-sphinx
25+
apt-get update && apt-get -y install git python3-dev graphviz graphviz-dev libgraphviz-dev pkg-config python3-sphinx
26+
python -m venv /home/circleci/docs_env
27+
source /home/circleci/docs_env/bin/activate
2628
pip install "setuptools<=57.5.0"
27-
pip install --user -r requirements.txt
28-
pip install --user -r https://raw.githubusercontent.com/${CIRCLE_PROJECT_USERNAME}/C-PAC/<< parameters.version >>/requirements.txt
29-
pip install --user git+https://github.com/${CIRCLE_PROJECT_USERNAME}/C-PAC.git@<< parameters.version >>
29+
pip install -r requirements.txt
30+
pip install -r https://raw.githubusercontent.com/${CIRCLE_PROJECT_USERNAME}/C-PAC/<< parameters.version >>/requirements.txt
31+
pip install git+https://github.com/${CIRCLE_PROJECT_USERNAME}/C-PAC.git@<< parameters.version >>
3032
git clone https://github.com/${CIRCLE_PROJECT_USERNAME}/C-PAC.git /home/circleci/build/C-PAC
3133
cd /home/circleci/build/C-PAC
3234
git checkout << parameters.version >>
3335
cd /home/circleci/build
34-
python -m venv ~/simple
35-
source ~/simple/bin/activate
36-
pip install git+https://github.com/FCP-INDI/cpac.git@aa73ce266d3e599b6d9a1ad9721959c69dd0c4d3 semver
36+
deactivate
37+
python -m venv /home/circleci/simple
38+
source /home/circleci/simple/bin/activate
39+
pip install cpac semver
3740
deactivate
3841
3942
run-cpac-commands:
@@ -42,7 +45,7 @@ commands:
4245
- run:
4346
name: 👊 Running cpac commands
4447
command: |
45-
source ~/simple/bin/activate
48+
source /home/circleci/simple/bin/activate
4649
cpac pull
4750
mkdir -p docs/_sources/user/cpac
4851
printf ".. code-block:: console\n\n $ cpac --help\n\n" > docs/_sources/user/cpac/help.rst
@@ -53,6 +56,9 @@ commands:
5356
mkdir -p docs/_sources/user/utils
5457
printf "Usage: cpac utils\n\`\`\`\`\`\`\`\`\`\`\`\`\`\`\`\`\`\n.. code-block:: console\n\n $ cpac utils --help\n\n" > docs/_sources/user/utils/help.rst
5558
cpac utils --help | sed -e "s/.*/ &/" >> docs/_sources/user/utils/help.rst
59+
mkdir -p docs/_sources/user/group/feat/load-preset/unpaired-two
60+
printf ".. code-block:: console\n\n $ cpac group feat load-preset unpaired-two --help\n\n" > docs/_sources/user/group/feat/load-preset/unpaired-two/help.rst
61+
cpac group feat load-preset unpaired-two --help | sed -e "s/.*/ &/" >> docs/_sources/user/group/feat/load-preset/unpaired-two/help.rst
5662
deactivate
5763
prep-deploy:
5864
steps:
@@ -64,6 +70,9 @@ commands:
6470
command: |
6571
git config --global user.email "[email protected]"
6672
git config --global user.name "ChildMindInstituteCNL"
73+
mkdir -p /home/circleci/.ssh/
74+
touch /home/circleci/.ssh/known_hosts
75+
ssh-keyscan github.com >> /home/circleci/.ssh/known_hosts
6776
- run:
6877
name: 🔀 Combining new docs with existing docs
6978
command: |
@@ -115,7 +124,8 @@ jobs:
115124
build-nightly:
116125
working_directory: /home/circleci/build
117126
docker:
118-
- image: cimg/python:3.10
127+
- image: ghcr.io/fcp-indi/c-pac:nightly
128+
user: root
119129
steps:
120130
- checkout:
121131
path: /home/circleci/build
@@ -125,13 +135,14 @@ jobs:
125135
- get-tutorials
126136
- run:
127137
name: 🏗️ Building nightly branch docs
128-
command: ./bin/build nightly
138+
command: source /home/circleci/docs_env/bin/activate && ./bin/build nightly
129139
- store-commit-message
130140
- persist-new-build
131141
build-version:
132142
working_directory: /home/circleci/build
133143
docker:
134-
- image: cimg/python:3.10
144+
- image: ghcr.io/fcp-indi/c-pac:nightly
145+
user: root
135146
steps:
136147
- checkout:
137148
path: /home/circleci/build
@@ -142,7 +153,7 @@ jobs:
142153
- get-tutorials
143154
- run:
144155
name: 🏗️ Building version branch docs
145-
command: ./bin/build ${BUILD_VERSION}
156+
command: source /home/circleci/docs_env/bin/activate && ./bin/build ${BUILD_VERSION}
146157
- store-commit-message
147158
- persist-new-build
148159
deploy-nightly:

docs/_sources/_static/custom.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,9 @@
1818
width: 100%;
1919
height: auto;
2020
}
21+
22+
/* empty content highlight divs ―
23+
see 'hideEmptyHighlights.js' */
24+
div[class*=" highlight"].hidden, div[class^=highlight].hidden {
25+
display: none;
26+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* Hide highlight containers only empty spans */
2+
document.addEventListener("DOMContentLoaded", function() {
3+
const highlightDivs = document.querySelectorAll('div[class^="highlight"], div[class*=" highlight"]');
4+
highlightDivs.forEach(function(highlightDiv) {
5+
if (highlightDiv.textContent.trim() === '') {
6+
highlightDiv.classList.add('hidden');
7+
}
8+
});
9+
});

docs/_sources/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ def _unireplace(release_note, unireplace):
459459
'custom.css',
460460
]
461461
html_js_files = [
462+
'hideEmptyHighlights.js',
462463
('versionList.js', {'defer': 'defer'})]
463464

464465
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,

docs/_sources/developer/nodes.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Nodes
77

88
.. _n_cpus:
99

10-
A Nipype :py:class:`~nipype.pipeline.engine.nodes.Node` has an initialization parameter ``mem_gb`` that differs from the :doc:`commandline option </user/run/help>` ``--mem_gb``. While the commandline option is **a limit**, the Node initialization parameter is **an estimate** of the most memory that Node will consume when run. The Node parameter is not a limit; rather, this value is used to allocate system resources at runtime.
10+
A Nipype :py:class:`~nipype.pipeline.engine.nodes.Node` has an initialization parameter ``mem_gb`` that differs from the :doc:`commandline option </user/run/help>` ``--mem-gb``. While the commandline option is **a limit**, the Node initialization parameter is **an estimate** of the most memory that Node will consume when run. The Node parameter is not a limit; rather, this value is used to allocate system resources at runtime.
1111

12-
Conversely, the commandline option ``--n_cpus`` is **a limit** and the Node initialization parameter ``n_procs`` is **also a limit** of the maximum number of threads a Node will be permmitted to consume.
12+
Conversely, the commandline option ``--n-cpus`` is **a limit** and the Node initialization parameter ``n_procs`` is **also a limit** of the maximum number of threads a Node will be permmitted to consume.
1313

1414
C-PAC automatically creates a JSON-like file called ``callback.log`` (via the function :py:func:`~CPAC.utils.monitoring.log_nodes_cb`) when running. This file includes for each Node:
1515

@@ -18,7 +18,7 @@ C-PAC automatically creates a JSON-like file called ``callback.log`` (via the fu
1818
* specified maximum number of threads per Node, and
1919
* threads used at runtime.
2020

21-
A ``callback.log`` can be provided to the pipeline configuration file (see :doc:`/user/compute_config`) or with the commandline flag ``--runtime_usage``. If a callback log is provided in the pipeline configuration, nodes with names that match nodes recorded in that pipeline log will have their memory estimates overridden by the values in the callback log plus a buffer percent (provided with the ``--runtime_buffer`` flag or in the pipeline configuration file).
21+
A ``callback.log`` can be provided to the pipeline configuration file (see :doc:`/user/compute_config`) or with the commandline flag ``--runtime-usage``. If a callback log is provided in the pipeline configuration, nodes with names that match nodes recorded in that pipeline log will have their memory estimates overridden by the values in the callback log plus a buffer percent (provided with the ``--runtime-buffer`` flag or in the pipeline configuration file).
2222

2323
When a developer creates or modifies a Node in C-PAC, a ``mem_gb`` and ``n_procs`` argument should be provided unless the respective defaults of 0.2 and None (number of available system cores) are expected to be sufficient. When testing, the ``mem_gb`` and ``n_procs`` arguments should be adjusted if the observed memory and/or thread usage of a Node exceeds the estimate.
2424

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
Network Centrality
22
==================
33

4-
.. automodule:: CPAC.network_centrality
5-
:members:
4+
.. automodule:: CPAC.network_centrality.network_centrality
5+
:special-members: __init__
6+
:members:
7+
:private-members:
8+
:undoc-members:
9+
10+
.. automodule:: CPAC.network_centrality.pipeline
11+
:special-members: __init__
12+
:members:
13+
:private-members:
14+
:undoc-members:
15+
16+
.. automodule:: CPAC.network_centrality.utils
17+
:special-members: __init__
18+
:members:
19+
:private-members:
20+
:undoc-members:

docs/_sources/user/compute_config.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Computer Settings
2020

2121
`Open image <../_static/flowcharts/observed-usage.svg>`_
2222

23-
#. **Callback log - [text]:** The path to a callback log file from a previous run, including any resource-management parameters that will be applied in this run, like ``n_cpus`` and ``num_ants_threads``. This file is used override memory estimates with previously observed memory usage. Can be overridden with the commandline flag ``--runtime_usage``.
24-
#. **Buffer - [percent]:** A percent of the previously observed memory usage that is to be added to the memory estimate. Default: 10. Can be overridden with the commandline flag ``--runtime_buffer``.
23+
#. **Callback log - [text]:** The path to a callback log file from a previous run, including any resource-management parameters that will be applied in this run, like ``n_cpus`` and ``num_ants_threads``. This file is used override memory estimates with previously observed memory usage. Can be overridden with the commandline flag ``--runtime-usage``.
24+
#. **Buffer - [percent]:** A percent of the previously observed memory usage that is to be added to the memory estimate. Default: 10. Can be overridden with the commandline flag ``--runtime-buffer``.
2525

2626
#. **Number of Participants to Run Simultaneously - [integer]:** This number depends on computing resources.
2727

docs/_sources/user/cpac.rst

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,26 @@ cpac (Python package)
33

44
`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.
55

6-
cpac requires Python 3.6 or greater. To get cpac, simply
6+
``cpac`` requires Python 3.8 or greater. To get cpac, simply
77

88
.. code-block:: console
99
1010
pip install cpac
1111
12+
Run extra packages with cpac
13+
````````````````````````````
14+
Beginning with v1.8.5, ``cpac`` can run |ba_timeseries_gradients|_ and/or |tsconcat|_ in addition to C-PAC. If either package is already installed, ``cpac`` will use the installed version. You can install them with the relevant extras, like one of the following lines:
15+
16+
.. code-block:: console
17+
18+
pip install cpac[ba_timeseries_gradients]
19+
pip install cpac[tsconcat]
20+
pip install cpac[ba_timeseries_gradients,tsconcat]
21+
22+
.. note::
23+
24+
``ba_timeseries_gradients`` and ``tsconcat`` may have more specific dependency requirements than C-PAC. If you run into unclear installation issues when installing these extras, please see the documentation for those packages.
25+
1226
Download / Upgrade C-PAC with cpac
1327
``````````````````````````````````
1428

@@ -88,32 +102,42 @@ To run C-PAC with a pipeline configuration file other than one of the pre-config
88102

89103
.. code-block:: console
90104
91-
cpac run /Users/You/local_bids_data /Users/You/some_folder_for_outputs participant --pipeline_file /Users/You/Documents/pipeline_config.yml
105+
cpac run /Users/You/local_bids_data /Users/You/some_folder_for_outputs participant --pipeline-file /Users/You/Documents/pipeline_config.yml
92106
93107
Finally, to run C-PAC with a specific data configuration file (instead of providing a BIDS data directory):
94108

95109
.. code-block:: console
96110
97-
cpac run /Users/You/any_directory /Users/You/some_folder_for_outputs participant --data_config_file /Users/You/Documents/data_config.yml
111+
cpac run /Users/You/any_directory /Users/You/some_folder_for_outputs participant --data-config-file /Users/You/Documents/data_config.yml
98112
99-
Note: we are still providing the postionally-required ``bids_dir`` input parameter. However C-PAC will not look for data in this directory when you provide a data configuration YAML with the ``--data_config_file`` flag. Providing ``.`` or ``$PWD`` will simply pass the present working directory. In addition, if the dataset in your data configuration file is not in BIDS format, just make sure to add the ``--skip_bids_validator`` flag at the end of your command to bypass the BIDS validation process.
113+
Note: we are still providing the postionally-required ``bids_dir`` input parameter. However C-PAC will not look for data in this directory when you provide a data configuration YAML with the ``--data-config-file`` flag. Providing ``.`` or ``$PWD`` will simply pass the present working directory. In addition, if the dataset in your data configuration file is not in BIDS format, just make sure to add the ``--skip-bids-validator`` flag at the end of your command to bypass the BIDS validation process.
100114

101115
The full list of parameters and options that can be passed to C-PAC are shown below:
102116

103117
.. include:: /user/run/help.rst
104118

105119
.. include:: /user/utils/help.rst
106120

107-
Note that any of the optional arguments above will over-ride any pipeline settings in the default pipeline or in the pipeline configuration file you provide via the ``--pipeline_file`` parameter.
121+
Note that any of the optional arguments above will over-ride any pipeline settings in the default pipeline or in the pipeline configuration file you provide via the ``--pipeline-file`` parameter.
108122

109123
**Further usage notes:**
110124

111-
* You can run only anatomical preprocessing easily, without modifying your data or pipeline configuration files, by providing the ``--anat_only`` flag.
125+
* You can run only anatomical preprocessing easily, without modifying your data or pipeline configuration files, by providing the ``--anat-only`` flag.
112126

113-
* As stated, the default behavior is to read data that is organized in the BIDS format. This includes data that is in Amazon AWS S3 by using the format ``s3://<bucket_name>/<bids_dir>`` for the ``bids_dir`` command line argument. Outputs can be written to S3 using the same format for the ``output_dir``. Credentials for accessing these buckets can be specified on the command line (using ``--aws_input_creds`` or ``--aws_output_creds``).
127+
* As stated, the default behavior is to read data that is organized in the BIDS format. This includes data that is in Amazon AWS S3 by using the format ``s3://<bucket_name>/<bids_dir>`` for the ``bids_dir`` command line argument. Outputs can be written to S3 using the same format for the ``output_dir``. Credentials for accessing these buckets can be specified on the command line (using ``--aws-input-creds`` or ``--aws-output-creds``).
114128

115-
* When the app is run, a data configuration file is written to the working directory. This directory can be specified with ``--working_dir`` or the directory from which you run ``cpac`` will be used. This file can be passed into subsequent runs, which avoids the overhead of re-parsing the BIDS input directory on each run (i.e. for cluster or cloud runs). These files can be generated without executing the C-PAC pipeline using the ``test_run`` command line argument.
129+
* When the app is run, a data configuration file is written to the working directory. This directory can be specified with ``--working-dir`` or the directory from which you run ``cpac`` will be used. This file can be passed into subsequent runs, which avoids the overhead of re-parsing the BIDS input directory on each run (i.e. for cluster or cloud runs). These files can be generated without executing the C-PAC pipeline using ``test_config`` as the analysis level.
116130

117131
* 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.
118132

119133
* If you want to pass runtime options to your container plaform (Docker or Singularity), you can pass them with ``-o`` or ``--container_options``.
134+
135+
.. TODO: Update cpac to handle `-`s and `_`s like C-PAC
136+
137+
.. |ba_timeseries_gradients| replace:: ``ba_timeseries_gradients``
138+
139+
.. _ba_timeseries_gradients: https://cmi-dair.github.io/ba-timeseries-gradients/ba_timeseries_gradients.html
140+
141+
.. |tsconcat| replace:: ``tsconcat``
142+
143+
.. _tsconcat: https://cmi-dair.github.io/tsconcat/tsconcat.html

0 commit comments

Comments
 (0)