CancellationToken
symbolica.community.hepkit Class
CancellationToken()A thread-safe signal for cancelling a long diagram-generation job.
Pass one token as cancellation_token and call cancel from a controlling thread when a large topology search should stop early.
Examples
from symbolica.community import hepkit as hep
token = hep.CancellationToken()
token.is_cancelledConstructor
#Create an independent token that can cancel a generation request.
Examples
Using the setup in the CancellationToken class example:
token = hep.CancellationToken()Member details
is_cancelled
Property · read-only#is_cancelled: boolReport whether cancellation has been requested.
Examples
Using the setup in the CancellationToken class example:
token = hep.CancellationToken()
token.cancel()
token.is_cancelledcancel
Method#cancel() -> NoneMark this token as cancelled for all generation requests using it.
Examples
Using the setup in the CancellationToken class example:
token.cancel()View generated signature source: docs/api/python/feynkit-community.pyi:424