pandas-market-calendars 4.4.2__py3-none-any.whl → 4.5.1__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 (46) hide show
  1. pandas_market_calendars/__init__.py +38 -38
  2. pandas_market_calendars/calendar_registry.py +57 -57
  3. pandas_market_calendars/calendar_utils.py +262 -262
  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 -405
  9. pandas_market_calendars/calendars/cme_globex_agriculture.py +172 -172
  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 -131
  17. pandas_market_calendars/calendars/eurex_fixed_income.py +98 -98
  18. pandas_market_calendars/calendars/hkex.py +429 -429
  19. pandas_market_calendars/calendars/ice.py +81 -81
  20. pandas_market_calendars/calendars/iex.py +112 -112
  21. pandas_market_calendars/calendars/lse.py +114 -114
  22. pandas_market_calendars/calendars/mirror.py +149 -149
  23. pandas_market_calendars/calendars/nyse.py +3 -0
  24. pandas_market_calendars/calendars/ose.py +116 -116
  25. pandas_market_calendars/calendars/sifma.py +354 -354
  26. pandas_market_calendars/calendars/six.py +132 -132
  27. pandas_market_calendars/calendars/sse.py +1 -1
  28. pandas_market_calendars/calendars/tase.py +197 -197
  29. pandas_market_calendars/calendars/tsx.py +181 -181
  30. pandas_market_calendars/holidays/cme.py +385 -385
  31. pandas_market_calendars/holidays/cme_globex.py +214 -214
  32. pandas_market_calendars/holidays/cn.py +20 -0
  33. pandas_market_calendars/holidays/jp.py +401 -401
  34. pandas_market_calendars/holidays/jpx_equinox.py +506 -506
  35. pandas_market_calendars/holidays/nyse.py +5 -0
  36. pandas_market_calendars/holidays/oz.py +63 -63
  37. pandas_market_calendars/holidays/sifma.py +350 -350
  38. pandas_market_calendars/holidays/us.py +376 -376
  39. pandas_market_calendars/market_calendar.py +20 -1
  40. {pandas_market_calendars-4.4.2.dist-info → pandas_market_calendars-4.5.1.dist-info}/METADATA +1 -1
  41. pandas_market_calendars-4.5.1.dist-info/RECORD +50 -0
  42. {pandas_market_calendars-4.4.2.dist-info → pandas_market_calendars-4.5.1.dist-info}/WHEEL +1 -1
  43. pandas_market_calendars-4.4.2.dist-info/RECORD +0 -50
  44. {pandas_market_calendars-4.4.2.dist-info → pandas_market_calendars-4.5.1.dist-info}/LICENSE +0 -0
  45. {pandas_market_calendars-4.4.2.dist-info → pandas_market_calendars-4.5.1.dist-info}/NOTICE +0 -0
  46. {pandas_market_calendars-4.4.2.dist-info → pandas_market_calendars-4.5.1.dist-info}/top_level.txt +0 -0
@@ -1,506 +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
-
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
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