cfdm.core.Data.get_calendar

Data.get_calendar(default=ValueError())[source]

Return the calendar.

Parameters:
default: optional

Return the value of the default parameter if the calendar has not been set.

If set to an Exception instance then it will be raised instead.

Returns:
str

The calendar.

Examples

>>> d.set_calendar('360_day')
>>> d.has_calendar()
True
>>> d.get_calendar()
'360_day'
>>> d.del_calendar()
>>> d.has_calendar()
False
>>> d.get_calendar()
ValueError: Can't get non-existent calendar
>>> print(d.get_calendar(None))
None
>>> print(d.del_calendar(None))
None