Git Product home page Git Product logo

Comments (8)

maread99 avatar maread99 commented on August 11, 2024

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.

MMCMA avatar MMCMA commented on August 11, 2024

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.

maread99 avatar maread99 commented on August 11, 2024
$ pip install --upgrade exchange_calendars

from exchange_calendars.

MMCMA avatar MMCMA commented on August 11, 2024

version is 4.2.5 - not sure if this is the problem.

from exchange_calendars.

maread99 avatar maread99 commented on August 11, 2024

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.

MMCMA avatar MMCMA commented on August 11, 2024

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.

maread99 avatar maread99 commented on August 11, 2024

No worries @MMCMA. We don't actively support conda (although someone might upload a version there). Glad you got it working.

from exchange_calendars.

ValueRaider avatar ValueRaider commented on August 11, 2024

Fixed by #343

from exchange_calendars.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.