Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mednet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
medai
software
mednet
Commits
ab805098
Commit
ab805098
authored
1 year ago
by
Daniel CARRON
Committed by
André Anjos
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Update dataset script to check splits
parent
ccc390cc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!6
Making use of LightningDataModule and simplification of data loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/ptbench/scripts/dataset.py
+33
-2
33 additions, 2 deletions
src/ptbench/scripts/dataset.py
with
33 additions
and
2 deletions
src/ptbench/scripts/dataset.py
+
33
−
2
View file @
ab805098
...
...
@@ -4,6 +4,7 @@
from
__future__
import
annotations
import
importlib.metadata
import
importlib.resources
import
os
...
...
@@ -12,6 +13,8 @@ import click
from
clapper.click
import
AliasedGroup
,
verbosity_option
from
clapper.logging
import
setup
from
..data.split
import
check_database_split_loading
logger
=
setup
(
__name__
.
split
(
"
.
"
)[
0
],
format
=
"
%(levelname)s: %(message)s
"
)
...
...
@@ -149,7 +152,35 @@ def check(dataset, limit):
errors
=
0
for
k
in
to_check
.
keys
():
click
.
echo
(
f
'
Checking
"
{
k
}
"
dataset...
'
)
module
=
importlib
.
import_module
(
f
"
...data.
{
k
}
"
,
__name__
)
errors
+=
module
.
dataset
.
check
(
limit
)
# Gathering protocols for the dataset
entrypoints
=
[
i
for
i
in
importlib
.
metadata
.
entry_points
(
group
=
"
ptbench.config
"
).
names
if
i
==
k
]
protocols_modules
=
sorted
(
[
importlib
.
metadata
.
entry_points
(
group
=
"
ptbench.config
"
)[
i
].
module
for
i
in
entrypoints
]
)
for
protocol
in
protocols_modules
:
datamodule
=
importlib
.
import_module
(
protocol
).
datamodule
database_split
=
datamodule
.
database_split
raw_data_loader
=
datamodule
.
raw_data_loader
logger
.
info
(
f
"
Checking protocol
{
protocol
}
"
)
errors
+=
check_database_split_loading
(
database_split
.
subsets
,
raw_data_loader
,
limit
=
limit
)
if
not
errors
:
click
.
echo
(
"
No errors reported
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment