Skip to content

Commit 7c92a77

Browse files
authored
Merge pull request #206 from daducci/release/v2.1.1
[RELEASE] v2.1.1
2 parents 7183ee0 + 385e47d commit 7c92a77

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Change Log
22
### All notable changes to `AMICO` will be documented in this file.
33

4+
## `v2.1.1`<br>_2025-08-13_
5+
### 🐛Fixed
6+
- `UserWarning`: `pkg_resources` is deprecated as an API.
7+
8+
---
9+
---
10+
411
## `v2.1.0`<br>_2025-01-20_
512
### 🛠️Changed
613
- Support for `numpy>=2.0.0`

amico/core.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import dipy.reconst.dti as dti
1818
from amico.util import PRINT, LOG, WARNING, ERROR, get_verbose
1919
from dicelib.ui import ProgressBar
20-
from pkg_resources import get_distribution
2120
from threadpoolctl import ThreadpoolController
2221

2322
def setup( lmax=12 ) :
@@ -74,7 +73,8 @@ def __init__( self, study_path='.', subject='.', output_path=None ) :
7473

7574
# store all the parameters of an evaluation with AMICO
7675
self.CONFIG = {}
77-
self.set_config('version', get_distribution('dmri-amico').version)
76+
from . import __version__ as version
77+
self.set_config('version', version)
7878
self.set_config('study_path', study_path)
7979
self.set_config('subject', subject)
8080
self.set_config('DATA_path', pjoin( study_path, subject ))
@@ -312,7 +312,7 @@ def set_solver( self, **params ) :
312312
"""
313313
if self.model is None :
314314
ERROR( 'Model not set; call "set_model()" method first' )
315-
315+
316316
solver_params = list(inspect.signature(self.model.set_solver).parameters)
317317
params_new = {}
318318
for key in params.keys():
@@ -344,7 +344,7 @@ def generate_kernels( self, regenerate = False, lmax = 12, ndirs = 500 ) :
344344
ERROR( 'Model not set; call "set_model()" method first' )
345345
if not is_valid(ndirs):
346346
ERROR( 'Unsupported value for ndirs.\nNote: Supported values for ndirs are [1, 500 (default), 1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000, 5500, 6000, 6500, 7000, 7500, 8000, 8500, 9000, 9500, 10000, 32761]' )
347-
347+
348348
self.BLAS_nthreads = self.get_config('BLAS_nthreads') if self.get_config('BLAS_nthreads') > 0 else cpu_count() if self.get_config('BLAS_nthreads') == -1 else ERROR('Number of BLAS threads must be positive or -1')
349349

350350
# store some values for later use
@@ -385,7 +385,7 @@ def load_kernels( self ) :
385385
ERROR( 'Model not set; call "set_model()" method first' )
386386
if self.scheme is None :
387387
ERROR( 'Scheme not loaded; call "load_data()" first' )
388-
388+
389389
self.BLAS_nthreads = self.get_config('BLAS_nthreads') if self.get_config('BLAS_nthreads') > 0 else cpu_count() if self.get_config('BLAS_nthreads') == -1 else ERROR('Number of BLAS threads must be positive or -1')
390390

391391
tic = time.time()
@@ -418,7 +418,7 @@ def fit( self ) :
418418
ERROR( 'Response functions were not created with the same model' )
419419
if self.get_config('DTI_fit_method') not in ['OLS', 'LS', 'WLS', 'NLLS', 'RT', 'RESTORE', 'restore']:
420420
ERROR("DTI fit method must be one of the following:\n'OLS'(default) or 'LS': ordinary least squares\n'WLS': weighted least squares\n'NLLS': non-linear least squares\n'RT' or 'RESTORE' or 'restore': robust tensor\nNOTE: more info at https://dipy.org/documentation/1.6.0./reference/dipy.reconst/#dipy.reconst.dti.TensorModel")
421-
421+
422422
self.nthreads = self.get_config('nthreads') if self.get_config('nthreads') > 0 else cpu_count() if self.get_config('nthreads') == -1 else ERROR('Number of parallel threads must be positive or -1')
423423
self.BLAS_nthreads = self.get_config('BLAS_nthreads') if self.get_config('BLAS_nthreads') > 0 else cpu_count() if self.get_config('BLAS_nthreads') == -1 else ERROR('Number of BLAS threads must be positive or -1')
424424

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = dmri-amico
3-
version = 2.1.0
3+
version = 2.1.1
44
url = https://github.com/daducci/AMICO
55
download_url = https://pypi.org/project/dmri-amico
66
project_urls =

0 commit comments

Comments
 (0)