diff --git a/convokit/util.py b/convokit/util.py index 1026f7c9..ef5f7c83 100644 --- a/convokit/util.py +++ b/convokit/util.py @@ -6,7 +6,7 @@ import warnings import zipfile from typing import Dict - +from .convokitConfig import ConvoKitConfig import requests @@ -108,15 +108,16 @@ def download( custom_data_dir = data_dir - data_dir = os.path.expanduser("~/.convokit/") - + config = ConvoKitConfig() + data_dir = config.data_directory + data_dir = os.path.expanduser(data_dir) # pkg_resources.resource_filename("convokit", "") if not os.path.exists(data_dir): os.mkdir(data_dir) if not os.path.exists(os.path.join(data_dir, "downloads")): os.mkdir(os.path.join(data_dir, "downloads")) - dataset_path = os.path.join(data_dir, "downloads", name) + dataset_path = os.path.join(data_dir, name) if custom_data_dir is not None: dataset_path = os.path.join(custom_data_dir, name) @@ -192,7 +193,8 @@ def download_local(name: str, data_dir: str): :return: string path to local Corpus """ custom_data_dir = data_dir - data_dir = os.path.expanduser("~/.convokit/") + config = ConvoKitConfig() + data_dir = config.data_directory # pkg_resources.resource_filename("convokit", "") if not os.path.exists(data_dir): diff --git a/docs/source/troubleshooting.rst b/docs/source/troubleshooting.rst index b475fcb0..9178d49c 100644 --- a/docs/source/troubleshooting.rst +++ b/docs/source/troubleshooting.rst @@ -12,7 +12,10 @@ Issues **Error associated with Numpy** -ConvoKit currently requires Numpy 1.x.x, as Numpy 2.x is known to cause compatibility issues. Please verify your Numpy version. We are working on supporting Numpy 2.x and appreciate your understanding. +Pre Spacy 3.8.2 is not compatible with numpy 2.0.0+ due to compatibility issues with thinc. Spacy 3.8.2 is compatible with numpy 2.0.0+ but currently requires thinc to be >=8.3.0, <8.4.0, so as a temporary solution ConvoKit now enforces spacy>=3.8.2, thinc >=8.3.0, <8.4.0. We will continue to keep an eye on spacy releases and update the requirements if there are new releases targeting this issue. +For additional insight into the issue: +`spaCy issue #13528 `_ +`thinc issue #939 `_ ----------------------------- diff --git a/setup.py b/setup.py index 259a1121..87989df2 100644 --- a/setup.py +++ b/setup.py @@ -44,7 +44,7 @@ "matplotlib>=3.0.0", "pandas>=0.23.4", "msgpack-numpy>=0.4.3.2", - "spacy>=2.3.5", + "spacy>=3.8.2", "scipy>=1.1.0", "scikit-learn>=0.20.0", "nltk>=3.4", @@ -56,6 +56,7 @@ "pymongo>=4.0", "pyyaml>=5.4.1", "dnspython>=1.16.0", + "thinc>=8.3.0,<8.4.0", ], extras_require={ "craft": ["torch>=0.12"],