Skip to content

Commit

Permalink
fixing imports2
Browse files Browse the repository at this point in the history
  • Loading branch information
dkazanc committed May 1, 2024
1 parent eb5da60 commit 959a3af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion httomolibgpu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from httomolibgpu.misc.rescale import rescale_to_int
from httomolibgpu.prep.alignment import distortion_correction_proj_discorpy
from httomolibgpu.prep.normalize import normalize
from httomolibgpu.prep.phase import paganin_filter_savu, paganin_filter_tomopy
#from httomolibgpu.prep.phase import paganin_filter_savu, paganin_filter_tomopy
# from httomolibgpu.prep.stripe import (
# remove_stripe_based_sorting,
# remove_stripe_ti,
Expand Down
12 changes: 8 additions & 4 deletions httomolibgpu/prep/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,25 @@
# ---------------------------------------------------------------------------
"""Modules for raw projection data normalization"""


import numpy as np
cupy_run = False
try:
import cupy as xp
from cupy import mean
import cupy as xp

try:
xp.cuda.Device(0).compute_capability
cupy_run = True
except xp.cuda.runtime.CUDARuntimeError:
print("CuPy library is a major dependency for HTTomolibgpu, please install")
import numpy as xp
except ImportError:
import numpy as xp

if cupy_run:
from cupy import mean
else:
from numpy import mean
import nvtx
import numpy as np
from numpy import float32
from typing import Tuple

Expand Down

0 comments on commit 959a3af

Please sign in to comment.