Skip to main content
Version: Python

set_calendar

The set_calendar method sets the default calendar. The default calendar can also be set with the Calendar.default configuration property.

Syntax

set_calendar(name: str) -> None

Parameters

ParameterTypeDescription
namestr

The name of the calendar.

Returns

None.

Examples

The following example sets the default calendar to USNYSE_EXAMPLE.

from deephaven.calendar import set_calendar

set_calendar("USNYSE_EXAMPLE")

The default calendar can also be set via the Calendar.default configuration property. The following docker-compose.yml file adds this configuration property to Deephaven's base Python YAML file:

services:
deephaven:
image: ghcr.io/deephaven/server:${VERSION:-latest}
ports:
- '${DEEPHAVEN_PORT:-10000}:10000'
volumes:
- ./data:/data
environment:
- START_OPTS=-Xmx4g -DCalendar.default="USNYSE_EXAMPLE"

For pip-installed Deephaven, the equivalent is as follows:

from deephaven_server import Server

s = Server(
port=10000, jvm_args=["-Xmx4g", "-DCalendar.default=`USNYSE_EXAMPLE`"]
).start()