diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 2ead153..822b770 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -12,8 +12,8 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] - + python-version: ["3.8", "3.9", "3.10", "3.11"] + os: [ubuntu-latest, windows-latest, macos-latest] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} diff --git a/pyproject.toml b/pyproject.toml index c41e365..93ace1b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,6 +10,3 @@ __version__ = "{version}" """ fallback_version = "0.0" local_scheme = "no-local-version" -authors = [ - "Francois Rheault @FrancoisRheault", -] diff --git a/scripts/tff_manipulate_datatype.py b/scripts/tff_manipulate_datatype.py index 25b46f3..340b787 100644 --- a/scripts/tff_manipulate_datatype.py +++ b/scripts/tff_manipulate_datatype.py @@ -78,7 +78,6 @@ def main(): dtype_dict['positions'] = np.dtype(args.positions_dtype) if args.offsets_dtype: dtype_dict['offsets'] = np.dtype(args.offsets_dtype) - if args.dpv: dtype_dict['dpv'] = {} for name, dtype in args.dpv: diff --git a/setup.cfg b/setup.cfg index 81a2c9a..3622ae7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,19 +21,21 @@ include_package_data = True [options] -python_requires = >=3.7 +python_requires = >=3.8 setup_requires = packaging >= 19.0 cython >= 0.29 install_requires = setuptools_scm deepdiff - nibabel >= 3 - dipy@git+https://git@github.com/arokem/dipy@11a94c0fcf9b3 + nibabel >= 5 + numpy >= 1.22 + dipy@git+https://git@github.com/frheault/dipy@cf4338d fury [options.extras_require] -doc = sphinx <= 6 +doc = astroid==2.15.8 + sphinx pydata-sphinx-theme sphinx-autoapi numpydoc diff --git a/trx/trx_file_memmap.py b/trx/trx_file_memmap.py index e2cbccb..66a45c3 100644 --- a/trx/trx_file_memmap.py +++ b/trx/trx_file_memmap.py @@ -1065,8 +1065,15 @@ def _create_trx_from_pointer( ext = ".bool" mem_adress, size = dict_pointer_size[elem_filename] - if root is not None and folder.startswith(root.rstrip("/")): - folder = folder.replace(root, "").lstrip("/") + if root is not None: + # This is for Unix + if os.name != 'nt' and folder.startswith(root.rstrip("/")): + folder = folder.replace(root, "").lstrip("/") + # These two are for Windows + elif os.path.isdir(folder) and os.path.basename(folder) in ['dpg', 'dpv', 'dps']: + folder = os.path.basename(folder) + else: + folder = '' # Parse/walk the directory tree if base == "positions" and folder == "": @@ -1089,7 +1096,10 @@ def _create_trx_from_pointer( shape=(trx.header["NB_STREAMLINES"]+1,), dtype=ext[1:], ) - lengths = _compute_lengths(offsets) + if offsets[-1] != 0: + lengths = _compute_lengths(offsets) + else: + lengths = [0] elif folder == "dps": nb_scalar = size / trx.header["NB_STREAMLINES"] if not nb_scalar.is_integer() or nb_scalar != dim: