Skip to content

Commit f85082b

Browse files
committed
corrections to find_centre_pc and remove cucim dependencies
1 parent a08605e commit f85082b

File tree

11 files changed

+68
-49
lines changed

11 files changed

+68
-49
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: HTTomolibgpu docs
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- main
8+
push:
9+
branches:
10+
- main
11+
12+
jobs:
13+
build-linux:
14+
runs-on: ubuntu-latest
15+
defaults:
16+
run:
17+
shell: bash -el {0}
18+
steps:
19+
- name: Checkout repository code
20+
uses: actions/checkout@v3
21+
22+
- name: Setup Python 3.10
23+
uses: actions/setup-python@v3
24+
with:
25+
python-version: "3.10"
26+
27+
- name: httomolib
28+
uses: conda-incubator/setup-miniconda@v2
29+
with:
30+
auto-update-conda: false
31+
activate-environment: httomolibgpu
32+
environment-file: ./docs/source/doc-conda-requirements.yml
33+
34+
- name: Build api docs
35+
run: sphinx-apidoc -feT -t=./docs/source/_templates -o ./docs/source/api ./httomolibgpu
36+
37+
- name: Build html
38+
run: sphinx-build -a -E -b html ./docs/source/ ./docs/build/
39+
40+
- name: Run ghp-import
41+
run: ghp-import -n -p -f ./docs/build
42+
env:
43+
GITHUB_TOKEN: ${{ github.token }}
44+

.github/workflows/nightly_build.yml renamed to .github/workflows/httomolibgpu_nightly_build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: httomolibgpu nightly dev conda package build + upload
1+
name: httomolibgpu nightly dev
22

33
on:
44
schedule:
55
# Run at midnight every day
66
- cron: '0 0 * * *'
77

88
jobs:
9-
build-linux:
9+
main-conda-build:
1010
runs-on: ubuntu-20.04
1111

1212
defaults:
@@ -20,11 +20,11 @@ jobs:
2020
ref: "main"
2121
fetch-depth: 0
2222

23-
# setup Python 3.9
24-
- name: Setup Python 3.9
25-
uses: actions/setup-python@v2
23+
# setup Python 3.10
24+
- name: Setup Python 3.10
25+
uses: actions/setup-python@v4
2626
with:
27-
python-version: 3.9
27+
python-version: '3.10'
2828

2929
- name: Decrypt a secret
3030
run: ./.scripts/decrypt_secret.sh

.github/workflows/tests_run.yml renamed to .github/workflows/httomolibgpu_tests_run_iris.yml

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
name: httomolibgpu tests on Iris
2-
1+
name: httomolibgpu tests
32
on:
43
push:
54
branches:
@@ -9,7 +8,7 @@ on:
98
- main
109

1110
jobs:
12-
build-linux:
11+
iris-gpu:
1312
runs-on: iris-gpu
1413
container:
1514
image: nvidia/cuda:11.6.2-devel-ubi8
@@ -40,20 +39,3 @@ jobs:
4039
- name: Run tests
4140
run: |
4241
pytest tests/
43-
44-
- name: Install docs dependencies
45-
run: |
46-
micromamba install -c conda-forge sphinx sphinx-book-theme jinja2 sphinx-panels sphinx-copybutton sphinxcontrib-bibtex nbsphinx pyyaml ghp-import
47-
micromamba list
48-
49-
- name: Build api docs
50-
run: |
51-
sphinx-apidoc -feT -t=./docs/source/_templates -o ./docs/source/api ./httomolibgpu
52-
53-
- name: Build html
54-
run: sphinx-build -a -E -b html ./docs/source/ ./docs/build/
55-
56-
- name: Run ghp-import
57-
run: ghp-import -n -p -f ./docs/build
58-
env:
59-
GITHUB_TOKEN: ${{ github.token }}

.github/workflows/conda_upload.yml renamed to .github/workflows/httomolibgpu_version_tag.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: httomolibgpu conda upload
1+
name: httomolibgpu version tag pushed
22

33
# Run the workflow whenever a tag beginning with `v` is pushed to any branch
44
on:
@@ -7,7 +7,7 @@ on:
77
- v*
88

99
jobs:
10-
build-linux:
10+
conda-upload-main:
1111
runs-on: ubuntu-20.04
1212

1313
defaults:
@@ -21,11 +21,11 @@ jobs:
2121
fetch-depth: 0
2222
ref: ${{ github.ref_name }}
2323

24-
# setup Python 3.9
25-
- name: Setup Python 3.9
26-
uses: actions/setup-python@v2
24+
# setup Python 3.10
25+
- name: Setup Python 3.10
26+
uses: actions/setup-python@v4
2727
with:
28-
python-version: 3.9
28+
python-version: '3.10'
2929

3030
# install dependencies with conda
3131
- name: Install dependencies with conda

.scripts/conda_upload.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export CONDA_BLD_PATH=~/conda-bld
1313
$CONDA/bin/conda install conda-build
1414
$CONDA/bin/conda install -c conda-forge anaconda-client
1515

16-
$CONDA/bin/conda build . -c conda-forge -c httomo -c rapidsai --no-test
16+
$CONDA/bin/conda build . -c conda-forge -c httomo --no-test
1717

1818
# upload packages to conda
1919
find $CONDA_BLD_PATH/$OS -name *.tar.bz2 | while read file

README.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ Install HTTomolibGPU as a pre-built conda Python package
2020
2121
$ conda create --name httomolibgpu # create a fresh conda environment
2222
$ conda activate httomolibgpu # activate the environment
23-
$ conda install -c httomo httomolibgpu -c rapidsai -c conda-forge # for linux users
24-
$ conda install -c httomo httomolibgpu -c jplumail -c conda-forge # for windows users
25-
23+
$ conda install -c httomo httomolibgpu -c conda-forge # for linux users
2624
2725
Setup the development environment:
2826
==================================
@@ -39,5 +37,5 @@ Build HTTomolibGPU as a conda Python package
3937

4038
.. code-block:: console
4139
42-
$ conda build conda/recipe/ -c conda-forge -c httomo -c rapidsai
40+
$ conda build conda/recipe/ -c conda-forge -c httomo
4341

conda/environment.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: httomolibgpu
22
channels:
33
- conda-forge
44
- httomo
5-
- rapidsai
65
dependencies:
76
- conda-forge::cupy=12.3.0
87
- conda-forge::numpy<=1.25
@@ -21,5 +20,4 @@ dependencies:
2120
- conda-forge::h5py
2221
- conda-forge::astra-toolbox
2322
- httomo::tomobar
24-
- rapidsai::cucim
2523
- conda-forge::scikit-image

conda/recipe/meta.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ requirements:
2424
- python
2525
- numpy>= 1.20, <= 1.25
2626
- cupy=12.3.0
27-
- cucim
2827
- astra-toolbox
2928
- nvtx
3029
- tomobar

httomolibgpu/misc/morph.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
nvtx = cupywrapper.nvtx
2929
from typing import Literal
3030

31-
from cupyx.scipy.interpolate import interpn
32-
3331
__all__ = [
3432
"sino_360_to_180",
3533
"data_resampler",
@@ -126,7 +124,7 @@ def data_resampler(
126124
Returns:
127125
cp.ndarray: Up/Down-scaled 3D cupy array
128126
"""
129-
if cupywrapper.cupy_run:
127+
if cupywrapper.cupy_run:
130128
return __data_resampler(data, newshape, axis, interpolation)
131129
else:
132130
print("data_resampler won't be executed because CuPy is not installed")
@@ -137,6 +135,8 @@ def data_resampler(
137135
def __data_resampler(
138136
data: cp.ndarray, newshape: list, axis: int = 1, interpolation: str = "linear"
139137
) -> cp.ndarray:
138+
from cupyx.scipy.interpolate import interpn
139+
140140
if data.ndim != 3:
141141
raise ValueError("only 3D data is supported")
142142

httomolibgpu/recon/rotation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ def __find_center_pc(
767767
rotc_guess: Union[float, Optional[str]] = None,
768768
) -> float:
769769
from cupyx.scipy.ndimage import shift
770-
from cucim.skimage.registration import phase_cross_correlation
770+
from skimage.registration import phase_cross_correlation
771771

772772
imgshift = 0.0 if rotc_guess is None else rotc_guess - (proj1.shape[1] - 1.0) / 2.0
773773

@@ -777,9 +777,9 @@ def __find_center_pc(
777777
# create reflection of second projection
778778
proj2 = cp.fliplr(proj2)
779779

780-
# using cucim of rapids to do phase cross correlation between two images
780+
# do phase cross correlation between two images
781781
shiftr = phase_cross_correlation(
782-
reference_image=proj1, moving_image=proj2, upsample_factor=1.0 / tol
782+
reference_image=proj1.get(), moving_image=proj2.get(), upsample_factor=1.0 / tol
783783
)
784784

785785
# Compute center of rotation as the center of first image and the

0 commit comments

Comments
 (0)