Skip to content
This repository has been archived by the owner on Jan 27, 2022. It is now read-only.

Commit

Permalink
fix(Executable code nodes): Make executeCount unsigned and clarify …
Browse files Browse the repository at this point in the history
…docs
  • Loading branch information
nokome committed Jan 24, 2022
1 parent 08550a0 commit 1704980
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions rust/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ pub struct CodeChunk {
pub execute_auto: Option<CodeChunkExecuteAuto>,

/// A count of the number of times that the node has been executed.
pub execute_count: Option<Integer>,
pub execute_count: Option<u32>,

/// The `compileDigest` of the node when it was last executed.
pub execute_digest: Option<Box<Cord>>,
Expand Down Expand Up @@ -304,7 +304,7 @@ pub struct CodeExpression {
pub errors: Option<Vec<CodeError>>,

/// A count of the number of times that the node has been executed.
pub execute_count: Option<Integer>,
pub execute_count: Option<u32>,

/// The `compileDigest` of the node when it was last executed.
pub execute_digest: Option<Box<Cord>>,
Expand Down
5 changes: 3 additions & 2 deletions schema/CodeExecutable.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ properties:
type: integer
minimum: 0
$comment: |
Analogous to `execution_count` in Jupyter Notebook format v4.5 but not a required
property as it is there.
Intended to increment with each successive execution of the node, including across sessions.
Note that this differs to the `execution_count` in Jupyter Notebook format which is
the "code cell's prompt number" and which resets at the start of each new session.
executeDigest:
'@id': stencila:executeDigest
description: The `compileDigest` of the node when it was last executed.
Expand Down
2 changes: 2 additions & 0 deletions ts/bindings/rust.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ const propertyTypes: Record<string, string> = {
'ArrayValidator.maxItems': 'u32',
'StringValidator.minLength': 'u32',
'StringValidator.maxLength': 'u32',
'CodeChunk.executeCount': 'u32',
'CodeExpression.executeCount': 'u32',
// Use `Cord` instead of string for more efficient patching of digests
'*.compileDigest': 'Box<Cord>',
'*.buildDigest': 'Box<Cord>',
Expand Down

0 comments on commit 1704980

Please sign in to comment.