pandas-market-calendars 4.4.0__py3-none-any.whl → 4.4.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. pandas_market_calendars/__init__.py +38 -38
  2. pandas_market_calendars/calendar_registry.py +57 -53
  3. pandas_market_calendars/calendar_utils.py +262 -261
  4. pandas_market_calendars/calendars/asx.py +66 -66
  5. pandas_market_calendars/calendars/bmf.py +223 -223
  6. pandas_market_calendars/calendars/bse.py +421 -421
  7. pandas_market_calendars/calendars/cboe.py +145 -145
  8. pandas_market_calendars/calendars/cme.py +405 -402
  9. pandas_market_calendars/calendars/cme_globex_agriculture.py +172 -126
  10. pandas_market_calendars/calendars/cme_globex_base.py +119 -119
  11. pandas_market_calendars/calendars/cme_globex_crypto.py +160 -160
  12. pandas_market_calendars/calendars/cme_globex_energy_and_metals.py +216 -216
  13. pandas_market_calendars/calendars/cme_globex_equities.py +123 -123
  14. pandas_market_calendars/calendars/cme_globex_fixed_income.py +136 -136
  15. pandas_market_calendars/calendars/cme_globex_fx.py +101 -101
  16. pandas_market_calendars/calendars/eurex.py +131 -139
  17. pandas_market_calendars/calendars/eurex_fixed_income.py +98 -98
  18. pandas_market_calendars/calendars/hkex.py +429 -426
  19. pandas_market_calendars/calendars/ice.py +81 -81
  20. pandas_market_calendars/calendars/iex.py +112 -112
  21. pandas_market_calendars/calendars/jpx.py +113 -109
  22. pandas_market_calendars/calendars/lse.py +114 -114
  23. pandas_market_calendars/calendars/mirror.py +149 -130
  24. pandas_market_calendars/calendars/nyse.py +1324 -1324
  25. pandas_market_calendars/calendars/ose.py +116 -116
  26. pandas_market_calendars/calendars/sifma.py +354 -354
  27. pandas_market_calendars/calendars/six.py +132 -132
  28. pandas_market_calendars/calendars/sse.py +311 -311
  29. pandas_market_calendars/calendars/tase.py +197 -197
  30. pandas_market_calendars/calendars/tsx.py +181 -181
  31. pandas_market_calendars/holidays/cme.py +385 -385
  32. pandas_market_calendars/holidays/cme_globex.py +214 -214
  33. pandas_market_calendars/holidays/cn.py +1456 -1455
  34. pandas_market_calendars/holidays/jp.py +401 -401
  35. pandas_market_calendars/holidays/jpx_equinox.py +506 -505
  36. pandas_market_calendars/holidays/nyse.py +1531 -1531
  37. pandas_market_calendars/holidays/oz.py +63 -63
  38. pandas_market_calendars/holidays/sifma.py +350 -350
  39. pandas_market_calendars/holidays/us.py +376 -376
  40. pandas_market_calendars/market_calendar.py +922 -895
  41. {pandas_market_calendars-4.4.0.dist-info → pandas_market_calendars-4.4.2.dist-info}/METADATA +8 -7
  42. pandas_market_calendars-4.4.2.dist-info/RECORD +50 -0
  43. {pandas_market_calendars-4.4.0.dist-info → pandas_market_calendars-4.4.2.dist-info}/WHEEL +1 -1
  44. pandas_market_calendars-4.4.0.dist-info/RECORD +0 -50
  45. {pandas_market_calendars-4.4.0.dist-info → pandas_market_calendars-4.4.2.dist-info}/LICENSE +0 -0
  46. {pandas_market_calendars-4.4.0.dist-info → pandas_market_calendars-4.4.2.dist-info}/NOTICE +0 -0
  47. {pandas_market_calendars-4.4.0.dist-info → pandas_market_calendars-4.4.2.dist-info}/top_level.txt +0 -0
