cf.seasons

cf.seasons(n=4, start=12)[source]

A customisable list of Query objects for “seasons in a year” conditions.

Note that any date-time that lies within a particular season will satisfy that query.

New in version 1.0.

TODO

See also

cf.mam, cf.jja, cf.son, cf.djf

Parameters
n: int, optional

The number of seasons in the year. By default there are four seasons.

start: int, optional

The start month of the first season of the year. By default this is 12 (December).

Returns
list of Query

The query objects.

Examples

>>> cf.seasons()
[<CF Query: month[(ge 12) | (le 2)]>,
 <CF Query: month(wi (3, 5))>,
 <CF Query: month(wi (6, 8))>,
 <CF Query: month(wi (9, 11))>]
>>> cf.seasons(4, 1)
[<CF Query: month(wi (1, 3))>,
 <CF Query: month(wi (4, 6))>,
 <CF Query: month(wi (7, 9))>,
 <CF Query: month(wi (10, 12))>]
>>> cf.seasons(3, 6)
[<CF Query: month(wi (6, 9))>,
 <CF Query: month[(ge 10) | (le 1)]>,
 <CF Query: month(wi (2, 5))>]
>>> cf.seasons(3)
[<CF Query: month[(ge 12) | (le 3)]>,
 <CF Query: month(wi (4, 7))>,
 <CF Query: month(wi (8, 11))>]
>>> cf.seasons(3, 6)
[<CF Query: month(wi (6, 9))>,
 <CF Query: month[(ge 10) | (le 1)]>,
 <CF Query: month(wi (2, 5))>]
>>> cf.seasons(12)
[<CF Query: month(eq 12)>,
 <CF Query: month(eq 1)>,
 <CF Query: month(eq 2)>,
 <CF Query: month(eq 3)>,
 <CF Query: month(eq 4)>,
 <CF Query: month(eq 5)>,
 <CF Query: month(eq 6)>,
 <CF Query: month(eq 7)>,
 <CF Query: month(eq 8)>,
 <CF Query: month(eq 9)>,
 <CF Query: month(eq 10)>,
 <CF Query: month(eq 11)>]
>>> cf.seasons(1, 4)
[<CF Query: month[(ge 4) | (le 3)]>]