Skip to content

Commit f94b326

Browse files
committed
[PNE-6674] Expose candidate comments.
1 parent 2e98401 commit f94b326

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

src/citrine/__version__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "3.16.0"
1+
__version__ = "3.17.0"

src/citrine/informatics/design_candidate.py

+11
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@
2020
]
2121

2222

23+
class DesignCandidateComment(Serializable["DesignCandidateComment"]):
24+
message = properties.String('message')
25+
""":str: the text of the comment"""
26+
created_by = properties.UUID('created.user')
27+
""":UUID: id of the user who created the comment"""
28+
create_time = properties.Datetime('created.time')
29+
""":datetime: date and time at which the comment was created"""
30+
31+
2332
class DesignVariable(PolymorphicSerializable["DesignVariable"]):
2433
"""Classes containing data corresponding to individual descriptors.
2534
@@ -185,6 +194,8 @@ class DesignCandidate(Serializable["DesignCandidate"]):
185194
""":Optional[UUID]: id of the user who pinned the candidate, if it's been pinned"""
186195
pinned_time = properties.Optional(properties.Datetime, 'pinned.time')
187196
""":Optional[datetime]: date and time at which the candidate was pinned, if it's been pinned"""
197+
comments = properties.List(properties.Object(DesignCandidateComment), 'comments', default=[])
198+
""":list[DesignCandidateComment]: the list of comments on the candidate, with metadata."""
188199

189200

190201
class HierarchicalDesignCandidate(Serializable["HierarchicalDesignCandidate"]):

tests/conftest.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,16 @@ def example_candidates(example_design_material):
851851
"primary_score": 0,
852852
"material": example_design_material,
853853
"name": "Example candidate",
854-
"hidden": True
854+
"hidden": True,
855+
"comments": [
856+
{
857+
"message": "a message",
858+
"created": {
859+
"user": str(uuid.uuid4()),
860+
"time": '2025-02-20T10:46:26Z'
861+
}
862+
}
863+
]
855864
}]
856865
}
857866

0 commit comments

Comments
 (0)