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
2 changes: 1 addition & 1 deletion monai/bundle/config_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def get_component_module_name(self, name: str) -> Optional[Union[List[str], str]
# init component and module mapping table
self._components_table = self._find_classes_or_functions(self._find_module_names())

mods: Optional[Union[List[str], str]] = self._components_table.get(name, None)
mods: Optional[Union[List[str], str]] = self._components_table.get(name)
if isinstance(mods, list) and len(mods) == 1:
mods = mods[0]
return mods
Expand Down
2 changes: 1 addition & 1 deletion monai/data/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(self, dataset: Dataset, num_workers: int = 0, **kwargs) -> None:
# when num_workers > 0, random states are determined by worker_init_fn
# this is to make the behavior consistent when num_workers == 0
# torch.int64 doesn't work well on some versions of windows
_g = torch.random.default_generator if kwargs.get("generator", None) is None else kwargs["generator"]
_g = torch.random.default_generator if kwargs.get("generator") is None else kwargs["generator"]
init_seed = _g.initial_seed()
_seed = torch.empty((), dtype=torch.int64).random_(generator=_g).item()
set_rnd(dataset, int(_seed))
Expand Down
4 changes: 2 additions & 2 deletions monai/utils/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ class MONAIEnvVars:

@staticmethod
def data_dir() -> Optional[str]:
return os.environ.get("MONAI_DATA_DIRECTORY", None)
return os.environ.get("MONAI_DATA_DIRECTORY")

@staticmethod
def debug() -> bool:
Expand All @@ -406,7 +406,7 @@ def debug() -> bool:

@staticmethod
def doc_images() -> Optional[str]:
return os.environ.get("MONAI_DOC_IMAGES", None)
return os.environ.get("MONAI_DOC_IMAGES")


class ImageMetaKey:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_gmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
@skip_if_no_cuda
class GMMTestCase(unittest.TestCase):
def setUp(self):
self._var = os.environ.get("TORCH_EXTENSIONS_DIR", None)
self._var = os.environ.get("TORCH_EXTENSIONS_DIR")
self.tempdir = tempfile.mkdtemp()
os.environ["TORCH_EXTENSIONS_DIR"] = self.tempdir

Expand Down
2 changes: 1 addition & 1 deletion tests/test_monai_env_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TestMONAIEnvVars(unittest.TestCase):
@classmethod
def setUpClass(cls):
super(__class__, cls).setUpClass()
cls.orig_value = os.environ.get("MONAI_DEBUG", None)
cls.orig_value = os.environ.get("MONAI_DEBUG")

@classmethod
def tearDownClass(cls):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class TestTransform(unittest.TestCase):
@classmethod
def setUpClass(cls):
super(__class__, cls).setUpClass()
cls.orig_value = os.environ.get("MONAI_DEBUG", None)
cls.orig_value = os.environ.get("MONAI_DEBUG")

@classmethod
def tearDownClass(cls):
Expand Down