Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.pipelines
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.pipelines
Commits
17f77d5a
Commit
17f77d5a
authored
5 years ago
by
Tiago de Freitas Pereira
Browse files
Options
Downloads
Patches
Plain Diff
Break the link between SampleSet and Sample
parent
03f9de2a
No related branches found
No related tags found
1 merge request
!20
Get SampleSet to accept DelayedSample
Pipeline
#38738
failed
5 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/pipelines/sample.py
+0
-7
0 additions, 7 deletions
bob/pipelines/sample.py
bob/pipelines/test/test_samples.py
+0
-9
0 additions, 9 deletions
bob/pipelines/test/test_samples.py
with
0 additions
and
16 deletions
bob/pipelines/sample.py
+
0
−
7
View file @
17f77d5a
...
...
@@ -93,18 +93,11 @@ class SampleSet(MutableSequence):
return
self
.
samples
.
__getitem__
(
item
)
def
__setitem__
(
self
,
key
,
item
):
if
not
isinstance
(
item
,
Sample
)
and
not
isinstance
(
item
,
DelayedSample
):
raise
ValueError
(
f
"
item should be of type Sample, not
{
item
}
"
)
return
self
.
samples
.
__setitem__
(
key
,
item
)
def
__delitem__
(
self
,
item
):
return
self
.
samples
.
__delitem__
(
item
)
def
insert
(
self
,
index
,
item
):
if
not
isinstance
(
item
,
Sample
)
and
not
isinstance
(
item
,
DelayedSample
):
raise
ValueError
(
f
"
item should be of type Sample, not
{
item
}
"
)
# if not item in self.samples:
self
.
samples
.
insert
(
index
,
item
)
This diff is collapsed.
Click to expand it.
bob/pipelines/test/test_samples.py
+
0
−
9
View file @
17f77d5a
from
bob.pipelines.sample
import
Sample
,
SampleSet
,
DelayedSample
import
numpy
from
nose.tools
import
assert_raises
import
copy
...
...
@@ -23,17 +22,9 @@ def test_sampleset_collection():
del
sampleset
[
0
]
assert
len
(
sampleset
)
==
n_samples
# Testing exception
with
assert_raises
(
ValueError
):
sampleset
.
insert
(
1
,
10
)
# Testing set
sampleset
[
0
]
=
copy
.
deepcopy
(
sample
)
# Testing exception
with
assert_raises
(
ValueError
):
sampleset
[
0
]
=
"
xuxa
"
# Testing iterator
for
i
in
sampleset
:
assert
isinstance
(
i
,
Sample
)
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