Skip to content

Commit

Permalink
fix: unsupported mypy operand | in Python 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
IamGianluca committed Apr 6, 2024
1 parent 4d5c2ff commit 61ca5ec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion blazingai/vision/convert.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from functools import partial
from pathlib import Path
from typing import Union

import numpy as np
from joblib import Parallel, delayed
Expand Down Expand Up @@ -62,7 +63,7 @@ def _convert_one_dicom_img(img_path: Path, in_path: Path, out_path: Path) -> Non

def convert_dicom2numpy(
img_path: Path, voi_lut: bool = True, fix_monochrome: bool = True
) -> np.ndarray | ValueError:
) -> Union[np.ndarray, ValueError]:
# credits: https://www.kaggle.com/raddar/convert-dicom-to-np-array-the-correct-way
try:
dicom = dcmread(img_path)
Expand Down

0 comments on commit 61ca5ec

Please sign in to comment.