diff --git a/VERSION b/VERSION index 844f6a9..faef31a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.6.3 +0.7.0 diff --git a/news_signals/test_signals.py b/news_signals/test_signals.py index a225f13..26e8956 100644 --- a/news_signals/test_signals.py +++ b/news_signals/test_signals.py @@ -506,14 +506,27 @@ def test_add_wikimedia_pageviews_timeseries(self): assert dtype == np.int64 def test_add_wikipedia_current_events(self): + ts_endpoint_mock = MockEndpoint() + aylien_ts = [ + {"published_at": "2023-01-01T00:00:00Z", "count": 1}, + {"published_at": "2023-01-02T00:00:00Z", "count": 2}, + {"published_at": "2023-01-03T00:00:00Z", "count": 4}, + {"published_at": "2023-01-04T00:00:00Z", "count": 1}, + {"published_at": "2023-01-05T00:00:00Z", "count": 6}, + ] + # WORKING here - fix this test so that it doesn't call the internet + timeseries_df = aylien_ts_to_df(aylien_ts, normalize=True, freq='D') + start = '2023-01-01' + end = '2023-01-05' html_path = resources / 'wiki-current-events-portal/example_monthly_page_jan_2023.html' example_html = html_path.read_text() signal = signals.AylienSignal( name='test', - params={'entity_ids': ['Q81068910']} + params={ + 'timeseries_df': timeseries_df, + 'entity_ids': ['Q81068910']}, + ts_endpoint=ts_endpoint_mock ) - start = '2023-01-01' - end = '2023-01-30' ts_signal = signal(start=start, end=end) ts_signal.add_wikipedia_current_events( wikidata_client=MockWikidataClient('https://en.wikipedia.org/wiki/COVID-19_pandemic'), diff --git a/requirements.txt b/requirements.txt index 711ba67..1419e8b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,13 +8,14 @@ mkdocs>=1.4.2 mkdocstrings[python]>=0.8.3 mkdocs-material>=9.0.14 networkx<=2.7 +numpy==1.26.4 pandas>=1.4.1 pyarrow>=11.0.0 ratelimit>=2.2.1 requests>=2.28.1 scikit-learn>=1.1.0 scipy>=1.8 -spacy>=3.4.1,<4.0.0 +spacy==3.5.4 sqlitedict>=1.7.0 tqdm>=4.62.3 Wikidata>=0.7.0 diff --git a/setup.py b/setup.py index 0070eb3..5b520ae 100644 --- a/setup.py +++ b/setup.py @@ -16,13 +16,14 @@ "google-cloud-storage>=2.10.0", "matplotlib>=3.5.3", "networkx<=2.7", + "numpy==1.26.4", "pandas>=1.4.1", "pyarrow>=11.0.0", "ratelimit>=2.2.1", "requests>=2.28.1", "scikit-learn>=1.1.0", "scipy>=1.8", - "spacy>=3.4.1,<4.0.0", + "spacy==3.5.4", "sqlitedict>=1.7.0", "tqdm>=4.62.3", "Wikidata>=0.7.0"