Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.bio.base
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
bob
bob.bio.base
Merge requests
!127
Use super in base file classes
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Use super in base file classes
super
into
master
Overview
1
Commits
1
Pipelines
1
Changes
1
Merged
Amir MOHAMMADI
requested to merge
super
into
master
7 years ago
Overview
1
Commits
1
Pipelines
1
Changes
1
Expand
cross ref:
bob.db.base!36 (merged)
Edited
7 years ago
by
Amir MOHAMMADI
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
8376cb79
1 commit,
7 years ago
1 file
+
7
−
5
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
bob/bio/base/database/file.py
+
7
−
5
Options
@@ -22,8 +22,8 @@ class BioFile(bob.db.base.File):
see :py:class:`bob.db.base.File` constructor
"""
def
__init__
(
self
,
client_id
,
path
,
file_id
=
None
):
bob
.
db
.
base
.
File
.
__init__
(
self
,
path
,
file_id
)
def
__init__
(
self
,
client_id
,
path
,
file_id
=
None
,
**
kwargs
):
super
(
BioFile
,
self
)
.
__init__
(
path
,
file_id
,
**
kwargs
)
# just copy the information
self
.
client_id
=
client_id
@@ -48,13 +48,15 @@ class BioFileSet(BioFile):
All files of that list need to have the same client ID.
"""
def
__init__
(
self
,
file_set_id
,
files
,
path
=
None
):
def
__init__
(
self
,
file_set_id
,
files
,
path
=
None
,
**
kwargs
):
# don't accept empty file lists
assert
len
(
files
),
"
Cannot create an empty BioFileSet
"
# call base class constructor
BioFile
.
__init__
(
self
,
files
[
0
].
client_id
,
"
+
"
.
join
(
f
.
path
for
f
in
files
)
if
path
is
None
else
path
,
file_set_id
)
super
(
BioFileSet
,
self
).
__init__
(
files
[
0
].
client_id
,
"
+
"
.
join
(
f
.
path
for
f
in
files
)
if
path
is
None
else
path
,
file_set_id
,
**
kwargs
)
# check that all files come from the same client
assert
all
(
f
.
client_id
==
self
.
client_id
for
f
in
files
)
Loading