Skip to content

Commit

Permalink
Merge pull request #988 from CitrineInformatics/feature/pne-6674-cand…
Browse files Browse the repository at this point in the history
…idate-comments

[PNE-6674] Expose candidate comments.
  • Loading branch information
anoto-moniz authored Feb 24, 2025
2 parents 2e98401 + f94b326 commit e1090a5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/citrine/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "3.16.0"
__version__ = "3.17.0"
11 changes: 11 additions & 0 deletions src/citrine/informatics/design_candidate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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"]):
Expand Down
11 changes: 10 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}
]
}]
}

Expand Down

0 comments on commit e1090a5

Please sign in to comment.