Skip to content

Commit 68b314d

Browse files
committed
build script
1 parent cf8637b commit 68b314d

File tree

1 file changed

+34
-24
lines changed

1 file changed

+34
-24
lines changed

Burrows Delta Walkthrough.ipynb

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,23 @@
4545
},
4646
{
4747
"cell_type": "code",
48-
"execution_count": 7,
48+
"execution_count": null,
49+
"metadata": {},
50+
"outputs": [],
51+
"source": [
52+
"!pip install faststylometry==1.0.15"
53+
]
54+
},
55+
{
56+
"cell_type": "markdown",
57+
"metadata": {},
58+
"source": [
59+
"Ideally you should not have to downgrade Numpy. However I can't work out how to force the build process to use the correct version of Numpy. See https://github.com/fastdatascience/faststylometry/issues/5"
60+
]
61+
},
62+
{
63+
"cell_type": "code",
64+
"execution_count": 15,
4965
"metadata": {},
5066
"outputs": [
5167
{
@@ -54,42 +70,36 @@
5470
"text": [
5571
"\u001b[33mWARNING: Ignoring invalid distribution ~rotobuf (/home/thomas/anaconda3/lib/python3.12/site-packages)\u001b[0m\u001b[33m\n",
5672
"\u001b[0m\u001b[33mWARNING: Ignoring invalid distribution ~rotobuf (/home/thomas/anaconda3/lib/python3.12/site-packages)\u001b[0m\u001b[33m\n",
57-
"\u001b[0mCollecting faststylometry==1.0.13\n",
58-
" Downloading faststylometry-1.0.13-py3-none-any.whl.metadata (14 kB)\n",
59-
"Requirement already satisfied: numpy>=2.3.1 in /home/thomas/anaconda3/lib/python3.12/site-packages (from faststylometry==1.0.13) (2.3.1)\n",
60-
"Requirement already satisfied: pandas>=2.3.1 in /home/thomas/anaconda3/lib/python3.12/site-packages (from faststylometry==1.0.13) (2.3.1)\n",
61-
"Requirement already satisfied: scikit-learn>=1.7.1 in /home/thomas/anaconda3/lib/python3.12/site-packages (from faststylometry==1.0.13) (1.7.1)\n",
62-
"Requirement already satisfied: wget>=3.2 in /home/thomas/anaconda3/lib/python3.12/site-packages (from faststylometry==1.0.13) (3.2)\n",
63-
"Requirement already satisfied: python-dateutil>=2.8.2 in /home/thomas/anaconda3/lib/python3.12/site-packages (from pandas>=2.3.1->faststylometry==1.0.13) (2.9.0.post0)\n",
64-
"Requirement already satisfied: pytz>=2020.1 in /home/thomas/anaconda3/lib/python3.12/site-packages (from pandas>=2.3.1->faststylometry==1.0.13) (2024.1)\n",
65-
"Requirement already satisfied: tzdata>=2022.7 in /home/thomas/anaconda3/lib/python3.12/site-packages (from pandas>=2.3.1->faststylometry==1.0.13) (2023.3)\n",
66-
"Requirement already satisfied: scipy>=1.8.0 in /home/thomas/anaconda3/lib/python3.12/site-packages (from scikit-learn>=1.7.1->faststylometry==1.0.13) (1.16.0)\n",
67-
"Requirement already satisfied: joblib>=1.2.0 in /home/thomas/anaconda3/lib/python3.12/site-packages (from scikit-learn>=1.7.1->faststylometry==1.0.13) (1.4.2)\n",
68-
"Requirement already satisfied: threadpoolctl>=3.1.0 in /home/thomas/anaconda3/lib/python3.12/site-packages (from scikit-learn>=1.7.1->faststylometry==1.0.13) (3.5.0)\n",
69-
"Requirement already satisfied: six>=1.5 in /home/thomas/anaconda3/lib/python3.12/site-packages (from python-dateutil>=2.8.2->pandas>=2.3.1->faststylometry==1.0.13) (1.16.0)\n",
70-
"Downloading faststylometry-1.0.13-py3-none-any.whl (19 kB)\n",
73+
"\u001b[0mCollecting numpy==1.26.4\n",
74+
" Using cached numpy-1.26.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (61 kB)\n",
75+
"Using cached numpy-1.26.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.0 MB)\n",
7176
"\u001b[33mWARNING: Ignoring invalid distribution ~rotobuf (/home/thomas/anaconda3/lib/python3.12/site-packages)\u001b[0m\u001b[33m\n",
72-
"\u001b[0mInstalling collected packages: faststylometry\n",
73-
" Attempting uninstall: faststylometry\n",
77+
"\u001b[0mInstalling collected packages: numpy\n",
78+
" Attempting uninstall: numpy\n",
7479
"\u001b[33m WARNING: Ignoring invalid distribution ~rotobuf (/home/thomas/anaconda3/lib/python3.12/site-packages)\u001b[0m\u001b[33m\n",
75-
"\u001b[0m Found existing installation: faststylometry 1.0.11\n",
76-
" Uninstalling faststylometry-1.0.11:\n",
77-
" Successfully uninstalled faststylometry-1.0.11\n",
80+
"\u001b[0m Found existing installation: numpy 2.3.1\n",
81+
" Uninstalling numpy-2.3.1:\n",
82+
" Successfully uninstalled numpy-2.3.1\n",
7883
"\u001b[33mWARNING: Ignoring invalid distribution ~rotobuf (/home/thomas/anaconda3/lib/python3.12/site-packages)\u001b[0m\u001b[33m\n",
79-
"\u001b[0mSuccessfully installed faststylometry-1.0.13\n",
84+
"\u001b[0m\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n",
85+
"harmonydata 1.0.5 requires pandas==2.2.2; python_version <= \"3.13\", but you have pandas 2.3.1 which is incompatible.\n",
86+
"harmonydata 1.0.5 requires scipy==1.14.1; python_version <= \"3.13\", but you have scipy 1.16.0 which is incompatible.\n",
87+
"gensim 4.3.3 requires scipy<1.14.0,>=1.7.0, but you have scipy 1.16.0 which is incompatible.\n",
88+
"faststylometry 1.0.15 requires numpy>=2.3.1; python_version >= \"3.12\", but you have numpy 1.26.4 which is incompatible.\u001b[0m\u001b[31m\n",
89+
"\u001b[0mSuccessfully installed numpy-1.26.4\n",
8090
"\u001b[33mWARNING: Ignoring invalid distribution ~rotobuf (/home/thomas/anaconda3/lib/python3.12/site-packages)\u001b[0m\u001b[33m\n",
8191
"\u001b[0m\u001b[33mWARNING: Ignoring invalid distribution ~rotobuf (/home/thomas/anaconda3/lib/python3.12/site-packages)\u001b[0m\u001b[33m\n",
8292
"\u001b[0m"
8393
]
8494
}
8595
],
8696
"source": [
87-
"!pip install faststylometry==1.0.13"
97+
"!pip install numpy==1.26.4"
8898
]
8999
},
90100
{
91101
"cell_type": "code",
92-
"execution_count": 9,
102+
"execution_count": 16,
93103
"metadata": {
94104
"scrolled": true
95105
},
@@ -192,7 +202,7 @@
192202
"traceback": [
193203
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
194204
"\u001b[0;31mImportError\u001b[0m Traceback (most recent call last)",
195-
"Cell \u001b[0;32mIn[9], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mfaststylometry\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Corpus\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mfaststylometry\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m download_examples\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mfaststylometry\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m load_corpus_from_folder\n",
205+
"Cell \u001b[0;32mIn[16], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mfaststylometry\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Corpus\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mfaststylometry\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m download_examples\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mfaststylometry\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m load_corpus_from_folder\n",
196206
"File \u001b[0;32m~/anaconda3/lib/python3.12/site-packages/faststylometry/__init__.py:37\u001b[0m\n\u001b[1;32m 35\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mfaststylometry\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01men\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m tokenise_remove_pronouns_en\n\u001b[1;32m 36\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mfaststylometry\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mburrows_delta\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m calculate_burrows_delta\n\u001b[0;32m---> 37\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mfaststylometry\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mprobability\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m predict_proba, calibrate, get_calibration_curve\n\u001b[1;32m 38\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mfaststylometry\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mexamples\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m download_examples\n",
197207
"File \u001b[0;32m~/anaconda3/lib/python3.12/site-packages/faststylometry/probability.py:32\u001b[0m\n\u001b[1;32m 30\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mnumpy\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mnp\u001b[39;00m\n\u001b[1;32m 31\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mpandas\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mpd\u001b[39;00m\n\u001b[0;32m---> 32\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01msklearn\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mlinear_model\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m LogisticRegression\n\u001b[1;32m 34\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mfaststylometry\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mburrows_delta\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m calculate_burrows_delta\n\u001b[1;32m 35\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mfaststylometry\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mcorpus\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Corpus\n",
198208
"File \u001b[0;32m~/anaconda3/lib/python3.12/site-packages/sklearn/__init__.py:73\u001b[0m\n\u001b[1;32m 62\u001b[0m \u001b[38;5;66;03m# `_distributor_init` allows distributors to run custom init code.\u001b[39;00m\n\u001b[1;32m 63\u001b[0m \u001b[38;5;66;03m# For instance, for the Windows wheel, this is used to pre-load the\u001b[39;00m\n\u001b[1;32m 64\u001b[0m \u001b[38;5;66;03m# vcomp shared library runtime for OpenMP embedded in the sklearn/.libs\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 67\u001b[0m \u001b[38;5;66;03m# later is linked to the OpenMP runtime to make it possible to introspect\u001b[39;00m\n\u001b[1;32m 68\u001b[0m \u001b[38;5;66;03m# it and importing it first would fail if the OpenMP dll cannot be found.\u001b[39;00m\n\u001b[1;32m 69\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m ( \u001b[38;5;66;03m# noqa: F401 E402\u001b[39;00m\n\u001b[1;32m 70\u001b[0m __check_build,\n\u001b[1;32m 71\u001b[0m _distributor_init,\n\u001b[1;32m 72\u001b[0m )\n\u001b[0;32m---> 73\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mbase\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m clone \u001b[38;5;66;03m# noqa: E402\u001b[39;00m\n\u001b[1;32m 74\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mutils\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01m_show_versions\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m show_versions \u001b[38;5;66;03m# noqa: E402\u001b[39;00m\n\u001b[1;32m 76\u001b[0m _submodules \u001b[38;5;241m=\u001b[39m [\n\u001b[1;32m 77\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcalibration\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 78\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcluster\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 114\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcompose\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 115\u001b[0m ]\n",

0 commit comments

Comments
 (0)