Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Change Log
### All notable changes to `AMICO` will be documented in this file.

## `v2.1.1`<br>_2025-08-13_
### 🐛Fixed
- `UserWarning`: `pkg_resources` is deprecated as an API.

---
---

## `v2.1.0`<br>_2025-01-20_
### 🛠️Changed
- Support for `numpy>=2.0.0`
Expand Down
12 changes: 6 additions & 6 deletions amico/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import dipy.reconst.dti as dti
from amico.util import PRINT, LOG, WARNING, ERROR, get_verbose
from dicelib.ui import ProgressBar
from pkg_resources import get_distribution
from threadpoolctl import ThreadpoolController

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

# store all the parameters of an evaluation with AMICO
self.CONFIG = {}
self.set_config('version', get_distribution('dmri-amico').version)
from . import __version__ as version
self.set_config('version', version)
self.set_config('study_path', study_path)
self.set_config('subject', subject)
self.set_config('DATA_path', pjoin( study_path, subject ))
Expand Down Expand Up @@ -312,7 +312,7 @@ def set_solver( self, **params ) :
"""
if self.model is None :
ERROR( 'Model not set; call "set_model()" method first' )

solver_params = list(inspect.signature(self.model.set_solver).parameters)
params_new = {}
for key in params.keys():
Expand Down Expand Up @@ -344,7 +344,7 @@ def generate_kernels( self, regenerate = False, lmax = 12, ndirs = 500 ) :
ERROR( 'Model not set; call "set_model()" method first' )
if not is_valid(ndirs):
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]' )

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')

# store some values for later use
Expand Down Expand Up @@ -385,7 +385,7 @@ def load_kernels( self ) :
ERROR( 'Model not set; call "set_model()" method first' )
if self.scheme is None :
ERROR( 'Scheme not loaded; call "load_data()" first' )

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')

tic = time.time()
Expand Down Expand Up @@ -418,7 +418,7 @@ def fit( self ) :
ERROR( 'Response functions were not created with the same model' )
if self.get_config('DTI_fit_method') not in ['OLS', 'LS', 'WLS', 'NLLS', 'RT', 'RESTORE', 'restore']:
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")

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')
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')

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = dmri-amico
version = 2.1.0
version = 2.1.1
url = https://github.com/daducci/AMICO
download_url = https://pypi.org/project/dmri-amico
project_urls =
Expand Down