Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade packages post 2.8 release #2280

Merged
merged 12 commits into from
Jul 24, 2024
16 changes: 8 additions & 8 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ requirements:
run:
- python=3.10.*
- pip
- astropy=5.0.*
- scipy=1.8.*
- astropy=6.0.*
- scipy=1.14.*
- scikit-image=0.19.*
- tifffile=2023.7.18
- imagecodecs=2023.1.23
- numpy=1.23.*
- numpy=1.26.*
- numexpr=2.8.*
- algotom=1.0.*
- algotom=1.6.*
- tomopy=1.12.*
- cudatoolkit=10.2*
- cupy=10.2.*
- astra-toolbox=2.0.*
- cudatoolkit=11.8.*
- cupy=12.3.*
- astra-toolbox=2.0.0
- requests=2.27.*
- h5py=3.7.*
- psutil=5.9.*
- cil=24.0.*
- ccpi-regulariser
- jenkspy=0.2.0
- jenkspy=0.4.*
- pyqt=5.15.*
- pyqtgraph=0.13.7
- qt-material=2.14
Expand Down
1 change: 1 addition & 0 deletions docs/release_notes/next/dev-2268-upgrade-packages
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#2268: various python packages have been updated including astropy, scipy, nu,py, algotom, cudatoolkit, cupy, and jenkspy
7 changes: 5 additions & 2 deletions mantidimaging/core/reconstruct/astra_recon.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ def _count_gpus() -> int:
return num_gpus

@staticmethod
def find_cor(images: ImageStack, slice_idx: int, start_cor: float, recon_params: ReconstructionParameters) -> float:
def find_cor(images: ImageStack, slice_idx: int, start_cor: float | np.ndarray,
recon_params: ReconstructionParameters) -> float:
"""
Find the best CoR for this slice by maximising the squared sum of the reconstructed slice.

Expand All @@ -96,7 +97,9 @@ def find_cor(images: ImageStack, slice_idx: int, start_cor: float, recon_params:
def get_sumsq(image: np.ndarray) -> float:
return np.sum(image**2)

def minimizer_function(cor: float):
def minimizer_function(cor: float | np.ndarray) -> float:
if isinstance(cor, np.ndarray):
cor = float(cor[0])
return -get_sumsq(AstraRecon.single_sino(images.sino(slice_idx), ScalarCoR(cor), proj_angles, recon_params))

return minimize(minimizer_function, start_cor, method='nelder-mead', tol=0.1).x[0]
Expand Down
2 changes: 1 addition & 1 deletion mantidimaging/core/utility/data_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ScalarCoR(SingleValue):
__slots__ = 'value'
value: float

def to_vec(self, detector_width: float) -> VectorCoR:
def to_vec(self, detector_width):
return VectorCoR(detector_width / 2 - self.value)


Expand Down