Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions convokit/forecaster/forecaster.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
ContextTuple = namedtuple(
"ContextTuple", ["context", "current_utterance", "future_context", "conversation_id"]
)
ContextTuple.context.__doc__ = "Chronological utterances up to and including the current utterance."
ContextTuple.current_utterance.__doc__ = "Most recent utterance when this context was generated."
ContextTuple.future_context.__doc__ = (
"Later utterances during training, or None when future context is unavailable."
)
ContextTuple.conversation_id.__doc__ = "Identifier of the conversation that produced this context."


class Forecaster(Transformer):
Expand Down
23 changes: 23 additions & 0 deletions convokit/tests/test_context_tuple_docs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import unittest

from convokit.forecaster.forecaster import ContextTuple


class ContextTupleDocsTest(unittest.TestCase):
def test_fields_have_descriptive_docstrings(self):
self.assertEqual(
{
"context": ContextTuple.context.__doc__,
"current_utterance": ContextTuple.current_utterance.__doc__,
"future_context": ContextTuple.future_context.__doc__,
"conversation_id": ContextTuple.conversation_id.__doc__,
},
{
"context": "Chronological utterances up to and including the current utterance.",
"current_utterance": "Most recent utterance when this context was generated.",
"future_context": (
"Later utterances during training, or None when future context is unavailable."
),
"conversation_id": "Identifier of the conversation that produced this context.",
},
)
Loading