diff options
| author | Terry Truong <terry06890@gmail.com> | 2023-01-17 19:07:03 +1100 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2023-01-17 19:07:03 +1100 |
| commit | f3e08d5e636849f9c503d65cee8953f183a3dc2a (patch) | |
| tree | af019b355130e52f3cb10df4a951f2529fa07e0c | |
| parent | 3bdbf906e01dd78ef58382464d6584cb7af6ae75 (diff) | |
Remove EXCL_PROPS from gen_events_data.py
| -rwxr-xr-x | backend/hist_data/gen_events_data.py | 8 | ||||
| -rw-r--r-- | backend/tests/test_gen_events_data.py | 19 |
2 files changed, 0 insertions, 27 deletions
diff --git a/backend/hist_data/gen_events_data.py b/backend/hist_data/gen_events_data.py index 3613dfb..60402b5 100755 --- a/backend/hist_data/gen_events_data.py +++ b/backend/hist_data/gen_events_data.py @@ -123,10 +123,6 @@ EVENT_CTG: dict[str, dict[str, str]] = { }, } ID_TO_CTG = {id: ctg for ctg, nmToId in EVENT_CTG.items() for name, id in nmToId.items()} -EXCL_PROPS: dict[str, str] = { - # Holds IDs and names of props that entities should not include - 'P1441': 'present in work', # Present for fictional characters/etc -} BASIC_TIME_PROPS: dict[str, str] = { # Maps some time-indicative property names to their IDs 'start time': 'P580', @@ -273,10 +269,6 @@ def readDumpLine(lineBytes: bytes) -> tuple[int, str, int, int | None, int | Non eventCtg = ID_TO_CTG[prop] if not eventCtg: return None - # Check for excluded props - for prop in claims: - if prop in EXCL_PROPS: - return None # Check for event-start/end props startVal: str endVal: str | None diff --git a/backend/tests/test_gen_events_data.py b/backend/tests/test_gen_events_data.py index 0941365..a94bc89 100644 --- a/backend/tests/test_gen_events_data.py +++ b/backend/tests/test_gen_events_data.py @@ -68,25 +68,6 @@ class TestGenData(unittest.TestCase): }, 'sitelinks': {'enwiki': {'title': 'Human One'}}, }, - { # Like Q2 but fictional - 'id': 'Q20', - 'claims': { - 'P31': [{'mainsnak': {'datavalue': {'value': {'id': 'Q5'}}}}], # 'instance of' 'human' - 'P569': [{'mainsnak': {'datavalue': {'type': 'time', 'value': { # 'date of birth' - 'time':'+2002-11-02T00:00:00Z', - 'precision':11, # day precision - 'calendarmodel':'http://www.wikidata.org/entity/Q1985786' # 'proleptic julian calendar' - }}}}], - 'P570': [{'mainsnak': {'datavalue': {'type': 'time', 'value': { # 'date of death' - 'time':'+2010-06-21T00:00:01Z', - 'timezone':1, - 'precision':11, - 'calendarmodel':'http://www.wikidata.org/entity/Q1985727' # 'proleptic gregorian calendar' - }}}}], - 'P1441': [{'mainsnak': {'datavalue': {'value': {'id': 'Q8337'}}}}] # 'present in work' - }, - 'sitelinks': {'enwiki': {'title': 'Human Two'}}, - }, { 'id': 'Q3', 'claims': { |
