Skip to content

Commit

Permalink
Separated the docs deps, and renamed mpi deps to parallel (#769)
Browse files Browse the repository at this point in the history
* factored out `docs` deps, and renamed `mpi` to `parallel`

* fix compatible release version specifiers
  • Loading branch information
Helveg committed Nov 13, 2023
1 parent 4ad2d32 commit ff6ecbf
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
# Install latest pip
pip install --upgrade pip
# Install bsb-core
pip install .[test,mpi]
pip install .[test,parallel]
- name: Run tests & coverage
run: |
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.11.0
hooks:
- id: black
language_version: python3
2 changes: 1 addition & 1 deletion bsb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
install the `bsb` package instead.
"""

__version__ = "4.0.0b1"
__version__ = "4.0.0b2"

import functools

Expand Down
10 changes: 7 additions & 3 deletions bsb/services/mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,13 @@ class MPIModule(MockModule):
@property
@functools.cache
def COMM_WORLD(self):
if any("mpi" in key.lower() for key in os.environ):
if (
any("mpi" in key.lower() for key in os.environ)
and "BSB_IGNORE_PARALLEL" not in os.environ
):
raise DependencyError(
"MPI execution detected without MPI dependencies."
+ " Please install with `pip install bsb[mpi]` to use MPI."
"MPI runtime detected without parallel support."
+ " Please install with `pip install bsb[parallel]`."
+ " Set `BSB_IGNORE_PARALLEL` to ignore this error."
)
return None
6 changes: 3 additions & 3 deletions docs/dev/documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
Documentation
#############

Install the developer requirements of the BSB:
Install the documentation dependencies of the BSB:

.. code-block:: bash
pip install -e .[dev]
pip install -e .[docs]
Then from the ``docs`` directory run:
Then navigate to the ``docs`` directory and run:

.. code-block:: bash
Expand Down
14 changes: 8 additions & 6 deletions docs/usage/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,30 @@ On Windows, install `Microsoft MPI
<https://docs.microsoft.com/en-us/message-passing-interface/microsoft-mpi>`_. On
supercomputers it is usually installed already, otherwise contact your administrator.

To then install the BSB with MPI support:
To then install the BSB with parallel MPI support:

.. code-block:: bash
pip install "bsb[mpi]>=4.0.0a0"
pip install "bsb[parallel]>=4.0.0b0"
Simulator backends
==================

If you'd like to install the scaffold builder for point neuron simulations with
NEST or multicompartmental neuron simulations with NEURON use:
NEST or multicompartmental neuron simulations with NEURON or Arbor use:

.. code-block:: bash
pip install bsb[nest]
# or
pip install bsb[arbor]
# or
pip install bsb[neuron]
# or both
pip install bsb[nest,neuron]
# or any combination
pip install bsb[arbor,nest,neuron]
.. note::

This does not install the simulators themselves. It installs the Python tools that the
BSB needs to deal with them. Install the simulators separately according to their
BSB needs to support them. Install the simulators separately according to their
respective installation instructions.
29 changes: 17 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,25 +58,30 @@ config = "bsb._options:config"
profiling = "bsb._options:profiling"

[project.optional-dependencies]
parallel = [
"mpi4py~=3.0",
"zwembad~=1.2",
"mpilock~=1.1"
]
test = [
"coverage~=7.3.0",
"coverage~=7.3",
"bsb-hdf5==1.0.0b1",
"bsb-test==0.0.0b0",
"bsb-json==0.0.0b0"
]
dev = [
docs = [
"sphinx~=7.0",
"furo",
"pre-commit",
"black~=22.3.0",
"nrn-subprocess~=1.3.4",
"sphinxemoji",
"sphinx_design~=0.5",
"sphinx-copybutton~=0.5",
"sphinxext-bsb~=0.2.1",
"snakeviz",
"furo~=2023.9",
"sphinxemoji~=0.2.0",
"sphinx_design~=0.5.0",
"sphinx-copybutton~=0.5.0",
"sphinxext-bsb~=0.2.1"
]
dev = [
"pre-commit~=3.5",
"black~=23.11",
"snakeviz~=2.1"
]
mpi = ["mpi4py~=3.0", "zwembad", "mpilock~=1.1"]

[tool.black]
line-length = 90

0 comments on commit ff6ecbf

Please sign in to comment.