Skip to content

Commit

Permalink
Merge pull request #220 from amarquand/dev
Browse files Browse the repository at this point in the history
Update pyproject
  • Loading branch information
amarquand authored Nov 21, 2024
2 parents 80d82d2 + 26559f4 commit 8d83c79
Show file tree
Hide file tree
Showing 12 changed files with 555 additions and 123 deletions.
39 changes: 9 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,6 @@ conda create -n <env_name> python==3.12
source activate <env_name>
```

### Install nutpie and numba from conda-forge

```
conda install nutpie numba -c conda-forge
```

#### Install torch from pytorch.org

Use the command that you get from the command builder here: https://pytorch.org/get-started/locally/. This will ensure you do not install the CUDA version of torch if your pc does not have a GPU. We also recommend that you use the `conda` option.


#### Install PCNtoolkit

Using pip:
Expand All @@ -46,6 +35,11 @@ Using a local clone of the repo:
python -m pip install .
```

#### Test installation
```
python -c "import pcntoolkit as pk;print(pk.__file__)"
```

## Alternative installation (on a shared resource)

#### Make sure conda is available on the system.
Expand All @@ -58,7 +52,7 @@ conda --version
#### Create a conda environment in a shared location

```
conda create -y python==3.12 numpy mkl blas --prefix=/shared/conda/<env_name>
conda create -y python==3.12 --prefix=/shared/conda/<env_name>
```

