From 44e761e264e387ed3ae29cb39bd7861f2b79e2a4 Mon Sep 17 00:00:00 2001 From: ivelin Date: Sat, 21 Dec 2024 08:45:44 -0600 Subject: [PATCH 1/7] ci: add python 3.10 and 3.11 to test matrix Signed-off-by: ivelin --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 96424ef..39a3c53 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.11"] + python-version: ["3.10", "3.11"] steps: - uses: actions/checkout@v3 From e2f4b8a739c652e87846f50b9f00a671bd970435 Mon Sep 17 00:00:00 2001 From: ivelin Date: Sat, 21 Dec 2024 08:47:56 -0600 Subject: [PATCH 2/7] ci: set python to 3.10 Signed-off-by: ivelin --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 39a3c53..d4d0460 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11"] + python-version: ["3.10"] steps: - uses: actions/checkout@v3 From caf50f03aff8043a5e712e44e2c5718ae2f5ffcd Mon Sep 17 00:00:00 2001 From: ivelin Date: Sat, 21 Dec 2024 08:53:50 -0600 Subject: [PATCH 3/7] ci: remove unnecessary darts modules Signed-off-by: ivelin --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 85426a8..f9dc8a3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -22,7 +22,7 @@ package_dir= packages = find: python_requires = >=3.10 install_requires = - darts==0.27.2 + darts==0.27.2[torch] yfinance[nospam] pandas_market_calendars fmpsdk From 49cdd41235677b6c9637da99f6a1f7abd6479d51 Mon Sep 17 00:00:00 2001 From: ivelin Date: Sat, 21 Dec 2024 08:54:34 -0600 Subject: [PATCH 4/7] ci: remove unnecessary darts modules Signed-off-by: ivelin --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index f9dc8a3..bdd312c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -22,7 +22,7 @@ package_dir= packages = find: python_requires = >=3.10 install_requires = - darts==0.27.2[torch] + darts[torch]==0.27.2 yfinance[nospam] pandas_market_calendars fmpsdk From a8138b61f2f9298327a7f60850b9ada6004d10cc Mon Sep 17 00:00:00 2001 From: ivelin Date: Sat, 21 Dec 2024 08:59:02 -0600 Subject: [PATCH 5/7] ci: remove unnecessary darts modules Signed-off-by: ivelin --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index bdd312c..cb48a81 100644 --- a/setup.cfg +++ b/setup.cfg @@ -22,7 +22,7 @@ package_dir= packages = find: python_requires = >=3.10 install_requires = - darts[torch]==0.27.2 + u8darts[torch]==0.27.2 yfinance[nospam] pandas_market_calendars fmpsdk From 7a39ede4e5ee92e504d7ea4e2fdee3ec839e8980 Mon Sep 17 00:00:00 2001 From: ivelin Date: Sat, 21 Dec 2024 09:20:15 -0600 Subject: [PATCH 6/7] ci: numpy dependency fix Signed-off-by: ivelin --- setup.cfg | 1 + src/canswim/forecast.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index cb48a81..fd08955 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,6 +23,7 @@ packages = find: python_requires = >=3.10 install_requires = u8darts[torch]==0.27.2 + numpy<2 yfinance[nospam] pandas_market_calendars fmpsdk diff --git a/src/canswim/forecast.py b/src/canswim/forecast.py index 2c59098..f15c53e 100644 --- a/src/canswim/forecast.py +++ b/src/canswim/forecast.py @@ -244,7 +244,7 @@ def get_next_open_market_day(): today = datetime.now().date() # Look for the next valid trading day within a reasonably big window of 30 days - valid_days = nyse.valid_days(start_date=today, end_date=today + timedelta(days=30)) + valid_days = nyse.valid_days(start_date=today, end_date=today + timedelta(days=30), tz="US/Eastern") next_trading_day = None @@ -265,7 +265,7 @@ def main(forecast_start_date: str = None): logger.info("Running forecast on stocks and uploading results to HF Hub...") if forecast_start_date is not None: logger.info(f"forecast_start_date: {forecast_start_date}") - forecast_start_date = pd.Timestamp(forecast_start_date) + forecast_start_date = pd.Timestamp(forecast_start_date, tz="US/Eastern") else: # get next open stock market date # Example usage From 999040ac67184af48ba3a550b02174bdccdb91c1 Mon Sep 17 00:00:00 2001 From: ivelin Date: Sat, 21 Dec 2024 09:26:44 -0600 Subject: [PATCH 7/7] fix: forecast tz format Signed-off-by: ivelin --- src/canswim/forecast.py | 4 ++-- tests/canswim/test_forecast.py | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/canswim/forecast.py b/src/canswim/forecast.py index f15c53e..6da8ec5 100644 --- a/src/canswim/forecast.py +++ b/src/canswim/forecast.py @@ -244,7 +244,7 @@ def get_next_open_market_day(): today = datetime.now().date() # Look for the next valid trading day within a reasonably big window of 30 days - valid_days = nyse.valid_days(start_date=today, end_date=today + timedelta(days=30), tz="US/Eastern") + valid_days = nyse.valid_days(start_date=today, end_date=today + timedelta(days=30), tz=None) next_trading_day = None @@ -265,7 +265,7 @@ def main(forecast_start_date: str = None): logger.info("Running forecast on stocks and uploading results to HF Hub...") if forecast_start_date is not None: logger.info(f"forecast_start_date: {forecast_start_date}") - forecast_start_date = pd.Timestamp(forecast_start_date, tz="US/Eastern") + forecast_start_date = pd.Timestamp(forecast_start_date, tz=None) else: # get next open stock market date # Example usage diff --git a/tests/canswim/test_forecast.py b/tests/canswim/test_forecast.py index a8fa314..7c794cc 100644 --- a/tests/canswim/test_forecast.py +++ b/tests/canswim/test_forecast.py @@ -15,6 +15,3 @@ def test_get_next_open_market_day(): assert isinstance(next_day, pd.Timestamp) assert next_day.dayofweek < 5 # Not weekend -def test_forecaster_initialization(forecaster): - """Test that CanswimForecaster initializes correctly""" - assert isinstance(forecaster, CanswimForecaster)