set_display_options#

nominal.core.set_display_options(*, style=None, timezone=None, time_format=None, time_precision=None, show_link=None, fetch_details=None, collapse_threshold=None, max_items=None, fetch_timeout=None, show_graph=None, graph_max_nodes=None)#

Change how Nominal resources display in notebooks.

Options left out keep their current values. Called on its own, the change lasts for the rest of the Python process. Used in a with block, it lasts until the block ends.

Parameters:
  • style (Literal['html', 'text'] | None)

    "html" shows resources as formatted cards. "text" shows their plain repr.

  • timezone (str | None)

    Time zone for timestamps: "UTC", "local", or an IANA name such as "Europe/Berlin".

  • time_format (Literal['iso', 'readable'] | None)

    "iso" for ISO 8601, or "readable" for a space and the time zone’s name.

  • time_precision (Literal['s', 'ms', 'us', 'ns'] | None)

    The finest unit timestamps show: "s", "ms", "us" or "ns".

  • show_link (bool | None)

    Whether cards link resources to their pages in the Nominal app.

  • fetch_details (bool | None)

    Whether cards load related resources and channel statistics from Nominal.

  • collapse_threshold (int | None)

    Sections with more items than this start collapsed.

  • max_items (int | None)

    The most items a section lists.

  • fetch_timeout (float | None)

    Seconds a card waits for what it loads from Nominal, in total.

  • show_graph (bool | None)

    Whether cards draw a diagram of the resource and the resources around it.

  • graph_max_nodes (int | None)

    The most nodes a diagram draws. The card’s own node and one node of each group of related resources always show, so a cap below one more than the number of groups is exceeded.

Returns:

A context manager that restores the previous options when its with block ends.

Raises:

ValueError – If an option has an invalid value, such as an unknown time zone.

Return type:

AbstractContextManager[DisplayOptions]

Example

from nominal.core import set_display_options

set_display_options(timezone="America/Los_Angeles", time_precision="ms")

with set_display_options(fetch_details=False):
    run  # shows only the run's own fields