Patched test cases

parent b61c22e9
Pipeline #48050 passed with stage
in 8 minutes and 56 seconds
......@@ -46,6 +46,7 @@ class DummyDatabase:
key=str(uuid.uuid4()),
annotations=1,
reference_id=str(i),
subject_id=str(i),
)
for i in range(offset, offset + n_samples)
]
......@@ -57,6 +58,7 @@ class DummyDatabase:
key=str(uuid.uuid4()),
annotations=1,
reference_id=str(i),
subject_id=str(i),
)
for i in range(offset, offset + n_samples)
]
......@@ -70,6 +72,7 @@ class DummyDatabase:
samples=[],
key=str(i),
reference_id=str(i),
subject_id=str(i),
gender=np.random.choice(self.gender_choices),
metadata_1=np.random.choice(self.metadata_1_choices),
)
......
......@@ -33,7 +33,7 @@ import bob.pipelines as mario
import uuid
import shutil
import itertools
from scipy.spatial.distance import cdist
from scipy.spatial.distance import cdist, euclidean
from sklearn.preprocessing import FunctionTransformer
import copy
......@@ -147,6 +147,7 @@ def test_norm_mechanics():
[Sample(s, reference_id=str(i + offset), key=str(uuid.uuid4()))],
key=str(i + offset),
reference_id=str(i + offset),
subject_id=str(i + offset),
)
for i, s in enumerate(raw_data)
]
......@@ -156,6 +157,7 @@ def test_norm_mechanics():
[Sample(s, reference_id=str(i + offset), key=str(uuid.uuid4()))],
key=str(i + offset),
reference_id=str(i + offset),
subject_id=str(i + offset),
references=references,
)
for i, s in enumerate(raw_data)
......@@ -226,11 +228,11 @@ def test_norm_mechanics():
#############
transformer = make_pipeline(FunctionTransformer(func=_do_nothing_fn))
biometric_algorithm = Distance(factor=1)
biometric_algorithm = Distance(euclidean, factor=1)
if with_checkpoint:
biometric_algorithm = BioAlgorithmCheckpointWrapper(
Distance(factor=1), dir_name
Distance(distance_function=euclidean, factor=1), dir_name,
)
vanilla_pipeline = VanillaBiometricsPipeline(
......@@ -252,6 +254,7 @@ def test_norm_mechanics():
raw_scores = _dump_scores_from_samples(
score_samples, shape=(n_probes, n_references)
)
assert np.allclose(raw_scores, raw_scores_ref)
############
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment