Skip to content

Commit a55e51a

Browse files
authored
ENH: add calendar nsw to extend syd. (#192) (#1113)
1 parent 573e318 commit a55e51a

File tree

8 files changed

+2390
-465
lines changed

8 files changed

+2390
-465
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.. _spec-aud-nsw:
2+
3+
*************
4+
NSW Calendar
5+
*************
6+
7+
This calendar extends the *'SYD'* calendar to include the NSW Bank Holiday (first Monday of August)
8+
and the NSW Labour Day (first Monday of October), which are used with currency settlements.
9+
10+
.. ipython:: python
11+
:suppress:
12+
13+
from rateslib import *
14+
15+
.. ipython:: python
16+
17+
get_calendar("nsw").holidays

python/rateslib/default.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def __init__(self) -> None:
5151
"tro": NamedCal("tro"),
5252
"tyo": NamedCal("tyo"),
5353
"syd": NamedCal("syd"),
54+
"nsw": NamedCal("nsw"),
5455
"wlg": NamedCal("wlg"),
5556
"mum": NamedCal("mum"),
5657
}

python/tests/scheduling/test_calendars.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ def test_fed_sunday_to_monday():
678678

679679

680680
def test_syd_nsw_holidays():
681-
cal = get_calendar("syd")
681+
cal = get_calendar("nsw")
682682
assert not cal.is_bus_day(dt(1970, 8, 3))
683683
assert not cal.is_bus_day(dt(1970, 10, 5))
684684

rust/scheduling/calendars/named/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ pub mod bus;
66
pub mod fed;
77
pub mod ldn;
88
pub mod mum;
9+
pub mod nsw;
910
pub mod nyc;
1011
pub mod osl;
1112
pub mod stk;
@@ -35,6 +36,7 @@ pub(crate) fn get_weekmask_by_name(name: &str) -> Result<Vec<u8>, PyErr> {
3536
("tro", tro::WEEKMASK),
3637
("tyo", tyo::WEEKMASK),
3738
("syd", syd::WEEKMASK),
39+
("nsw", nsw::WEEKMASK),
3840
("wlg", wlg::WEEKMASK),
3941
("mum", mum::WEEKMASK),
4042
]);
@@ -61,6 +63,7 @@ pub(crate) fn get_holidays_by_name(name: &str) -> Result<Vec<NaiveDateTime>, PyE
6163
("tro", tro::HOLIDAYS),
6264
("tyo", tyo::HOLIDAYS),
6365
("syd", syd::HOLIDAYS),
66+
("nsw", nsw::HOLIDAYS),
6467
("wlg", wlg::HOLIDAYS),
6568
("mum", mum::HOLIDAYS),
6669
]);
@@ -90,6 +93,7 @@ pub(crate) fn get_holidays_by_name(name: &str) -> Result<Vec<NaiveDateTime>, PyE
9093
// ("tro", tro::RULES),
9194
// ("tyo", tyo::RULES),
9295
// ("syd", syd::RULES),
96+
// ("nsw", nsw::RULES),
9397
// ("wlg", wlg::RULES),
9498
// ("mum", mum::RULES),
9599
// ]);

0 commit comments

Comments
 (0)