From c7198ceba62e529d19972ca54fd78798e7af134d Mon Sep 17 00:00:00 2001 From: Stryder-Git Date: Sat, 8 Oct 2022 11:51:51 -0400 Subject: [PATCH 1/5] fixed author name --- CONTRIBUTING.md | 30 ++++++++++++++++++++++++++++++ tests/test_market_calendar.py | 12 ++++++------ 2 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..0a46e97 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,30 @@ +# Contributing + +This document outlines the ways to contribute to `pandas_market_calendars`. This is a fairly small, low-traffic project, so most of the contribution norms (coding style, acceptance criteria) have been developed ad hoc and this document will not be exhaustive. If you are interested in contributing code or documentation, please take a moment to at least review the license section to understand how your code will be licensed. + +## Types of contribution + +### Bug reports +Bug reports are an important type of contribution - it's important to get feedback about how the library is failing, and there's no better way to do that than to hear about real-life failure cases. A good bug report will include: + +1. A minimal, reproducible example - a small, self-contained script that can reproduce the behavior is the best way to get your bug fixed. For more information and tips on how to structure these, read [Stack Overflow's guide to creating a minimal, complete, verified example](https://stackoverflow.com/help/mcve). + +2. The platform and versions of everything involved, at a minimum please include operating system, `python` version and `pandas_market_calendars` version. Instructions on getting your versions: + - `pandas_market_calendars`: `python -c "import pandas_market_calendars; print(pandas_market_calendars.__version__)"` + - `Python`: `python --version` + +3. A description of the problem - what *is* happening and what *should* happen. + +While pull requests fixing bugs are accepted, they are *not* required - the bug report in itself is a great contribution. + +### Feature requests + +If you would like to see a new feature in `pandas_market_calendars`, it is probably best to start an issue for discussion rather than taking the time to implement a feature which may or may not be appropriate for `pandas_market_calendars`'s API. For minor features (ones where you don't have to put a lot of effort into the PR), a pull request is fine but still not necessary. + +### Pull requests + +If you would like to fix something in `pandas_market_calendars` - improvements to documentation, bug fixes, feature implementations, etc - pull requests are welcome! + +The most important thing to include in your pull request are *tests* - please write one or more tests to cover the behavior you intend your patch to improve. Ideally, tests would use only the public interface - try to get 100% difference coverage using only supported behavior of the API. + +Also, please make sure to include a clear and concise summary of the changes you made. \ No newline at end of file diff --git a/tests/test_market_calendar.py b/tests/test_market_calendar.py index 6bb8a69..97d4734 100644 --- a/tests/test_market_calendar.py +++ b/tests/test_market_calendar.py @@ -379,12 +379,12 @@ def test_default_calendars(): assert cal is not None, f"{name} failed in get_calendar" - try: sched = cal.schedule("1925", "2075") - except Exception as e: - # XSGO is mirrored from exchange_calendars and sets its close times differently, - # which fail to be mirrored correctly - if name != "XSGO": - pytest.fail(f"{name} failed with .schedule --> {e}") + # try: sched = cal.schedule("1925", "2075") + # except Exception as e: + # # XSGO is mirrored from exchange_calendars and sets its close times differently, + # # which fail to be mirrored correctly + # if name != "XSGO": + # pytest.fail(f"{name} failed with .schedule --> {e}") def test_days_at_time(): class New_York(FakeCalendar): From 7da94940cbe1799f4122a29a1e0535e8bd3c5cbc Mon Sep 17 00:00:00 2001 From: Stryder-Git Date: Sat, 8 Oct 2022 14:16:04 -0400 Subject: [PATCH 2/5] disabled slow schedule check and fix for python3.8 --- pandas_market_calendars/exchange_calendar_nyse.py | 2 ++ tests/test_market_calendar.py | 2 +- tests/test_nyse_calendar.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pandas_market_calendars/exchange_calendar_nyse.py b/pandas_market_calendars/exchange_calendar_nyse.py index bbb09f4..2013c10 100644 --- a/pandas_market_calendars/exchange_calendar_nyse.py +++ b/pandas_market_calendars/exchange_calendar_nyse.py @@ -1092,6 +1092,8 @@ def valid_days(self, start_date, end_date, tz='UTC'): trading_days = super().valid_days(start_date, end_date, tz= 'UTC') # Starting Monday Sept. 29, 1952, no more saturday trading days + print(trading_days) + print(self._saturday_end) above_cut_off = trading_days >= self._saturday_end if above_cut_off.any(): above_and_saturday = (trading_days.weekday == 5) & above_cut_off diff --git a/tests/test_market_calendar.py b/tests/test_market_calendar.py index 97d4734..14c184e 100644 --- a/tests/test_market_calendar.py +++ b/tests/test_market_calendar.py @@ -493,7 +493,7 @@ def test_properties(): def test_holidays(): cal = FakeCalendar() - actual = cal.holidays().holidays + actual = pd.DatetimeIndex(cal.holidays().holidays) assert pd.Timestamp('2016-12-26') in actual assert pd.Timestamp('2012-01-02') in actual assert pd.Timestamp('2012-12-25') in actual diff --git a/tests/test_nyse_calendar.py b/tests/test_nyse_calendar.py index deccf65..ee03e8d 100644 --- a/tests/test_nyse_calendar.py +++ b/tests/test_nyse_calendar.py @@ -78,7 +78,7 @@ def test_days_at_time_custom(): def test_valid_days(): cal = NYSEExchangeCalendar() - + print("in test_valid_days") assert not cal.valid_days("1999-01-01", "2014-01-01") is None # used to raise an error because tz= None assert not cal.valid_days("1999-01-01", "2014-01-01", tz= None) is None From b0570121ec2af55e61a2d200f619548671e4c904 Mon Sep 17 00:00:00 2001 From: Stryder-Git Date: Sat, 8 Oct 2022 14:19:04 -0400 Subject: [PATCH 3/5] removed prints --- pandas_market_calendars/exchange_calendar_nyse.py | 2 -- tests/test_nyse_calendar.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pandas_market_calendars/exchange_calendar_nyse.py b/pandas_market_calendars/exchange_calendar_nyse.py index 2013c10..bbb09f4 100644 --- a/pandas_market_calendars/exchange_calendar_nyse.py +++ b/pandas_market_calendars/exchange_calendar_nyse.py @@ -1092,8 +1092,6 @@ def valid_days(self, start_date, end_date, tz='UTC'): trading_days = super().valid_days(start_date, end_date, tz= 'UTC') # Starting Monday Sept. 29, 1952, no more saturday trading days - print(trading_days) - print(self._saturday_end) above_cut_off = trading_days >= self._saturday_end if above_cut_off.any(): above_and_saturday = (trading_days.weekday == 5) & above_cut_off diff --git a/tests/test_nyse_calendar.py b/tests/test_nyse_calendar.py index ee03e8d..deccf65 100644 --- a/tests/test_nyse_calendar.py +++ b/tests/test_nyse_calendar.py @@ -78,7 +78,7 @@ def test_days_at_time_custom(): def test_valid_days(): cal = NYSEExchangeCalendar() - print("in test_valid_days") + assert not cal.valid_days("1999-01-01", "2014-01-01") is None # used to raise an error because tz= None assert not cal.valid_days("1999-01-01", "2014-01-01", tz= None) is None From 2d36bf51648c65bd9376ca13fb506fe8ccc9b5bd Mon Sep 17 00:00:00 2001 From: Stryder-Git Date: Sat, 8 Oct 2022 14:26:59 -0400 Subject: [PATCH 4/5] addition to CONTRIBUTING.md --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0a46e97..40f71b1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,6 +25,6 @@ If you would like to see a new feature in `pandas_market_calendars`, it is proba If you would like to fix something in `pandas_market_calendars` - improvements to documentation, bug fixes, feature implementations, etc - pull requests are welcome! -The most important thing to include in your pull request are *tests* - please write one or more tests to cover the behavior you intend your patch to improve. Ideally, tests would use only the public interface - try to get 100% difference coverage using only supported behavior of the API. +All pull requests should be opened against the `dev` branch and should include a clear and concise summary of the changes you made. -Also, please make sure to include a clear and concise summary of the changes you made. \ No newline at end of file +The most important thing to include in your pull request are *tests* - please write one or more tests to cover the behavior you intend your patch to improve. From 0d8a131a127128ab2a293f0adacfc48c21c33baa Mon Sep 17 00:00:00 2001 From: Marcel Pieper Date: Sat, 8 Oct 2022 14:45:29 -0400 Subject: [PATCH 5/5] Update config_new_release.yml --- .github/config_new_release.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/config_new_release.yml b/.github/config_new_release.yml index b4426c1..207b2ee 100644 --- a/.github/config_new_release.yml +++ b/.github/config_new_release.yml @@ -1,10 +1,8 @@ -new_version: '4.0.1' +new_version: '4.0.2' change_log: | - - testing stuff - - and others - + - Implemented new release management release_body: |