Skip to content

Commit

Permalink
feat(CodeChunk): Add executeAuto and executePure properties
Browse files Browse the repository at this point in the history
  • Loading branch information
nokome committed Jan 15, 2022
1 parent 7b01a09 commit 16a4bd8
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
20 changes: 20 additions & 0 deletions schema/CodeChunk.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,26 @@ properties:
items:
$ref: BlockContent
- type: string
executeAuto:
'@id': stencila:executeAuto
description: Under which circumstances the node should be automatically executed.
enum:
- Never
- Needed
- Always
default: Needed
$comment: |
`Never`: Never automatically execute the code chunk. Only execute when the user explicitly runs
the code (or its containing document).
`Needed`: Automatically execute the code chunk if needed. Execute the code chunk if it is an
upstream dependency of a node that has been executed, or is a downstream dependent of a node that
has been executed.
`Always`: Always execute the code, even if it, or its dependencies, are unchanged since the
last time it was executed.
executePure:
'@id': stencila:executePure
description: Whether the code should be treated as side-effect free when executed.
type: boolean
outputs:
'@id': stencila:outputs
description: Outputs from executing the chunk.
Expand Down
2 changes: 1 addition & 1 deletion schema/CodeExecutable.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ properties:
last executed.
executeStatus:
'@id': stencila:executeStatus
description: Status of the most recent, including in progress, execution of the code.
description: Status of the most recent, including any current, execution of the code.
enum:
- Scheduled
- ScheduledPreviouslyFailed
Expand Down
4 changes: 4 additions & 0 deletions schema/CodeExpression.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ properties:
description: The value of the expression when it was last evaluated.
allOf:
- $ref: Node
$comment:
Note that `CodeExpression` nodes lack the `executeAuto` and `executePure` properties that
`CodeChunk` nodes have because they will always be executed (when dependencies) change and
should be side-effect free.
1 change: 1 addition & 0 deletions ts/bindings/rust.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ const noBoxTypes = [
'ClaimClaimType',
'CodeExecutableExecuteRequired',
'CodeExecutableExecuteStatus',
'CodeChunkExecuteAuto',
'ListOrder',
'NoteNoteType',
'SoftwareSessionStatus',
Expand Down

0 comments on commit 16a4bd8

Please sign in to comment.