#### Activate the conda environment
Expand All @@ -67,35 +61,20 @@ conda create -y python==3.12 numpy mkl blas --prefix=/shared/conda/<env_name>
conda activate /shared/conda/<env_name>
```

### Install nutpie using conda

```
conda install nutpie numba -c conda-forge
```

#### install torch

Using the command that you get from the command builder here:

```
https://pytorch.org/get-started/locally/
```

If your shared resource has no GPU, make sure you select the 'CPU' field in the 'Compute Platform' row. Here we also prefer conda over pip.

#### Clone the repo

```
git clone https://github.com/amarquand/PCNtoolkit.git
```

### Install in the conda environment
#### Install in the conda environment

```
cd PCNtoolkit/
python -m pip install .
```
### Test

#### Test installation
```
python -c "import pcntoolkit as pk;print(pk.__file__)"
```
Expand Down
1 change: 0 additions & 1 deletion doc/source/pages/BLR_normativemodel_protocol.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ your computer).
.. code:: ipython3
! pip install nutpie
! pip install pcntoolkit
! pip install -r requirements.txt
Expand Down
13 changes: 6 additions & 7 deletions doc/source/pages/HBR_NormativeModel_FCONdata_Tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
"colab_type": "text",
"id": "view-in-github"
},
"source": [
"<a href=\"https://colab.research.google.com/github/AuguB/pcntoolkit_doc_notebooks/blob/main/scripts/HBR_NormativeModel_FCONdata_Tutorial.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
Expand Down Expand Up @@ -60,8 +60,7 @@
},
"outputs": [],
"source": [
"!pip install pcntoolkit\n",
"!pip install nutpie"
"!pip install pcntoolkit"
]
},
{
Expand Down Expand Up @@ -596,9 +595,9 @@
],
"metadata": {
"colab": {
"include_colab_link": true,
"name": "HBR_NormativeModel_FCONdata_Tutorial.ipynb",
"provenance": [],
"include_colab_link": true
"provenance": []
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
Expand All @@ -625,4 +624,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}
1 change: 0 additions & 1 deletion doc/source/pages/HBR_NormativeModel_FCONdata_Tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Step 0: Install necessary libraries & grab data files
.. code:: ipython3
!pip install pcntoolkit
!pip install nutpie
For this tutorial we will use data from the `Functional Connectom
Project FCON1000 <http://fcon_1000.projects.nitrc.org/>`__ to create a
Expand Down
23 changes: 11 additions & 12 deletions doc/source/pages/apply_normative_models.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
"colab_type": "text",
"id": "view-in-github"
},
"source": [
"<a href=\"https://colab.research.google.com/github/AuguB/pcntoolkit_doc_notebooks/blob/main/scripts/apply_normative_models_ct.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
Expand All @@ -26,16 +26,15 @@
},
{
"cell_type": "code",
"source": [
"!pip install pcntoolkit\n",
"!pip install nutpie"
],
"execution_count": null,
"id": "ks50sIbMOGzI",
"metadata": {
"id": "ks50sIbMOGzI"
},
"id": "ks50sIbMOGzI",
"execution_count": null,
"outputs": []
"outputs": [],
"source": [
"!pip install pcntoolkit\n"
]
},
{
"cell_type": "code",
Expand Down Expand Up @@ -761,9 +760,9 @@
],
"metadata": {
"colab": {
"include_colab_link": true,
"name": "apply_normative_models.ipynb",
"provenance": [],
"include_colab_link": true
"provenance": []
},
"kernelspec": {
"display_name": "braincharts",
Expand All @@ -790,4 +789,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
3 changes: 1 addition & 2 deletions doc/source/pages/apply_normative_models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ at least version 0.27)
.. code:: ipython3
!pip install pcntoolkit
!pip install nutpie
.. code:: ipython3
! git clone https://github.com/predictive-clinical-neuroscience/braincharts.git
Expand Down
30 changes: 5 additions & 25 deletions doc/source/pages/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,8 @@ Basic installation (on a local machine)
.. code-block:: bash
source activate <env_name>
4. Install torch using the torch instructions.

.. code-block:: bash
# Command found on the torch website: https://pytorch.org/get-started/locally/
5. Install required conda packages
.. code-block:: bash
conda install numba nutpie -c conda-forge
6. Install PCNtoolkit (plus dependencies)
4. Install PCNtoolkit (plus dependencies)

.. code-block:: bash
Expand Down Expand Up @@ -62,37 +50,29 @@ Alternative installation (on a shared resource)
conda activate /shared/conda/<env_name>
4. Install other dependencies

.. code-block:: bash
# Command found on the torch website: https://pytorch.org/get-started/locally/
conda install numba nutpie -c conda-forge
5. Install pip dependencies
4. Install pip dependencies

.. code-block:: bash
pip --no-cache-dir install nibabel sklearn torch glob3
6. Clone the repo
5. Clone the repo

.. code-block:: bash
git clone https://github.com/amarquand/PCNtoolkit.git
7. Install in the conda environment
6. Install in the conda environment

.. code-block:: bash
cd PCNtoolkit/
python3 setup.py install
8. Test
7. Test

.. code-block:: bash
Expand Down
13 changes: 6 additions & 7 deletions doc/source/pages/normative_modelling_walkthrough.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
"colab_type": "text",
"id": "view-in-github"
},
"source": [
"<a href=\"https://colab.research.google.com/github/AuguB/pcntoolkit_doc_notebooks/blob/main/scripts/normative_modelling_walkthrough.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
Expand Down Expand Up @@ -61,8 +61,7 @@
},
"outputs": [],
"source": [
"!pip install pcntoolkit\n",
"!pip install nutpie"
"!pip install pcntoolkit"
]
},
{
Expand Down Expand Up @@ -620,10 +619,10 @@
],
"metadata": {
"colab": {
"include_colab_link": true,
"name": "normative_modelling_walkthrough.ipynb",
"provenance": [],
"toc_visible": true,
"include_colab_link": true
"toc_visible": true
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
Expand All @@ -645,4 +644,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}
1 change: 0 additions & 1 deletion doc/source/pages/normative_modelling_walkthrough.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ bad if you cannot complete everything during the tutorial.
.. code:: ipython3
!pip install pcntoolkit
!pip install nutpie
**Option 1:** Connect your Google Drive account, and load data from
Expand Down
Loading

0 comments on commit 8d83c79

Please sign in to comment.