From f94b326a48cb00aeb9d48d412181209b4557f651 Mon Sep 17 00:00:00 2001 From: Austin Noto-Moniz Date: Thu, 20 Feb 2025 13:56:25 -0500 Subject: [PATCH] [PNE-6674] Expose candidate comments. --- src/citrine/__version__.py | 2 +- src/citrine/informatics/design_candidate.py | 11 +++++++++++ tests/conftest.py | 11 ++++++++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/citrine/__version__.py b/src/citrine/__version__.py index 331093ae1..a3207ca50 100644 --- a/src/citrine/__version__.py +++ b/src/citrine/__version__.py @@ -1 +1 @@ -__version__ = "3.16.0" +__version__ = "3.17.0" diff --git a/src/citrine/informatics/design_candidate.py b/src/citrine/informatics/design_candidate.py index 5e392b400..94fbcd275 100644 --- a/src/citrine/informatics/design_candidate.py +++ b/src/citrine/informatics/design_candidate.py @@ -20,6 +20,15 @@ ] +class DesignCandidateComment(Serializable["DesignCandidateComment"]): + message = properties.String('message') + """:str: the text of the comment""" + created_by = properties.UUID('created.user') + """:UUID: id of the user who created the comment""" + create_time = properties.Datetime('created.time') + """:datetime: date and time at which the comment was created""" + + class DesignVariable(PolymorphicSerializable["DesignVariable"]): """Classes containing data corresponding to individual descriptors. @@ -185,6 +194,8 @@ class DesignCandidate(Serializable["DesignCandidate"]): """:Optional[UUID]: id of the user who pinned the candidate, if it's been pinned""" pinned_time = properties.Optional(properties.Datetime, 'pinned.time') """:Optional[datetime]: date and time at which the candidate was pinned, if it's been pinned""" + comments = properties.List(properties.Object(DesignCandidateComment), 'comments', default=[]) + """:list[DesignCandidateComment]: the list of comments on the candidate, with metadata.""" class HierarchicalDesignCandidate(Serializable["HierarchicalDesignCandidate"]): diff --git a/tests/conftest.py b/tests/conftest.py index 55ca200ea..b841139bc 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -851,7 +851,16 @@ def example_candidates(example_design_material): "primary_score": 0, "material": example_design_material, "name": "Example candidate", - "hidden": True + "hidden": True, + "comments": [ + { + "message": "a message", + "created": { + "user": str(uuid.uuid4()), + "time": '2025-02-20T10:46:26Z' + } + } + ] }] }