Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/source/spec/calendars/aud_nsw.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.. _spec-aud-nsw:

*************
NSW Calendar
*************

This calendar extends the *'SYD'* calendar to include the NSW Bank Holiday (first Monday of August)
and the NSW Labour Day (first Monday of October), which are used with currency settlements.

.. ipython:: python
:suppress:

from rateslib import *

.. ipython:: python

get_calendar("nsw").holidays
1 change: 1 addition & 0 deletions python/rateslib/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def __init__(self) -> None:
"tro": NamedCal("tro"),
"tyo": NamedCal("tyo"),
"syd": NamedCal("syd"),
"nsw": NamedCal("nsw"),
"wlg": NamedCal("wlg"),
"mum": NamedCal("mum"),
}
Expand Down
2 changes: 1 addition & 1 deletion python/tests/scheduling/test_calendars.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ def test_fed_sunday_to_monday():


def test_syd_nsw_holidays():
cal = get_calendar("syd")
cal = get_calendar("nsw")
assert not cal.is_bus_day(dt(1970, 8, 3))
assert not cal.is_bus_day(dt(1970, 10, 5))

Expand Down
4 changes: 4 additions & 0 deletions rust/scheduling/calendars/named/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pub mod bus;
pub mod fed;
pub mod ldn;
pub mod mum;
pub mod nsw;
pub mod nyc;
pub mod osl;
pub mod stk;
Expand Down Expand Up @@ -35,6 +36,7 @@ pub(crate) fn get_weekmask_by_name(name: &str) -> Result<Vec<u8>, PyErr> {
("tro", tro::WEEKMASK),
("tyo", tyo::WEEKMASK),
("syd", syd::WEEKMASK),
("nsw", nsw::WEEKMASK),
("wlg", wlg::WEEKMASK),
("mum", mum::WEEKMASK),
]);
Expand All @@ -61,6 +63,7 @@ pub(crate) fn get_holidays_by_name(name: &str) -> Result<Vec<NaiveDateTime>, PyE
("tro", tro::HOLIDAYS),
("tyo", tyo::HOLIDAYS),
("syd", syd::HOLIDAYS),
("nsw", nsw::HOLIDAYS),
("wlg", wlg::HOLIDAYS),
("mum", mum::HOLIDAYS),
]);
Expand Down Expand Up @@ -90,6 +93,7 @@ pub(crate) fn get_holidays_by_name(name: &str) -> Result<Vec<NaiveDateTime>, PyE
// ("tro", tro::RULES),
// ("tyo", tyo::RULES),
// ("syd", syd::RULES),
// ("nsw", nsw::RULES),
// ("wlg", wlg::RULES),
// ("mum", mum::RULES),
// ]);
Expand Down
Loading
Loading