Comments (8)
Hi @ValueRaider.
XSES and some other calendars rely on hardcoded holidays. If such a calendar is created with an end date beyond the date to which holidays have been included then this error is necessarily raised.
It's not a bug, just requires any user who wants the calendar to end later to offer a PR adding holidays, in this case for 2024.
Users tend to offer up these PRs towards the end of the each year.
For now, the following works:
cal = xcals.get_calendar("XSES", start="2023-01-01", end="2023-12-31")
from exchange_calendars.
I don't even see 2023 for "XSES" - how can it be fixed?
cal = xcals.get_calendar("XSES", start="2023-01-01", end="2023-12-31")
Traceback (most recent call last):
File "C:\ProgramData\mambaforge\envs\py310\lib\site-packages\IPython\core\interactiveshell.py", line 3460, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-9-57e402b3d4ed>", line 1, in <module>
cal = xcals.get_calendar("XSES", start="2023-01-01", end="2023-12-31")
File "C:\ProgramData\mambaforge\envs\py310\lib\site-packages\exchange_calendars\calendar_utils.py", line 291, in get_calendar
return cached if cached is not None else self._fabricate(name, **kwargs)
File "C:\ProgramData\mambaforge\envs\py310\lib\site-packages\exchange_calendars\calendar_utils.py", line 184, in _fabricate
calendar = factory(**kwargs)
File "C:\ProgramData\mambaforge\envs\py310\lib\site-packages\exchange_calendars\exchange_calendar.py", line 316, in __init__
raise ValueError(self._bound_max_error_msg(end))
ValueError: The XSES holidays are only recorded to the year 2022, cannot instantiate the XSES calendar through to 2023-12-31 00:00:00.
from exchange_calendars.
$ pip install --upgrade exchange_calendars
from exchange_calendars.
version is 4.2.5 - not sure if this is the problem.
from exchange_calendars.
The 2023 dates for XSES were added via this PR which was merged prior to the 4.2.5 release.
@MMCMA, could you run the following and post the print please...
import exchange_calendars as xcals
print(xcals.__version__)
cal = xcals.get_calendar("XSES", start="2023-01-01", end="2023-12-31")
print(cal.last_session)
from exchange_calendars.
It seems I had version 4.2.4 (installed via conda-forge) - though the print(xcals.__version__)
showed 0.0.0
not sure what is the problem with the forge package - switching and upgrading with pip solved the problem. Thanks and sorry.
from exchange_calendars.
No worries @MMCMA. We don't actively support conda (although someone might upload a version there). Glad you got it working.
from exchange_calendars.
Fixed by #343
from exchange_calendars.
Related Issues (20)
- Bump minimum python version to 3.9 to support numpy 1.25 HOT 1
- ASX closes early on two days in the year at 2:10pm HOT 1
- Korea ticker ends with ".KS" missed in DELAY_MAPPING, China ticker ends with ".SZ" missed in DELAY_MAPPING HOT 2
- Drop `pytz` in favor of `zoneinfo` standard library HOT 10
- Drop declaration of a minimum Pandas version (test workflow with Python 3.9 failing to build `pandas=1.1`) HOT 7
- Drop flake8 and use ruff in precommit
- Cannot create calendar with observance with pandas 2.1 HOT 4
- todo when min support moves to python 3.10
- new holiday in KRX 2023 HOT 2
- open time in exchange_calendar_xkrx.py HOT 1
- 2023-10-06 is not a trade day, but it is in HOT 3
- mistake please delete issue
- `is_session` call failing for XBOM exchange calendar HOT 2
- Migrate to pypi trusted publishers
- ecal: TypeError: DatetimeArray._generate_range() got an unexpected keyword argument 'closed' HOT 1
- XASX missing 2 days HOT 2
- FutureWarning: 'T' is deprecated and will be removed in a future version HOT 1
- Consider supporting polars HOT 6
- ecal: AttributeError: 'datetime.timezone' object has no attribute 'key' HOT 1
- XCSE - Prayers day is now not a holiday in Denmark HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from exchange_calendars.