arxiv.submission.services.classic.interpolate module

Inject events from outside the scope of the NG submission system.

A core concept of the arxiv.submission.domain.event model is that the state of a submission can be obtained by playing forward all of the commands/events applied to it. That works when all agents that operate on submission state are generating commands. The problem that we face in the short term is that some operations will be performed by legacy components that don’t generate command/event data.

The objective of the ClassicEventInterpolator is to reconcile NG events/commands with aspects of the classic database that are outside its current purview. The logic in this module will need to change as the scope of the NG submission data architecture expands.

class arxiv.submission.services.classic.interpolate.ClassicEventInterpolator(current_row, subsequent_rows, events)[source]

Bases: object

Interleaves events with classic data to get the current state.

get_submission_state()[source]

Get the current state of the Submission.

This is effectively memoized.

Return type

Tuple[Submission, List[Event]]

Returns

  • domain.submission.Submission – The most recent state of the submission given the provided events and database rows.

  • list – Items are Event instances applied to generate the returned state. This may include events inferred and interpolated from the classic database, not passed in the original set of events.

next_row

Access the next classic database row for this submission.

Return type

Submission