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
6f2383c8
Commit
6f2383c8
authored
1 year ago
by
Daniel CARRON
Committed by
André Anjos
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix ptbench datamodule list
parent
c0d3f454
No related branches found
No related tags found
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/datamodule.py
+15
-13
15 additions, 13 deletions
src/ptbench/scripts/datamodule.py
with
15 additions
and
13 deletions
src/ptbench/scripts/datamodule.py
+
15
−
13
View file @
6f2383c8
...
...
@@ -17,14 +17,14 @@ from ..data.split import check_database_split_loading
logger
=
setup
(
__name__
.
split
(
"
.
"
)[
0
],
format
=
"
%(levelname)s: %(message)s
"
)
def
_get_installed_
protocol
s
()
->
dict
[
str
,
str
]:
"""
Returns a list of all installed
protocol
s.
def
_get_installed_
datamodule
s
()
->
dict
[
str
,
str
]:
"""
Returns a list of all installed
datamodule
s.
Returns
-------
protocol
s:
List of
protocol
s.
datamodule
s:
List of
datamodule
s.
"""
entrypoints
=
sorted
(
[
...
...
@@ -35,18 +35,20 @@ def _get_installed_protocols() -> dict[str, str]:
]
)
protocol
s
=
[
datamodule
s
=
[
importlib
.
metadata
.
entry_points
(
group
=
"
ptbench.config
"
)[
entrypoint
].
module
for
entrypoint
in
entrypoints
]
protocols_dict
=
{
entrypoints
[
i
]:
protocols
[
i
]
for
i
in
range
(
len
(
entrypoints
))
datamodules_dict
=
{
entrypoints
[
i
]:
datamodules
[
i
]
for
i
in
range
(
len
(
entrypoints
))
if
datamodules
[
i
].
split
(
"
.
"
)[
1
]
==
"
data
"
}
return
protocol
s_dict
return
datamodule
s_dict
@click.group
(
cls
=
AliasedGroup
)
...
...
@@ -74,20 +76,20 @@ def datamodule() -> None:
This setting **is** case-sensitive.
\b
2. List all raw data
sets
supported (and configured):
2. List all raw data
module
supported (and configured):
.. code:: sh
$ ptbench data
set
list
$ ptbench data
module
list
"""
,
)
@verbosity_option
(
logger
=
logger
,
expose_value
=
False
)
def
list
():
"""
Lists all supported and configured data
set
s.
"""
installed
=
_get_installed_
protocol
s
()
"""
Lists all supported and configured data
module
s.
"""
installed
=
_get_installed_
datamodule
s
()
click
.
echo
(
"
Available
protocol
s:
"
)
click
.
echo
(
"
Available
datamodule
s:
"
)
for
k
,
v
in
installed
.
items
():
click
.
echo
(
f
'
-
{
k
}
:
"
{
v
}
"'
)
...
...
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