Skip to content

Commit c085c4d

Browse files
authored
Merge branch 'dev' into videodataset
2 parents 62bc90b + af9e8f9 commit c085c4d

File tree

847 files changed

+1446
-1352
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

847 files changed

+1446
-1352
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ repos:
6666
)$
6767
6868
- repo: https://github.com/hadialqattan/pycln
69-
rev: v2.4.0
69+
rev: v2.5.0
7070
hooks:
7171
- id: pycln
7272
args: [--config=pyproject.toml]

monai/data/meta_tensor.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,3 +607,8 @@ def print_verbose(self) -> None:
607607
print(self)
608608
if self.meta is not None:
609609
print(self.meta.__repr__())
610+
611+
612+
# needed in later versions of Pytorch to indicate the class is safe for serialisation
613+
if hasattr(torch.serialization, "add_safe_globals"):
614+
torch.serialization.add_safe_globals([MetaTensor])

monai/transforms/io/array.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"""
1212
A collection of "vanilla" transforms for IO functions.
1313
"""
14-
1514
from __future__ import annotations
1615

1716
import inspect

monai/utils/jupyter_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def plot_engine_status(
234234

235235

236236
def _get_loss_from_output(
237-
output: list[torch.Tensor | dict[str, torch.Tensor]] | dict[str, torch.Tensor] | torch.Tensor
237+
output: list[torch.Tensor | dict[str, torch.Tensor]] | dict[str, torch.Tensor] | torch.Tensor,
238238
) -> torch.Tensor:
239239
"""Returns a single value from the network output, which is a dict or tensor."""
240240

monai/visualize/img2tensorboard.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ def _image3_animated_gif(
6565
img_str = b""
6666
for b_data in PIL.GifImagePlugin.getheader(ims[0])[0]:
6767
img_str += b_data
68-
img_str += b"\x21\xFF\x0B\x4E\x45\x54\x53\x43\x41\x50" b"\x45\x32\x2E\x30\x03\x01\x00\x00\x00"
68+
img_str += b"\x21\xff\x0b\x4e\x45\x54\x53\x43\x41\x50" b"\x45\x32\x2e\x30\x03\x01\x00\x00\x00"
6969
for i in ims:
7070
for b_data in PIL.GifImagePlugin.getdata(i):
7171
img_str += b_data
72-
img_str += b"\x3B"
72+
img_str += b"\x3b"
7373

7474
summary = SummaryX if has_tensorboardx and isinstance(writer, SummaryWriterX) else Summary
7575
summary_image_str = summary.Image(height=10, width=10, colorspace=1, encoded_image_string=img_str)

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pep8-naming
1818
pycodestyle
1919
pyflakes
2020
black>=22.12
21-
isort>=5.1
21+
isort>=5.1, <6.0
2222
ruff
2323
pytype>=2020.6.1; platform_system != "Windows"
2424
types-setuptools

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
torch>=1.9
1+
torch>=1.9,<2.6
22
numpy>=1.24,<2.0

runtests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ if [ $doDistTests = true ]
728728
then
729729
echo "${separator}${blue}run distributed unit test cases${noColor}"
730730
torch_validate
731-
for i in tests/test_*_dist.py
731+
for i in $(find ./tests/ -name "*_dist.py")
732732
do
733733
echo "$i"
734734
${cmdPrefix}${cmd} "$i"
@@ -740,7 +740,7 @@ if [ $doNetTests = true ]
740740
then
741741
set +e # disable exit on failure so that diagnostics can be given on failure
742742
echo "${separator}${blue}integration${noColor}"
743-
for i in tests/*integration_*.py
743+
for i in tests/integration/*.py
744744
do
745745
echo "$i"
746746
${cmdPrefix}${cmd} "$i"

tests/apps/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) MONAI Consortium
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
# Unless required by applicable law or agreed to in writing, software
7+
# distributed under the License is distributed on an "AS IS" BASIS,
8+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
# See the License for the specific language governing permissions and
10+
# limitations under the License.

tests/apps/deepedit/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) MONAI Consortium
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
# Unless required by applicable law or agreed to in writing, software
7+
# distributed under the License is distributed on an "AS IS" BASIS,
8+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
# See the License for the specific language governing permissions and
10+
# limitations under the License.

0 commit comments

Comments
 (0)