@@ -1,505 +1,506 @@
1
- """
2
- Equinox Day is a public holiday in Japan that usually occurs:
3
- (in the Spring) on March 20 or 21,
4
- (in the Autumn) on September 22 or 23,
5
- the date of the equinox in Japan Standard Time.
6
- Due to the necessity of recent astronomical measurements,
7
- the date of the holiday is not officially declared until February of the previous year
8
-
9
- We can't easily compute the equinox for a given year, so we pre-compute a list of those
10
- from the Tokyo exchange inauguration through 2099,
11
- using pyephem (http://rhodesmill.org/pyephem/quick.html#equinoxes-solstices).
12
- For a double check, see: https://aa.usno.navy.mil/data/docs/EarthSeasons.php
13
- """
14
- import pandas as pd
15
- from pandas.tseries.holiday import sunday_to_monday
16
-
17
- vernal_year_to_march_mapping = {
18
- 1875: 21,
19
- 1876: 20,
20
- 1877: 20,
21
- 1878: 21,
22
- 1879: 21,
23
- 1880: 20,
24
- 1881: 20,
25
- 1882: 21,
26
- 1883: 21,
27
- 1884: 20,
28
- 1885: 20,
29
- 1886: 21,
30
- 1887: 21,
31
- 1888: 20,
32
- 1889: 20,
33
- 1890: 21,
34
- 1891: 21,
35
- 1892: 20,
36
- 1893: 20,
37
- 1894: 20,
38
- 1895: 21,
39
- 1896: 20,
40
- 1897: 20,
41
- 1898: 20,
42
- 1899: 21,
43
- 1900: 21,
44
- 1901: 21,
45
- 1902: 21,
46
- 1903: 22,
47
- 1904: 21,
48
- 1905: 21,
49
- 1906: 21,
50
- 1907: 22,
51
- 1908: 21,
52
- 1909: 21,
53
- 1910: 21,
54
- 1911: 22,
55
- 1912: 21,
56
- 1913: 21,
57
- 1914: 21,
58
- 1915: 22,
59
- 1916: 21,
60
- 1917: 21,
61
- 1918: 21,
62
- 1919: 22,
63
- 1920: 21,
64
- 1921: 21,
65
- 1922: 21,
66
- 1923: 22,
67
- 1924: 21,
68
- 1925: 21,
69
- 1926: 21,
70
- 1927: 21,
71
- 1928: 21,
72
- 1929: 21,
73
- 1930: 21,
74
- 1931: 21,
75
- 1932: 21,
76
- 1933: 21,
77
- 1934: 21,
78
- 1935: 21,
79
- 1936: 21,
80
- 1937: 21,
81
- 1938: 21,
82
- 1939: 21,
83
- 1940: 21,
84
- 1941: 21,
85
- 1942: 21,
86
- 1943: 21,
87
- 1944: 21,
88
- 1945: 21,
89
- 1946: 21,
90
- 1947: 21,
91
- 1948: 21,
92
- 1949: 21,
93
- 1950: 21,
94
- 1951: 21,
95
- 1952: 21,
96
- 1953: 21,
97
- 1954: 21,
98
- 1955: 21,
99
- 1956: 21,
100
- 1957: 21,
101
- 1958: 21,
102
- 1959: 21,
103
- 1960: 20,
104
- 1961: 21,
105
- 1962: 21,
106
- 1963: 21,
107
- 1964: 20,
108
- 1965: 21,
109
- 1966: 21,
110
- 1967: 21,
111
- 1968: 20,
112
- 1969: 21,
113
- 1970: 21,
114
- 1971: 21,
115
- 1972: 20,
116
- 1973: 21,
117
- 1974: 21,
118
- 1975: 21,
119
- 1976: 20,
120
- 1977: 21,
121
- 1978: 21,
122
- 1979: 21,
123
- 1980: 20,
124
- 1981: 21,
125
- 1982: 21,
126
- 1983: 21,
127
- 1984: 20,
128
- 1985: 21,
129
- 1986: 21,
130
- 1987: 21,
131
- 1988: 20,
132
- 1989: 21,
133
- 1990: 21,
134
- 1991: 21,
135
- 1992: 20,
136
- 1993: 20,
137
- 1994: 21,
138
- 1995: 21,
139
- 1996: 20,
140
- 1997: 20,
141
- 1998: 21,
142
- 1999: 21,
143
- 2000: 20,
144
- 2001: 20,
145
- 2002: 21,
146
- 2003: 21,
147
- 2004: 20,
148
- 2005: 20,
149
- 2006: 21,
150
- 2007: 21,
151
- 2008: 20,
152
- 2009: 20,
153
- 2010: 21,
154
- 2011: 21,
155
- 2012: 20,
156
- 2013: 20,
157
- 2014: 21,
158
- 2015: 21,
159
- 2016: 20,
160
- 2017: 20,
161
- 2018: 21,
162
- 2019: 21,
163
- 2020: 20,
164
- 2021: 20,
165
- 2022: 21,
166
- 2023: 21,
167
- 2024: 20,
168
- 2025: 20,
169
- 2026: 20,
170
- 2027: 21,
171
- 2028: 20,
172
- 2029: 20,
173
- 2030: 20,
174
- 2031: 21,
175
- 2032: 20,
176
- 2033: 20,
177
- 2034: 20,
178
- 2035: 21,
179
- 2036: 20,
180
- 2037: 20,
181
- 2038: 20,
182
- 2039: 21,
183
- 2040: 20,
184
- 2041: 20,
185
- 2042: 20,
186
- 2043: 21,
187
- 2044: 20,
188
- 2045: 20,
189
- 2046: 20,
190
- 2047: 21,
191
- 2048: 20,
192
- 2049: 20,
193
- 2050: 20,
194
- 2051: 21,
195
- 2052: 20,
196
- 2053: 20,
197
- 2054: 20,
198
- 2055: 21,
199
- 2056: 20,
200
- 2057: 20,
201
- 2058: 20,
202
- 2059: 20,
203
- 2060: 20,
204
- 2061: 20,
205
- 2062: 20,
206
- 2063: 20,
207
- 2064: 20,
208
- 2065: 20,
209
- 2066: 20,
210
- 2067: 20,
211
- 2068: 20,
212
- 2069: 20,
213
- 2070: 20,
214
- 2071: 20,
215
- 2072: 20,
216
- 2073: 20,
217
- 2074: 20,
218
- 2075: 20,
219
- 2076: 20,
220
- 2077: 20,
221
- 2078: 20,
222
- 2079: 20,
223
- 2080: 20,
224
- 2081: 20,
225
- 2082: 20,
226
- 2083: 20,
227
- 2084: 20,
228
- 2085: 20,
229
- 2086: 20,
230
- 2087: 20,
231
- 2088: 20,
232
- 2089: 20,
233
- 2090: 20,
234
- 2091: 20,
235
- 2092: 19,
236
- 2093: 20,
237
- 2094: 20,
238
- 2095: 20,
239
- 2096: 19,
240
- 2097: 20,
241
- 2098: 20,
242
- 2099: 20,
243
- }
244
-
245
- autumnal_year_to_september_mapping = {
246
- 1875: 23,
247
- 1876: 23,
248
- 1877: 23,
249
- 1878: 23,
250
- 1879: 23,
251
- 1880: 23,
252
- 1881: 23,
253
- 1882: 23,
254
- 1883: 23,
255
- 1884: 23,
256
- 1885: 23,
257
- 1886: 23,
258
- 1887: 23,
259
- 1888: 22,
260
- 1889: 23,
261
- 1890: 23,
262
- 1891: 23,
263
- 1892: 22,
264
- 1893: 23,
265
- 1894: 23,
266
- 1895: 23,
267
- 1896: 22,
268
- 1897: 23,
269
- 1898: 23,
270
- 1899: 23,
271
- 1900: 23,
272
- 1901: 24,
273
- 1902: 24,
274
- 1903: 24,
275
- 1904: 23,
276
- 1905: 24,
277
- 1906: 24,
278
- 1907: 24,
279
- 1908: 23,
280
- 1909: 24,
281
- 1910: 24,
282
- 1911: 24,
283
- 1912: 23,
284
- 1913: 24,
285
- 1914: 24,
286
- 1915: 24,
287
- 1916: 23,
288
- 1917: 24,
289
- 1918: 24,
290
- 1919: 24,
291
- 1920: 23,
292
- 1921: 23,
293
- 1922: 24,
294
- 1923: 24,
295
- 1924: 23,
296
- 1925: 23,
297
- 1926: 24,
298
- 1927: 24,
299
- 1928: 23,
300
- 1929: 23,
301
- 1930: 24,
302
- 1931: 24,
303
- 1932: 23,
304
- 1933: 23,
305
- 1934: 24,
306
- 1935: 24,
307
- 1936: 23,
308
- 1937: 23,
309
- 1938: 24,
310
- 1939: 24,
311
- 1940: 23,
312
- 1941: 23,
313
- 1942: 24,
314
- 1943: 24,
315
- 1944: 23,
316
- 1945: 23,
317
- 1946: 24,
318
- 1947: 24,
319
- 1948: 23,
320
- 1949: 23,
321
- 1950: 23,
322
- 1951: 24,
323
- 1952: 23,
324
- 1953: 23,
325
- 1954: 23,
326
- 1955: 24,
327
- 1956: 23,
328
- 1957: 23,
329
- 1958: 23,
330
- 1959: 24,
331
- 1960: 23,
332
- 1961: 23,
333
- 1962: 23,
334
- 1963: 24,
335
- 1964: 23,
336
- 1965: 23,
337
- 1966: 23,
338
- 1967: 24,
339
- 1968: 23,
340
- 1969: 23,
341
- 1970: 23,
342
- 1971: 24,
343
- 1972: 23,
344
- 1973: 23,
345
- 1974: 23,
346
- 1975: 24,
347
- 1976: 23,
348
- 1977: 23,
349
- 1978: 23,
350
- 1979: 24,
351
- 1980: 23,
352
- 1981: 23,
353
- 1982: 23,
354
- 1983: 23,
355
- 1984: 23,
356
- 1985: 23,
357
- 1986: 23,
358
- 1987: 23,
359
- 1988: 23,
360
- 1989: 23,
361
- 1990: 23,
362
- 1991: 23,
363
- 1992: 23,
364
- 1993: 23,
365
- 1994: 23,
366
- 1995: 23,
367
- 1996: 23,
368
- 1997: 23,
369
- 1998: 23,
370
- 1999: 23,
371
- 2000: 23,
372
- 2001: 23,
373
- 2002: 23,
374
- 2003: 23,
375
- 2004: 23,
376
- 2005: 23,
377
- 2006: 23,
378
- 2007: 23,
379
- 2008: 23,
380
- 2009: 23,
381
- 2010: 23,
382
- 2011: 23,
383
- 2012: 22,
384
- 2013: 23,
385
- 2014: 23,
386
- 2015: 23,
387
- 2016: 22,
388
- 2017: 23,
389
- 2018: 23,
390
- 2019: 23,
391
- 2020: 22,
392
- 2021: 23,
393
- 2022: 23,
394
- 2023: 23,
395
- 2024: 22,
396
- 2025: 23,
397
- 2026: 23,
398
- 2027: 23,
399
- 2028: 22,
400
- 2029: 23,
401
- 2030: 23,
402
- 2031: 23,
403
- 2032: 22,
404
- 2033: 23,
405
- 2034: 23,
406
- 2035: 23,
407
- 2036: 22,
408
- 2037: 23,
409
- 2038: 23,
410
- 2039: 23,
411
- 2040: 22,
412
- 2041: 23,
413
- 2042: 23,
414
- 2043: 23,
415
- 2044: 22,
416
- 2045: 22,
417
- 2046: 23,
418
- 2047: 23,
419
- 2048: 22,
420
- 2049: 22,
421
- 2050: 23,
422
- 2051: 23,
423
- 2052: 22,
424
- 2053: 22,
425
- 2054: 23,
426
- 2055: 23,
427
- 2056: 22,
428
- 2057: 22,
429
- 2058: 23,
430
- 2059: 23,
431
- 2060: 22,
432
- 2061: 22,
433
- 2062: 23,
434
- 2063: 23,
435
- 2064: 22,
436
- 2065: 22,
437
- 2066: 23,
438
- 2067: 23,
439
- 2068: 22,
440
- 2069: 22,
441
- 2070: 23,
442
- 2071: 23,
443
- 2072: 22,
444
- 2073: 22,
445
- 2074: 23,
446
- 2075: 23,
447
- 2076: 22,
448
- 2077: 22,
449
- 2078: 22,
450
- 2079: 23,
451
- 2080: 22,
452
- 2081: 22,
453
- 2082: 22,
454
- 2083: 23,
455
- 2084: 22,
456
- 2085: 22,
457
- 2086: 22,
458
- 2087: 23,
459
- 2088: 22,
460
- 2089: 22,
461
- 2090: 22,
462
- 2091: 23,
463
- 2092: 22,
464
- 2093: 22,
465
- 2094: 22,
466
- 2095: 23,
467
- 2096: 22,
468
- 2097: 22,
469
- 2098: 22,
470
- 2099: 23,
471
- }
472
-
473
-
474
- def vernal_equinox_for_year(year):
475
- day = vernal_year_to_march_mapping.get(year, 20)
476
- return pd.Timestamp(year, 3, day)
477
-
478
-
479
- def vernal_equinox(dt):
480
- year = dt.year
481
- equinox = vernal_equinox_for_year(year)
482
- return sunday_to_monday(equinox) if year >= 1973 else equinox
483
-
484
-
485
- def autumnal_equinox_for_year(year):
486
- day = autumnal_year_to_september_mapping.get(year, 23)
487
- return pd.Timestamp(year, 9, day)
488
-
489
-
490
- def autumnal_equinox(dt):
491
- year = dt.year
492
- equinox = autumnal_equinox_for_year(year)
493
- return sunday_to_monday(equinox) if year >= 1973 else equinox
494
-
495
-
496
- def autumnal_citizen_dates(start=2003, end=2099):
497
- dates = []
498
- for year in range(start, end):
499
- respect_for_aged = pd.Timestamp(year, 9, 1) + pd.offsets.WeekOfMonth(
500
- week=2, weekday=0
501
- )
502
- equinox = autumnal_equinox_for_year(year)
503
- if (equinox - respect_for_aged).days == 2:
504
- dates.append(respect_for_aged + pd.offsets.Day())
505
- return dates
1
+ """
2
+ Equinox Day is a public holiday in Japan that usually occurs:
3
+ (in the Spring) on March 20 or 21,
4
+ (in the Autumn) on September 22 or 23,
5
+ the date of the equinox in Japan Standard Time.
6
+ Due to the necessity of recent astronomical measurements,
7
+ the date of the holiday is not officially declared until February of the previous year
8
+
9
+ We can't easily compute the equinox for a given year, so we pre-compute a list of those
10
+ from the Tokyo exchange inauguration through 2099,
11
+ using pyephem (http://rhodesmill.org/pyephem/quick.html#equinoxes-solstices).
12
+ For a double check, see: https://aa.usno.navy.mil/data/docs/EarthSeasons.php
13
+ """
14
+
15
+ import pandas as pd
16
+ from pandas.tseries.holiday import sunday_to_monday
17
+
18
+ vernal_year_to_march_mapping = {
19
+ 1875: 21,
20
+ 1876: 20,
21
+ 1877: 20,
22
+ 1878: 21,
23
+ 1879: 21,
24
+ 1880: 20,
25
+ 1881: 20,
26
+ 1882: 21,
27
+ 1883: 21,
28
+ 1884: 20,
29
+ 1885: 20,
30
+ 1886: 21,
31
+ 1887: 21,
32
+ 1888: 20,
33
+ 1889: 20,
34
+ 1890: 21,
35
+ 1891: 21,
36
+ 1892: 20,
37
+ 1893: 20,
38
+ 1894: 20,
39
+ 1895: 21,
40
+ 1896: 20,
41
+ 1897: 20,
42
+ 1898: 20,
43
+ 1899: 21,
44
+ 1900: 21,
45
+ 1901: 21,
46
+ 1902: 21,
47
+ 1903: 22,
48
+ 1904: 21,
49
+ 1905: 21,
50
+ 1906: 21,
51
+ 1907: 22,
52
+ 1908: 21,
53
+ 1909: 21,
54
+ 1910: 21,
55
+ 1911: 22,
56
+ 1912: 21,
57
+ 1913: 21,
58
+ 1914: 21,
59
+ 1915: 22,
60
+ 1916: 21,
61
+ 1917: 21,
62
+ 1918: 21,
63
+ 1919: 22,
64
+ 1920: 21,
65
+ 1921: 21,
66
+ 1922: 21,
67
+ 1923: 22,
68
+ 1924: 21,
69
+ 1925: 21,
70
+ 1926: 21,
71
+ 1927: 21,
72
+ 1928: 21,
73
+ 1929: 21,
74
+ 1930: 21,
75
+ 1931: 21,
76
+ 1932: 21,
77
+ 1933: 21,
78
+ 1934: 21,
79
+ 1935: 21,
80
+ 1936: 21,
81
+ 1937: 21,
82
+ 1938: 21,
83
+ 1939: 21,
84
+ 1940: 21,
85
+ 1941: 21,
86
+ 1942: 21,
87
+ 1943: 21,
88
+ 1944: 21,
89
+ 1945: 21,
90
+ 1946: 21,
91
+ 1947: 21,
92
+ 1948: 21,
93
+ 1949: 21,
94
+ 1950: 21,
95
+ 1951: 21,
96
+ 1952: 21,
97
+ 1953: 21,
98
+ 1954: 21,
99
+ 1955: 21,
100
+ 1956: 21,
101
+ 1957: 21,
102
+ 1958: 21,
103
+ 1959: 21,
104
+ 1960: 20,
105
+ 1961: 21,
106
+ 1962: 21,
107
+ 1963: 21,
108
+ 1964: 20,
109
+ 1965: 21,
110
+ 1966: 21,
111
+ 1967: 21,
112
+ 1968: 20,
113
+ 1969: 21,
114
+ 1970: 21,
115
+ 1971: 21,
116
+ 1972: 20,
117
+ 1973: 21,
118
+ 1974: 21,
119
+ 1975: 21,
120
+ 1976: 20,
121
+ 1977: 21,
122
+ 1978: 21,
123
+ 1979: 21,
124
+ 1980: 20,
125
+ 1981: 21,
126
+ 1982: 21,
127
+ 1983: 21,
128
+ 1984: 20,
129
+ 1985: 21,
130
+ 1986: 21,
131
+ 1987: 21,
132
+ 1988: 20,
133
+ 1989: 21,
134
+ 1990: 21,
135
+ 1991: 21,
136
+ 1992: 20,
137
+ 1993: 20,
138
+ 1994: 21,
139
+ 1995: 21,
140
+ 1996: 20,
141
+ 1997: 20,
142
+ 1998: 21,
143
+ 1999: 21,
144
+ 2000: 20,
145
+ 2001: 20,
146
+ 2002: 21,
147
+ 2003: 21,
148
+ 2004: 20,
149
+ 2005: 20,
150
+ 2006: 21,
151
+ 2007: 21,
152
+ 2008: 20,
153
+ 2009: 20,
154
+ 2010: 21,
155
+ 2011: 21,
156
+ 2012: 20,
157
+ 2013: 20,
158
+ 2014: 21,
159
+ 2015: 21,
160
+ 2016: 20,
161
+ 2017: 20,
162
+ 2018: 21,
163
+ 2019: 21,
164
+ 2020: 20,
165
+ 2021: 20,
166
+ 2022: 21,
167
+ 2023: 21,
168
+ 2024: 20,
169
+ 2025: 20,
170
+ 2026: 20,
171
+ 2027: 21,
172
+ 2028: 20,
173
+ 2029: 20,
174
+ 2030: 20,
175
+ 2031: 21,
176
+ 2032: 20,
177
+ 2033: 20,
178
+ 2034: 20,
179
+ 2035: 21,
180
+ 2036: 20,
181
+ 2037: 20,
182
+ 2038: 20,
183
+ 2039: 21,
184
+ 2040: 20,
185
+ 2041: 20,
186
+ 2042: 20,
187
+ 2043: 21,
188
+ 2044: 20,
189
+ 2045: 20,
190
+ 2046: 20,
191
+ 2047: 21,
192
+ 2048: 20,
193
+ 2049: 20,
194
+ 2050: 20,
195
+ 2051: 21,
196
+ 2052: 20,
197
+ 2053: 20,
198
+ 2054: 20,
199
+ 2055: 21,
200
+ 2056: 20,
201
+ 2057: 20,
202
+ 2058: 20,
203
+ 2059: 20,
204
+ 2060: 20,
205
+ 2061: 20,
206
+ 2062: 20,
207
+ 2063: 20,
208
+ 2064: 20,
209
+ 2065: 20,
210
+ 2066: 20,
211
+ 2067: 20,
212
+ 2068: 20,
213
+ 2069: 20,
214
+ 2070: 20,
215
+ 2071: 20,
216
+ 2072: 20,
217
+ 2073: 20,
218
+ 2074: 20,
219
+ 2075: 20,
220
+ 2076: 20,
221
+ 2077: 20,
222
+ 2078: 20,
223
+ 2079: 20,
224
+ 2080: 20,
225
+ 2081: 20,
226
+ 2082: 20,
227
+ 2083: 20,
228
+ 2084: 20,
229
+ 2085: 20,
230
+ 2086: 20,
231
+ 2087: 20,
232
+ 2088: 20,
233
+ 2089: 20,
234
+ 2090: 20,
235
+ 2091: 20,
236
+ 2092: 19,
237
+ 2093: 20,
238
+ 2094: 20,
239
+ 2095: 20,
240
+ 2096: 19,
241
+ 2097: 20,
242
+ 2098: 20,
243
+ 2099: 20,
244
+ }
245
+
246
+ autumnal_year_to_september_mapping = {
247
+ 1875: 23,
248
+ 1876: 23,
249
+ 1877: 23,
250
+ 1878: 23,
251
+ 1879: 23,
252
+ 1880: 23,
253
+ 1881: 23,
254
+ 1882: 23,
255
+ 1883: 23,
256
+ 1884: 23,
257
+ 1885: 23,
258
+ 1886: 23,
259
+ 1887: 23,
260
+ 1888: 22,
261
+ 1889: 23,
262
+ 1890: 23,
263
+ 1891: 23,
264
+ 1892: 22,
265
+ 1893: 23,
266
+ 1894: 23,
267
+ 1895: 23,
268
+ 1896: 22,
269
+ 1897: 23,
270
+ 1898: 23,
271
+ 1899: 23,
272
+ 1900: 23,
273
+ 1901: 24,
274
+ 1902: 24,
275
+ 1903: 24,
276
+ 1904: 23,
277
+ 1905: 24,
278
+ 1906: 24,
279
+ 1907: 24,
280
+ 1908: 23,
281
+ 1909: 24,
282
+ 1910: 24,
283
+ 1911: 24,
284
+ 1912: 23,
285
+ 1913: 24,
286
+ 1914: 24,
287
+ 1915: 24,
288
+ 1916: 23,
289
+ 1917: 24,
290
+ 1918: 24,
291
+ 1919: 24,
292
+ 1920: 23,
293
+ 1921: 23,
294
+ 1922: 24,
295
+ 1923: 24,
296
+ 1924: 23,
297
+ 1925: 23,
298
+ 1926: 24,
299
+ 1927: 24,
300
+ 1928: 23,
301
+ 1929: 23,
302
+ 1930: 24,
303
+ 1931: 24,
304
+ 1932: 23,
305
+ 1933: 23,
306
+ 1934: 24,
307
+ 1935: 24,
308
+ 1936: 23,
309
+ 1937: 23,
310
+ 1938: 24,
311
+ 1939: 24,
312
+ 1940: 23,
313
+ 1941: 23,
314
+ 1942: 24,
315
+ 1943: 24,
316
+ 1944: 23,
317
+ 1945: 23,
318
+ 1946: 24,
319
+ 1947: 24,
320
+ 1948: 23,
321
+ 1949: 23,
322
+ 1950: 23,
323
+ 1951: 24,
324
+ 1952: 23,
325
+ 1953: 23,
326
+ 1954: 23,
327
+ 1955: 24,
328
+ 1956: 23,
329
+ 1957: 23,
330
+ 1958: 23,
331
+ 1959: 24,
332
+ 1960: 23,
333
+ 1961: 23,
334
+ 1962: 23,
335
+ 1963: 24,
336
+ 1964: 23,
337
+ 1965: 23,
338
+ 1966: 23,
339
+ 1967: 24,
340
+ 1968: 23,
341
+ 1969: 23,
342
+ 1970: 23,
343
+ 1971: 24,
344
+ 1972: 23,
345
+ 1973: 23,
346
+ 1974: 23,
347
+ 1975: 24,
348
+ 1976: 23,
349
+ 1977: 23,
350
+ 1978: 23,
351
+ 1979: 24,
352
+ 1980: 23,
353
+ 1981: 23,
354
+ 1982: 23,
355
+ 1983: 23,
356
+ 1984: 23,
357
+ 1985: 23,
358
+ 1986: 23,
359
+ 1987: 23,
360
+ 1988: 23,
361
+ 1989: 23,
362
+ 1990: 23,
363
+ 1991: 23,
364
+ 1992: 23,
365
+ 1993: 23,
366
+ 1994: 23,
367
+ 1995: 23,
368
+ 1996: 23,
369
+ 1997: 23,
370
+ 1998: 23,
371
+ 1999: 23,
372
+ 2000: 23,
373
+ 2001: 23,
374
+ 2002: 23,
375
+ 2003: 23,
376
+ 2004: 23,
377
+ 2005: 23,
378
+ 2006: 23,
379
+ 2007: 23,
380
+ 2008: 23,
381
+ 2009: 23,
382
+ 2010: 23,
383
+ 2011: 23,
384
+ 2012: 22,
385
+ 2013: 23,
386
+ 2014: 23,
387
+ 2015: 23,
388
+ 2016: 22,
389
+ 2017: 23,
390
+ 2018: 23,
391
+ 2019: 23,
392
+ 2020: 22,
393
+ 2021: 23,
394
+ 2022: 23,
395
+ 2023: 23,
396
+ 2024: 22,
397
+ 2025: 23,
398
+ 2026: 23,
399
+ 2027: 23,
400
+ 2028: 22,
401
+ 2029: 23,
402
+ 2030: 23,
403
+ 2031: 23,
404
+ 2032: 22,
405
+ 2033: 23,
406
+ 2034: 23,
407
+ 2035: 23,
408
+ 2036: 22,
409
+ 2037: 23,
410
+ 2038: 23,
411
+ 2039: 23,
412
+ 2040: 22,
413
+ 2041: 23,
414
+ 2042: 23,
415
+ 2043: 23,
416
+ 2044: 22,
417
+ 2045: 22,
418
+ 2046: 23,
419
+ 2047: 23,
420
+ 2048: 22,
421
+ 2049: 22,
422
+ 2050: 23,
423
+ 2051: 23,
424
+ 2052: 22,
425
+ 2053: 22,
426
+ 2054: 23,
427
+ 2055: 23,
428
+ 2056: 22,
429
+ 2057: 22,
430
+ 2058: 23,
431
+ 2059: 23,
432
+ 2060: 22,
433
+ 2061: 22,
434
+ 2062: 23,
435
+ 2063: 23,
436
+ 2064: 22,
437
+ 2065: 22,
438
+ 2066: 23,
439
+ 2067: 23,
440
+ 2068: 22,
441
+ 2069: 22,
442
+ 2070: 23,
443
+ 2071: 23,
444
+ 2072: 22,
445
+ 2073: 22,
446
+ 2074: 23,
447
+ 2075: 23,
448
+ 2076: 22,
449
+ 2077: 22,
450
+ 2078: 22,
451
+ 2079: 23,
452
+ 2080: 22,
453
+ 2081: 22,
454
+ 2082: 22,
455
+ 2083: 23,
456
+ 2084: 22,
457
+ 2085: 22,
458
+ 2086: 22,
459
+ 2087: 23,
460
+ 2088: 22,
461
+ 2089: 22,
462
+ 2090: 22,
463
+ 2091: 23,
464
+ 2092: 22,
465
+ 2093: 22,
466
+ 2094: 22,
467
+ 2095: 23,
468
+ 2096: 22,
469
+ 2097: 22,
470
+ 2098: 22,
471
+ 2099: 23,
472
+ }
473
+
474
+
475
+ def vernal_equinox_for_year(year):
476
+ day = vernal_year_to_march_mapping.get(year, 20)
477
+ return pd.Timestamp(year, 3, day)
478
+
479
+
480
+ def vernal_equinox(dt):
481
+ year = dt.year
482
+ equinox = vernal_equinox_for_year(year)
483
+ return sunday_to_monday(equinox) if year >= 1973 else equinox
484
+
485
+
486
+ def autumnal_equinox_for_year(year):
487
+ day = autumnal_year_to_september_mapping.get(year, 23)
488
+ return pd.Timestamp(year, 9, day)
489
+
490
+
491
+ def autumnal_equinox(dt):
492
+ year = dt.year
493
+ equinox = autumnal_equinox_for_year(year)
494
+ return sunday_to_monday(equinox) if year >= 1973 else equinox
495
+
496
+
497
+ def autumnal_citizen_dates(start=2003, end=2099):
498
+ dates = []
499
+ for year in range(start, end):
500
+ respect_for_aged = pd.Timestamp(year, 9, 1) + pd.offsets.WeekOfMonth(
501
+ week=2, weekday=0
502
+ )
503
+ equinox = autumnal_equinox_for_year(year)
504
+ if (equinox - respect_for_aged).days == 2:
505
+ dates.append(respect_for_aged + pd.offsets.Day())
506
+ return dates