Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
qim3d
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
QIM
Tools
qim3d
Merge requests
!110
Refactor for v0.4
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
Refactor for v0.4
refactor_for_v0.4
into
main
Overview
0
Commits
10
Pipelines
0
Changes
13
Merged
Refactor for v0.4
fima
requested to merge
refactor_for_v0.4
into
main
Jul 29, 2024
Overview
0
Commits
10
Pipelines
0
Changes
13
Major refactoring!
Uses lazy loading for imports
Utils is set for internal tools only
0
0
Merge request reports
Viewing commit
57525caa
Prev
Next
Show latest version
13 files
+
330
−
238
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
13
57525caa
All tests passing
· 57525caa
fima
authored
Jul 29, 2024
qim3d/io/loading.py
+
3
−
4
View file @ 57525caa
Edit in single-file editor
Open in Web IDE
Show full file
@@ -22,6 +22,7 @@ import tifffile
from
dask
import
delayed
from
PIL
import
Image
,
UnidentifiedImageError
import
qim3d
from
qim3d.utils.logger
import
log
from
qim3d.utils.misc
import
get_file_size
,
sizeof
,
stringify_path
from
qim3d.utils.system
import
Memory
@@ -722,10 +723,8 @@ class DataLoader:
# Fails
else
:
# Find the closest matching path to warn the user
parent_dir
=
os
.
path
.
dirname
(
path
)
or
"
.
"
parent_files
=
os
.
listdir
(
parent_dir
)
if
os
.
path
.
isdir
(
parent_dir
)
else
""
valid_paths
=
[
os
.
path
.
join
(
parent_dir
,
file
)
for
file
in
parent_files
]
similar_paths
=
difflib
.
get_close_matches
(
path
,
valid_paths
)
similar_paths
=
qim3d
.
utils
.
misc
.
find_similar_paths
(
path
)
if
similar_paths
:
suggestion
=
similar_paths
[
0
]
# Get the closest match
message
=
f
"
Invalid path. Did you mean
'
{
suggestion
}
'
?
"
Loading