Skip to content

Commit

Permalink
## [v8.1.0]() (2018-06-10)
Browse files Browse the repository at this point in the history
**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.
  • Loading branch information
gregorleban committed Jun 10, 2018
1 parent 3fa373f commit 9c00c2f
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 5 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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**
Expand Down
1 change: 0 additions & 1 deletion eventregistry/QueryArticles.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ def execQuery(self, eventRegistry,
sortBy = "rel",
sortByAsc = False,
returnInfo = ReturnInfo(),
articleBatchSize = 100,
maxItems = -1,
**kwargs):
"""
Expand Down
6 changes: 5 additions & 1 deletion eventregistry/QueryEvents.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))

Expand Down
2 changes: 1 addition & 1 deletion eventregistry/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "8.0.0"
__version__ = "8.1.0"
2 changes: 1 addition & 1 deletion eventregistry/tests/TestQueryArticles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion eventregistry/tests/TestQueryEvents.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9c00c2f

Please sign in to comment.