GuidesDiscussionChangelogLog In

Control Activity Feed Behavior

Use code comments to manipulate how data is saved in the Activity Feed

The ability to control what is recorded in the activity feed is only available in Jupyter. (If you need this functionality for RStudio, please let us know on the forum.)

By default, whenever you execute a cell in Jupyter, Gigantum will make a commit that records the inputs and outputs. This allows for an accurate history of your work, including the context for your computations. Sometimes, however, you may have code or outputs that need to be ignored. For example, you might use the input() function to get a password from a user - by default, this password would be printed in the cell output and so also recorded in the Gigantum activity record.

The Gigantum Client will also apply a set of heuristics to determine what information is shown by default in the activity feed. For example, we default to showing all images, but record and hide long text output. While the viewer can manually show and hide details of an activity record, improved curation may enhance clarity to a reader or reviewer.

We provide a mechanism to control activity record behavior by placing control codes into cell comments. You can optionally put these special comments into a cell to specify the desired behavior of the cell:

  • # gtm:ignore - A new version will be created, but code inputs and outputs will not be recorded in the activity record.
  • # gtm:show - Output will default to shown / expanded in the activity record.
  • # gtm:hide - Output will default to hidden / collapsed in the activity record. Note that the information is still present and can be seen by manually expanding the activity record.
  • # gtm:auto - Use default behavior. This is the behavior used if no special comment is included in the cell.


Ouputs in saved files are also saved!

In the case that you need to completely suppress an output (e.g., in the case of a password), be sure to also clear the notebook's outputs prior to saving the file. Once a file is saved, Gigantum will likely capture the contents of that file on the next sweep (these are triggered by code execution and also Project start and shut-down).

Outputs in Jupyter notebooks can be cleared via the context menu (available via right-click on the output). You can also clear all outputs, and advanced users can set up a git pre-commit hook using an nbstripout package (see here for an example).