diff --git a/CHANGELOG.md b/CHANGELOG.md index d192f7b..6d8b0b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Change Log +## [v8.1.0]() (2018-06-10) + +**Added** +- added `blog` data type. Various methods in `EventRegistry` class accept it, such as `suggestNewsSources()`, `suggestSourcesAtPlace()` and `getNewsSourceUri()`. + +**Updated** +- `QueryArticlesIter.initWithComplexQuery()` now accepts also the `dataType` parameter (by default `news`). + +**Removed** +- Removed the parameter `articleBatchSize` from `QueryArticlesIter.execQuery` since it was not useful. We are always returning the maximum number of results that can be obtained with a single query. + + ## [v8.0]() (2018-04-10) **Added** diff --git a/eventregistry/QueryArticles.py b/eventregistry/QueryArticles.py index e693c48..796cabd 100644 --- a/eventregistry/QueryArticles.py +++ b/eventregistry/QueryArticles.py @@ -226,7 +226,6 @@ def execQuery(self, eventRegistry, sortBy = "rel", sortByAsc = False, returnInfo = ReturnInfo(), - articleBatchSize = 100, maxItems = -1, **kwargs): """ diff --git a/eventregistry/QueryEvents.py b/eventregistry/QueryEvents.py index e1fb481..0ca06e6 100644 --- a/eventregistry/QueryEvents.py +++ b/eventregistry/QueryEvents.py @@ -504,15 +504,19 @@ def __init__(self, class RequestEventsConceptTrends(RequestEvents): def __init__(self, + conceptUris = None, conceptCount = 10, returnInfo = ReturnInfo()): """ return a list of top trending concepts and their daily trending info over time - @param conceptCount: number of top concepts to return (at most 50) + @param conceptUris: list of concept URIs for which to return trending information. If None, then top concepts will be automatically computed + @param count: if the concepts are not provided, what should be the number of automatically determined concepts to return (at most 50) @param returnInfo: what details about the concepts should be included in the returned information """ assert conceptCount <= 50 self.resultType = "conceptTrends" + if conceptUris != None: + self.conceptTrendsConceptUri = conceptUris self.conceptTrendsConceptCount = conceptCount self.__dict__.update(returnInfo.getParams("conceptTrends")) diff --git a/eventregistry/_version.py b/eventregistry/_version.py index 73d4c8b..70dab03 100644 --- a/eventregistry/_version.py +++ b/eventregistry/_version.py @@ -1 +1 @@ -__version__ = "8.0.0" +__version__ = "8.1.0" diff --git a/eventregistry/tests/TestQueryArticles.py b/eventregistry/tests/TestQueryArticles.py index 22779b1..f31bb99 100644 --- a/eventregistry/tests/TestQueryArticles.py +++ b/eventregistry/tests/TestQueryArticles.py @@ -30,7 +30,7 @@ def testArticleUriWgtList(self): expectedCount = iter.count(self.er) countPerPage = 20000 - pages = math.ceil(expectedCount / countPerPage) + pages = int(math.ceil(expectedCount / countPerPage)) q = QueryArticles(conceptUri=self.er.getConceptUri("germany")) items = [] for page in range(1, pages+1): diff --git a/eventregistry/tests/TestQueryEvents.py b/eventregistry/tests/TestQueryEvents.py index 888a408..d145ea9 100644 --- a/eventregistry/tests/TestQueryEvents.py +++ b/eventregistry/tests/TestQueryEvents.py @@ -191,7 +191,7 @@ def testConceptTrends(self): self.assertIsNotNone(res.get("conceptTrends"), "Expected to get 'conceptTrends'") self.assertIsNotNone(res.get("conceptTrends").get("trends"), "Expected to get 'trends' property in conceptTrends") self.assertIsNotNone(res.get("conceptTrends").get("conceptInfo"), "Expected to get 'conceptInfo' property in conceptTrends") - self.assertTrue(len(res["conceptTrends"]["conceptInfo"]) == 5, "Expected to get 5 concepts in concept trends") + self.assertTrue(len(res["conceptTrends"]["conceptInfo"]) <= 5, "Expected to get 5 concepts in concept trends") trends = res["conceptTrends"]["trends"] self.assertTrue(len(trends) > 0, "Expected to get trends for some days") for trend in trends: