Skip to content

Commit

Permalink
remove deep bsb imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Helveg committed Mar 28, 2024
1 parent 34c1189 commit 0603fe3
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 11 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Black Check
uses: jpetrucciani/black-check@master
- uses: actions/checkout@v4
- uses: psf/black@stable
with:
options: "--check --verbose"
version: "24.1.1"
20 changes: 20 additions & 0 deletions .github/workflows/isort.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Run isort
on:
- push

jobs:
isort:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install apt dependencies
# Install `libopenmpi` for mpi4py
run: |
sudo apt update
sudo apt install openmpi-bin libopenmpi-dev
# Install dependencies for proper 1st/2nd/3rd party import sorting
- run: pip install -e .[parallel]
- uses: isort/isort-action@master
11 changes: 8 additions & 3 deletions bsb_hdf5/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
HDF5 storage engine for the BSB framework.
"""

from bsb import config, __version__ as bsb_version
from bsb.services import MPILock
from bsb.storage.interfaces import Engine, StorageNode as IStorageNode, NoopLock
from bsb import (
config,
__version__ as bsb_version,
MPILock,
Engine,
StorageNode as IStorageNode,
NoopLock,
)
from .placement_set import PlacementSet
from .connectivity_set import ConnectivitySet
from .file_store import FileStore
Expand Down
2 changes: 1 addition & 1 deletion bsb_hdf5/chunks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
objects within them.
"""

from bsb.storage import Chunk, chunklist
from bsb import Chunk, chunklist
import numpy as np
import contextlib
from .resource import handles_handles, HANDLED
Expand Down
13 changes: 9 additions & 4 deletions bsb_hdf5/connectivity_set.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import errr

Check failure on line 1 in bsb_hdf5/connectivity_set.py

View workflow job for this annotation

GitHub Actions / isort

Imports are incorrectly sorted and/or formatted.
from bsb.exceptions import DatasetNotFoundError
from bsb import (
DatasetNotFoundError,
Chunk,
chunklist,
ConnectivitySet as IConnectivitySet,
)
from .resource import Resource, handles_handles, HANDLED
from bsb.storage._chunks import Chunk, chunklist
from bsb.storage.interfaces import ConnectivitySet as IConnectivitySet
import numpy as np
import json

Expand Down Expand Up @@ -475,7 +478,9 @@ def __iter__(self):
)
)
else:
yield self._cs.load_block_connections(self._dir, self._lchunks, self._gchunks)
yield self._cs.load_block_connections(
self._dir, self._lchunks, self._gchunks
)

def get_local_iter(self, direction, local_):
if local_ is None:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies = ["bsb-core>=4.0.0b0,<=4.0.0b9999"]
hdf5 = "bsb_hdf5"

[project.optional-dependencies]
parallel = ["bsb-core[parallel]"]
test = ["bsb-test>=0.0.0b15,<=0.0.0b9999", "coverage~=7.0", "bsb-core[parallel]"]
docs = [
"sphinx==5.0.2",
Expand Down

0 comments on commit 0603fe3

Please sign in to comment.