Skip to content

Commit 96a6960

Browse files
ShevchenkoRostyslavycbiometricswiktorlazarski
authored
release 1.9.1 (#140)
* tets workflow * upd * add prod workflow * correct the repo name * upd name * add a workflow to create docs * address PR comments * debugging * add requirements * upd deploy docs * docs branch * fix bug * cleaning * new way * fake upd of docds * upd * upd * rollback * upd * upd * revert * worktree * another approach * upd * keep some files * final version * swap the order * upd * upd * upd * remove .buildinfo * remove .buildinfo * cleaning * Iris multiview/aic 5901: e2e Multiframe Iris Pipeline (#123) * refactor multiframe iris pipeline * refactor and fix tests * fix test leakage from patches * upd e2e tests * fix broken tests * rename MultiframeAggregationPipeline -> TemplatesAggregation * Add user warning * bump the iris version * 1.8.3 -> 1.9.0 (#137) Co-authored-by: ycbiometrics <107422087+ycbiometrics@users.noreply.github.com> * Make sure that NodeWritterResult callback is always first in callbacks list of every node. * Hotfix/output builders type (#139) * 1.8.3 -> 1.9.0 * bugfix serialization data type * add speciofic e2e test for multiframe * revert the doc file from 1.9.0 releqase * Hotfix/output builders type (#141) * 1.8.3 -> 1.9.0 * release v1.9.0 (#136) * tets workflow * upd * add prod workflow * correct the repo name * upd name * add a workflow to create docs * address PR comments * debugging * add requirements * upd deploy docs * docs branch * fix bug * cleaning * new way * fake upd of docds * upd * upd * rollback * upd * upd * revert * worktree * another approach * upd * keep some files * final version * swap the order * upd * upd * upd * remove .buildinfo * remove .buildinfo * cleaning * Iris multiview/aic 5901: e2e Multiframe Iris Pipeline (#123) * refactor multiframe iris pipeline * refactor and fix tests * fix test leakage from patches * upd e2e tests * fix broken tests * rename MultiframeAggregationPipeline -> TemplatesAggregation * Add user warning * bump the iris version * 1.8.3 -> 1.9.0 (#137) Co-authored-by: ycbiometrics <107422087+ycbiometrics@users.noreply.github.com> --------- Co-authored-by: ycbiometrics <107422087+ycbiometrics@users.noreply.github.com> * bugfix serialization data type * add speciofic e2e test for multiframe * revert the doc file from 1.9.0 releqase * update iris version * upd --------- Co-authored-by: ycbiometrics <107422087+ycbiometrics@users.noreply.github.com> --------- Co-authored-by: ycbiometrics <107422087+ycbiometrics@users.noreply.github.com> Co-authored-by: Wiktor Łazarski <wjlazarski@gmail.com>
1 parent e7141c4 commit 96a6960

8 files changed

Lines changed: 61 additions & 11 deletions

File tree

src/iris/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.9.0"
1+
__version__ = "1.9.1"

src/iris/callbacks/pipeline_trace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def initialise(nodes: Dict[str, Algorithm], pipeline_nodes: List[PipelineNode])
136136
call_trace = PipelineCallTraceStorage(results_names=nodes.keys())
137137

138138
for algorithm_name, algorithm_object in nodes.items():
139-
algorithm_object._callbacks.append(NodeResultsWriter(call_trace, algorithm_name))
139+
algorithm_object._callbacks.insert(0, NodeResultsWriter(call_trace, algorithm_name))
140140

141141
return call_trace
142142

src/iris/orchestration/output_builders.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def _nested_safe_serialize(obj: Any) -> Any:
1919

2020
# Handle lists and tuples by serializing each element
2121
if isinstance(obj, (list, tuple)):
22-
return [_nested_safe_serialize(item) for item in obj]
22+
return type(obj)(_nested_safe_serialize(item) for item in obj)
2323

2424
# Handle mappings by serializing each value
2525
if isinstance(obj, Mapping):
@@ -67,7 +67,7 @@ def __safe_serialize(object: Optional[Any]) -> Optional[Any]:
6767
elif isinstance(object, ImmutableModel):
6868
return object.serialize()
6969
elif isinstance(object, (list, tuple)):
70-
return [__safe_serialize(sub_object) for sub_object in object]
70+
return type(object)(__safe_serialize(sub_object) for sub_object in object)
7171
elif isinstance(object, np.ndarray):
7272
return object.tolist()
7373
elif isinstance(object, (str, int, float, bool)):

src/iris/pipelines/confs/multiframe_iris_pipeline.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
metadata:
22
pipeline_name: multiframe_iris_pipeline
3-
iris_version: 1.9.0
3+
iris_version: 1.9.1
44

55
# Configuration for individual image processing (IRISPipeline)
66
iris_pipeline:
77
metadata:
88
pipeline_name: iris_pipeline
9-
iris_version: 1.9.0
9+
iris_version: 1.9.1
1010

1111
pipeline:
1212
- name: segmentation
@@ -313,7 +313,7 @@ iris_pipeline:
313313
# Configuration for template aggregation (TemplatesAggregationPipeline)
314314
templates_aggregation_pipeline:
315315
metadata:
316-
iris_version: 1.9.0
316+
iris_version: 1.9.1
317317
pipeline_name: templates_aggregation
318318

319319
pipeline:

src/iris/pipelines/confs/pipeline.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
metadata:
22
pipeline_name: iris_pipeline
3-
iris_version: 1.9.0
3+
iris_version: 1.9.1
44

55
pipeline:
66
- name: segmentation

src/iris/pipelines/confs/templates_aggregation_pipeline.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
metadata:
22
pipeline_name: iris_pipeline
3-
iris_version: 1.9.0
3+
iris_version: 1.9.1
44

55
pipeline:
66
- name: segmentation
@@ -305,7 +305,7 @@ pipeline:
305305

306306
templates_aggregation:
307307
metadata:
308-
iris_version: 1.9.0
308+
iris_version: 1.9.1
309309
pipeline_name: templates_aggregation
310310

311311
pipeline:

tests/e2e_tests/pipelines/test_e2e_multiframe_iris_pipeline.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ def test_iris_pipeline_with_aggregation_single_image(self, env, ir_image):
111111
assert isinstance(aggregation_pipeline_output["individual_frames"][0], dict)
112112
assert "error" in aggregation_pipeline_output["individual_frames"][0]
113113
assert "metadata" in aggregation_pipeline_output["individual_frames"][0]
114+
assert isinstance(aggregation_pipeline_output["individual_frames"][0]["metadata"]["image_size"], tuple)
114115

115116
# check that the individiual frame metadata contains all the fields from IrisPipeline metadata
116117
dummy_call_trace = Mock()

tests/unit_tests/orchestration/test_output_builders.py

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@
44
import pytest
55

66
from iris.callbacks.pipeline_trace import PipelineCallTraceStorage
7-
from iris.io.dataclasses import AlignedTemplates, DistanceMatrix, OutputFieldSpec, WeightedIrisTemplate
7+
from iris.io.dataclasses import (
8+
AlignedTemplates,
9+
DistanceMatrix,
10+
EyeCenters,
11+
Offgaze,
12+
OutputFieldSpec,
13+
WeightedIrisTemplate,
14+
)
15+
from iris.orchestration import output_builders as ob
816
from iris.orchestration.output_builders import (
917
_build_from_spec,
1018
build_aggregation_templates_orb_output,
@@ -13,6 +21,8 @@
1321
build_simple_iris_pipeline_orb_output,
1422
)
1523

24+
SAFE_SERIALIZE = getattr(ob, "__safe_serialize")
25+
1626

1727
class TestOutputBuildersWithMissingKeys:
1828
"""Test output builders behavior when keys are missing from call_trace."""
@@ -265,3 +275,42 @@ def test_with_alignment_and_identity_filter(self, mock_call_trace_with_alignment
265275
assert metadata["aligned_templates"]["reference_template_id"] == 0
266276
assert metadata["aligned_templates"]["distances"] == {(0, 0): 0.0}
267277
assert metadata["post_identity_filter_templates_count"] == 1
278+
279+
280+
class TestSafeSerialize:
281+
def test_none_returns_none(self):
282+
assert SAFE_SERIALIZE(None) is None
283+
284+
def test_immutable_model_serialization(self):
285+
offgaze = Offgaze(score=0.5)
286+
assert SAFE_SERIALIZE(offgaze) == offgaze.serialize()
287+
288+
eye_centers = EyeCenters(pupil_x=1.0, pupil_y=2.0, iris_x=3.0, iris_y=4.0)
289+
assert SAFE_SERIALIZE(eye_centers) == eye_centers.serialize()
290+
291+
def test_numpy_array_to_list(self):
292+
arr = np.array([[1, 2], [3, 4]])
293+
assert SAFE_SERIALIZE(arr) == arr.tolist()
294+
295+
def test_list_and_tuple_recursion(self):
296+
offgaze = Offgaze(score=0.25)
297+
arr = np.array([1, 2, 3])
298+
299+
data_list = [1, "a", offgaze, arr]
300+
assert SAFE_SERIALIZE(data_list) == [1, "a", offgaze.serialize(), arr.tolist()]
301+
302+
data_tuple = (True, 3.14, offgaze, arr)
303+
assert SAFE_SERIALIZE(data_tuple) == (True, 3.14, offgaze.serialize(), arr.tolist())
304+
305+
def test_primitives_passthrough(self):
306+
assert SAFE_SERIALIZE("hello") == "hello"
307+
assert SAFE_SERIALIZE(123) == 123
308+
assert SAFE_SERIALIZE(3.14) == 3.14
309+
assert SAFE_SERIALIZE(True) is True
310+
311+
def test_unsupported_type_raises(self):
312+
class Foo:
313+
pass
314+
315+
with pytest.raises(NotImplementedError):
316+
SAFE_SERIALIZE(Foo())

0 commit comments

Comments
 (0)