From ff638e269d439c853b5182b68ff10777f12597f1 Mon Sep 17 00:00:00 2001 From: Terry Truong Date: Sun, 5 Feb 2023 13:55:00 +1100 Subject: Use relative imports between data generation scripts Avoids the need for code that modifies sys.path, but requires running of the scripts using 'python -m' with backend/ as cwd. Also expects constants like DB_FILE to be non-relative, due to running from backend/. --- backend/hist_data/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'backend/hist_data/README.md') diff --git a/backend/hist_data/README.md b/backend/hist_data/README.md index 73b7a36..4baf0b1 100644 --- a/backend/hist_data/README.md +++ b/backend/hist_data/README.md @@ -47,7 +47,8 @@ This directory holds files used to generate the history database data.db. ## Generate Event Data 1. Obtain a Wikidata JSON dump in wikidata/, as specified in it's README. 1. Run `gen_events_data.py`, which creates `data.db`, and adds the `events` table. - You might want to set WIKIDATA_FILE in the script to the dump file's name. + It needs to be run as a module, by using `python -m hist_data.gen_events_data` in hist_data/. + Also, you might want to check that WIKIDATA_FILE in the script matches the dump file's name. ## Generate Popularity Data 1. Obtain an enwiki dump and 'page view files' in enwiki/, as specified in the README. -- cgit v1.2.3