MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _create_rrule

Method _create_rrule

lib/matplotlib/dates.py:1163–1185  ·  view source on GitHub ↗
(self, vmin, vmax)

Source from the content-addressed store, hash-verified

1161 return self.raise_if_exceeds(date2num(dates))
1162
1163 def _create_rrule(self, vmin, vmax):
1164 # set appropriate rrule dtstart and until and return
1165 # start and end
1166 delta = relativedelta(vmax, vmin)
1167
1168 # We need to cap at the endpoints of valid datetime
1169 try:
1170 start = vmin - delta
1171 except (ValueError, OverflowError):
1172 # cap
1173 start = datetime.datetime(1, 1, 1, 0, 0, 0,
1174 tzinfo=datetime.timezone.utc)
1175
1176 try:
1177 stop = vmax + delta
1178 except (ValueError, OverflowError):
1179 # cap
1180 stop = datetime.datetime(9999, 12, 31, 23, 59, 59,
1181 tzinfo=datetime.timezone.utc)
1182
1183 self.rule.set(dtstart=start, until=stop)
1184
1185 return vmin, vmax
1186
1187 def _get_unit(self):
1188 # docstring inherited

Callers 1

tick_valuesMethod · 0.95

Calls 1

setMethod · 0.45

Tested by

no test coverage detected