Repository: pysal/pointpats (language: python)

Issue:
Build the READMErst for Pypi release.



Discussion / hints:

Fix patch:
diff --git a/notebooks/spacetime.ipynb b/notebooks/spacetime.ipynb
new file mode 100644
index 0000000..9ccdc0f
--- /dev/null
+++ b/notebooks/spacetime.ipynb
@@ -0,0 +1,1317 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "id": "df4724c7-7e8a-4410-804a-6f0551aafcbe",
+   "metadata": {},
+   "source": [
+    "# Knox space-time interaction statistic"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 1,
+   "id": "cedb45a1-df8c-4a1d-96b0-b48c92b4f55e",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "%load_ext autoreload\n",
+    "%autoreload 2"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "8e5d40f6-0ee7-4587-940f-4fd3428dd4a8",
+   "metadata": {},
+   "source": [
+    "## Current Implementation (to be deprecated)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "id": "551458d6-3d47-463a-8045-c2fe7574a3c0",
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stderr",
+     "output_type": "stream",
+     "text": [
+      "/home/serge/mambaforge/envs/pointpats/lib/python3.11/site-packages/libpysal/cg/alpha_shapes.py:38: NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit for details.\n",
+      "  @jit\n",
+      "/home/serge/mambaforge/envs/pointpats/lib/python3.11/site-packages/libpysal/cg/alpha_shapes.py:164: NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit for details.\n",
+      "  @jit\n",
+      "/home/serge/mambaforge/envs/pointpats/lib/python3.11/site-packages/libpysal/cg/alpha_shapes.py:198: NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit for details.\n",
+      "  @jit\n",
+      "/home/serge/mambaforge/envs/pointpats/lib/python3.11/site-packages/libpysal/cg/alpha_shapes.py:260: NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit for details.\n",
+      "  @jit\n"
+     ]
+    }
+   ],
+   "source": [
+    "import pointpats"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 3,
+   "id": "62f68eb2-cd64-426b-977b-76abd77b2349",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import libpysal"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 4,
+   "id": "5c4b19f6-150a-40c8-8022-aab086332ca6",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "path = libpysal.examples.get_path('burkitt.shp')"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "id": "b68cc670-4ee3-4d34-9c32-f1b998b2aef5",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "from pointpats import SpaceTimeEvents, knox"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 6,
+   "id": "c6b1ec6b-63a9-43bd-9d19-f02678249722",
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stderr",
+     "output_type": "stream",
+     "text": [
+      "/home/serge/mambaforge/envs/pointpats/lib/python3.11/site-packages/libpysal/cg/shapes.py:103: FutureWarning: Objects based on the `Geometry` class will deprecated and removed in a future version of libpysal.\n",
+      "  warnings.warn(dep_msg, FutureWarning)\n"
+     ]
+    }
+   ],
+   "source": [
+    "events = SpaceTimeEvents(path, 'T')"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 7,
+   "id": "20b15e1b-1c37-4e8e-99fc-a65904c1c84a",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "<pointpats.spacetime.SpaceTimeEvents at 0x7f42e2a35090>"
+      ]
+     },
+     "execution_count": 7,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "events"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 8,
+   "id": "195767a0-1381-47ad-92be-6c94c7513969",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import numpy"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 9,
+   "id": "e74a1d48-bb41-48a1-be1d-8a62776235d7",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "\u001b[0;31mSignature:\u001b[0m \u001b[0mknox\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ms_coords\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mt_coords\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdelta\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtau\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpermutations\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m99\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdebug\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+       "\u001b[0;31mDocstring:\u001b[0m\n",
+       "Knox test for spatio-temporal interaction. :cite:`Knox:1964`\n",
+       "\n",
+       "Parameters\n",
+       "----------\n",
+       "s_coords        : array\n",
+       "                  (n, 2), spatial coordinates.\n",
+       "t_coords        : array\n",
+       "                  (n, 1), temporal coordinates.\n",
+       "delta           : float\n",
+       "                  threshold for proximity in space.\n",
+       "tau             : float\n",
+       "                  threshold for proximity in time.\n",
+       "permutations    : int, optional\n",
+       "                  the number of permutations used to establish pseudo-\n",
+       "                  significance (the default is 99).\n",
+       "debug           : bool, optional\n",
+       "                  if true, debugging information is printed (the default is\n",
+       "                  False).\n",
+       "\n",
+       "Returns\n",
+       "-------\n",
+       "knox_result     : dictionary\n",
+       "                  contains the statistic (stat) for the test and the\n",
+       "                  associated p-value (pvalue).\n",
+       "stat            : float\n",
+       "                  value of the knox test for the dataset.\n",
+       "pvalue          : float\n",
+       "                  pseudo p-value associated with the statistic.\n",
+       "counts          : int\n",
+       "                  count of space time neighbors.\n",
+       "\n",
+       "Examples\n",
+       "--------\n",
+       ">>> import numpy as np\n",
+       ">>> import libpysal as lps\n",
+       ">>> from pointpats import SpaceTimeEvents, knox\n",
+       "\n",
+       "Read in the example data and create an instance of SpaceTimeEvents.\n",
+       "\n",
+       ">>> path = lps.examples.get_path(\"burkitt.shp\")\n",
+       ">>> events = SpaceTimeEvents(path,'T')\n",
+       "\n",
+       "Set the random seed generator. This is used by the permutation based\n",
+       "inference to replicate the pseudo-significance of our example results -\n",
+       "the end-user will normally omit this step.\n",
+       "\n",
+       ">>> np.random.seed(100)\n",
+       "\n",
+       "Run the Knox test with distance and time thresholds of 20 and 5,\n",
+       "respectively. This counts the events that are closer than 20 units in\n",
+       "space, and 5 units in time.\n",
+       "\n",
+       ">>> result = knox(events.space, events.t, delta=20, tau=5, permutations=99)\n",
+       "\n",
+       "Next, we examine the results. First, we call the statistic from the\n",
+       "results dictionary. This reports that there are 13 events close\n",
+       "in both space and time, according to our threshold definitions.\n",
+       "\n",
+       ">>> result['stat'] == 13\n",
+       "True\n",
+       "\n",
+       "Next, we look at the pseudo-significance of this value, calculated by\n",
+       "permuting the timestamps and rerunning the statistics. In this case,\n",
+       "the results indicate there is likely no space-time interaction between\n",
+       "the events.\n",
+       "\n",
+       ">>> print(\"%2.2f\"%result['pvalue'])\n",
+       "0.17\n",
+       "\u001b[0;31mFile:\u001b[0m      ~/projects/pysal/pointpats/pointpats/spacetime.py\n",
+       "\u001b[0;31mType:\u001b[0m      function"
+      ]
+     },
+     "metadata": {},
+     "output_type": "display_data"
+    }
+   ],
+   "source": [
+    "knox?"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 10,
+   "id": "bdceed0d-1ebf-4a93-b6ff-6557e67fcb27",
+   "metadata": {
+    "scrolled": true
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([[300., 302.],\n",
+       "       [291., 270.],\n",
+       "       [326., 263.],\n",
+       "       [299., 376.],\n",
+       "       [267., 327.],\n",
+       "       [266., 356.],\n",
+       "       [267., 345.],\n",
+       "       [262., 338.],\n",
+       "       [268., 335.],\n",
+       "       [335., 275.],\n",
+       "       [302., 272.],\n",
+       "       [301., 304.],\n",
+       "       [302., 272.],\n",
+       "       [324., 337.],\n",
+       "       [260., 338.],\n",
+       "       [306., 385.],\n",
+       "       [284., 362.],\n",
+       "       [293., 332.],\n",
+       "       [274., 353.],\n",
+       "       [263., 333.],\n",
+       "       [307., 386.],\n",
+       "       [274., 357.],\n",
+       "       [297., 282.],\n",
+       "       [288., 365.],\n",
+       "       [283., 366.],\n",
+       "       [290., 352.],\n",
+       "       [284., 341.],\n",
+       "       [286., 341.],\n",
+       "       [282., 350.],\n",
+       "       [292., 278.],\n",
+       "       [305., 381.],\n",
+       "       [298., 378.],\n",
+       "       [299., 381.],\n",
+       "       [287., 342.],\n",
+       "       [276., 380.],\n",
+       "       [261., 345.],\n",
+       "       [273., 347.],\n",
+       "       [284., 357.],\n",
+       "       [266., 361.],\n",
+       "       [285., 360.],\n",
+       "       [278., 350.],\n",
+       "       [305., 321.],\n",
+       "       [293., 332.],\n",
+       "       [297., 375.],\n",
+       "       [332., 273.],\n",
+       "       [256., 345.],\n",
+       "       [275., 357.],\n",
+       "       [267., 350.],\n",
+       "       [267., 301.],\n",
+       "       [286., 379.],\n",
+       "       [322., 332.],\n",
+       "       [278., 349.],\n",
+       "       [280., 356.],\n",
+       "       [276., 354.],\n",
+       "       [261., 343.],\n",
+       "       [323., 298.],\n",
+       "       [260., 346.],\n",
+       "       [283., 352.],\n",
+       "       [282., 361.],\n",
+       "       [308., 390.],\n",
+       "       [293., 275.],\n",
+       "       [331., 272.],\n",
+       "       [266., 308.],\n",
+       "       [280., 354.],\n",
+       "       [301., 271.],\n",
+       "       [279., 361.],\n",
+       "       [321., 280.],\n",
+       "       [292., 391.],\n",
+       "       [315., 307.],\n",
+       "       [323., 333.],\n",
+       "       [282., 302.],\n",
+       "       [269., 348.],\n",
+       "       [330., 349.],\n",
+       "       [281., 302.],\n",
+       "       [330., 396.],\n",
+       "       [328., 341.],\n",
+       "       [264., 323.],\n",
+       "       [303., 382.],\n",
+       "       [264., 285.],\n",
+       "       [259., 337.],\n",
+       "       [329., 350.],\n",
+       "       [328., 351.],\n",
+       "       [284., 351.],\n",
+       "       [309., 370.],\n",
+       "       [329., 270.],\n",
+       "       [273., 347.],\n",
+       "       [295., 267.],\n",
+       "       [262., 353.],\n",
+       "       [281., 352.],\n",
+       "       [325., 335.],\n",
+       "       [288., 341.],\n",
+       "       [302., 248.],\n",
+       "       [315., 273.],\n",
+       "       [295., 377.],\n",
+       "       [284., 358.],\n",
+       "       [272., 376.],\n",
+       "       [305., 369.],\n",
+       "       [279., 318.],\n",
+       "       [290., 339.],\n",
+       "       [311., 376.],\n",
+       "       [288., 256.],\n",
+       "       [324., 284.],\n",
+       "       [287., 353.],\n",
+       "       [283., 364.],\n",
+       "       [267., 337.],\n",
+       "       [280., 298.],\n",
+       "       [275., 326.],\n",
+       "       [281., 299.],\n",
+       "       [313., 365.],\n",
+       "       [273., 332.],\n",
+       "       [283., 363.],\n",
+       "       [304., 366.],\n",
+       "       [308., 387.],\n",
+       "       [330., 275.],\n",
+       "       [260., 339.],\n",
+       "       [289., 335.],\n",
+       "       [268., 314.],\n",
+       "       [329., 268.],\n",
+       "       [264., 298.],\n",
+       "       [274., 342.],\n",
+       "       [286., 373.],\n",
+       "       [263., 346.],\n",
+       "       [265., 335.],\n",
+       "       [269., 340.],\n",
+       "       [260., 359.],\n",
+       "       [279., 355.],\n",
+       "       [284., 399.],\n",
+       "       [270., 337.],\n",
+       "       [267., 363.],\n",
+       "       [320., 282.],\n",
+       "       [282., 315.],\n",
+       "       [303., 377.],\n",
+       "       [303., 247.],\n",
+       "       [264., 297.],\n",
+       "       [303., 337.],\n",
+       "       [289., 380.],\n",
+       "       [270., 330.],\n",
+       "       [262., 335.],\n",
+       "       [274., 342.],\n",
+       "       [262., 333.],\n",
+       "       [262., 333.],\n",
+       "       [267., 369.],\n",
+       "       [255., 290.],\n",
+       "       [267., 336.],\n",
+       "       [273., 309.],\n",
+       "       [270., 328.],\n",
+       "       [270., 339.],\n",
+       "       [265., 334.],\n",
+       "       [276., 360.],\n",
+       "       [276., 360.],\n",
+       "       [283., 363.],\n",
+       "       [305., 374.],\n",
+       "       [264., 326.],\n",
+       "       [286., 361.],\n",
+       "       [278., 333.],\n",
+       "       [257., 344.],\n",
+       "       [302., 395.],\n",
+       "       [275., 378.],\n",
+       "       [290., 361.],\n",
+       "       [279., 362.],\n",
+       "       [300., 255.],\n",
+       "       [270., 357.],\n",
+       "       [290., 356.],\n",
+       "       [291., 368.],\n",
+       "       [283., 361.],\n",
+       "       [270., 325.],\n",
+       "       [266., 332.],\n",
+       "       [267., 367.],\n",
+       "       [300., 364.],\n",
+       "       [268., 390.],\n",
+       "       [276., 337.],\n",
+       "       [293., 396.],\n",
+       "       [273., 345.],\n",
+       "       [267., 338.],\n",
+       "       [278., 367.],\n",
+       "       [310., 387.],\n",
+       "       [298., 268.],\n",
+       "       [266., 332.],\n",
+       "       [279., 340.],\n",
+       "       [266., 361.],\n",
+       "       [267., 344.],\n",
+       "       [272., 370.],\n",
+       "       [327., 383.],\n",
+       "       [265., 335.],\n",
+       "       [310., 387.],\n",
+       "       [279., 339.],\n",
+       "       [277., 379.],\n",
+       "       [258., 350.]])"
+      ]
+     },
+     "execution_count": 10,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "events.space"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 11,
+   "id": "20f228b7-63cb-439a-9223-08462d6ff5af",
+   "metadata": {
+    "scrolled": true
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([[4.130e+02, 1.000e+00],\n",
+       "       [4.720e+02, 1.000e+00],\n",
+       "       [5.110e+02, 1.000e+00],\n",
+       "       [6.890e+02, 1.000e+00],\n",
+       "       [7.300e+02, 1.000e+00],\n",
+       "       [8.470e+02, 1.000e+00],\n",
+       "       [8.710e+02, 1.000e+00],\n",
+       "       [8.990e+02, 1.000e+00],\n",
+       "       [9.210e+02, 1.000e+00],\n",
+       "       [1.134e+03, 1.000e+00],\n",
+       "       [1.190e+03, 1.000e+00],\n",
+       "       [1.214e+03, 1.000e+00],\n",
+       "       [1.224e+03, 1.000e+00],\n",
+       "       [1.322e+03, 1.000e+00],\n",
+       "       [1.399e+03, 1.000e+00],\n",
+       "       [1.480e+03, 1.000e+00],\n",
+       "       [1.503e+03, 1.000e+00],\n",
+       "       [1.549e+03, 1.000e+00],\n",
+       "       [1.567e+03, 1.000e+00],\n",
+       "       [1.607e+03, 1.000e+00],\n",
+       "       [1.615e+03, 1.000e+00],\n",
+       "       [1.657e+03, 1.000e+00],\n",
+       "       [1.688e+03, 1.000e+00],\n",
+       "       [1.695e+03, 1.000e+00],\n",
+       "       [1.714e+03, 1.000e+00],\n",
+       "       [1.811e+03, 1.000e+00],\n",
+       "       [1.813e+03, 1.000e+00],\n",
+       "       [1.910e+03, 1.000e+00],\n",
+       "       [1.986e+03, 1.000e+00],\n",
+       "       [1.996e+03, 1.000e+00],\n",
+       "       [2.049e+03, 1.000e+00],\n",
+       "       [2.053e+03, 1.000e+00],\n",
+       "       [2.075e+03, 1.000e+00],\n",
+       "       [2.081e+03, 1.000e+00],\n",
+       "       [2.103e+03, 1.000e+00],\n",
+       "       [2.204e+03, 1.000e+00],\n",
+       "       [2.209e+03, 1.000e+00],\n",
+       "       [2.215e+03, 1.000e+00],\n",
+       "       [2.239e+03, 1.000e+00],\n",
+       "       [2.272e+03, 1.000e+00],\n",
+       "       [2.281e+03, 1.000e+00],\n",
+       "       [2.349e+03, 1.000e+00],\n",
+       "       [2.351e+03, 1.000e+00],\n",
+       "       [2.373e+03, 1.000e+00],\n",
+       "       [2.377e+03, 1.000e+00],\n",
+       "       [2.388e+03, 1.000e+00],\n",
+       "       [2.411e+03, 1.000e+00],\n",
+       "       [2.412e+03, 1.000e+00],\n",
+       "       [2.419e+03, 1.000e+00],\n",
+       "       [2.424e+03, 1.000e+00],\n",
+       "       [2.488e+03, 1.000e+00],\n",
+       "       [2.510e+03, 1.000e+00],\n",
+       "       [2.512e+03, 1.000e+00],\n",
+       "       [2.533e+03, 1.000e+00],\n",
+       "       [2.545e+03, 1.000e+00],\n",
+       "       [2.588e+03, 1.000e+00],\n",
+       "       [2.616e+03, 1.000e+00],\n",
+       "       [2.617e+03, 1.000e+00],\n",
+       "       [2.629e+03, 1.000e+00],\n",
+       "       [2.658e+03, 1.000e+00],\n",
+       "       [2.695e+03, 1.000e+00],\n",
+       "       [2.715e+03, 1.000e+00],\n",
+       "       [2.766e+03, 1.000e+00],\n",
+       "       [2.772e+03, 1.000e+00],\n",
+       "       [2.800e+03, 1.000e+00],\n",
+       "       [2.888e+03, 1.000e+00],\n",
+       "       [2.996e+03, 1.000e+00],\n",
+       "       [3.027e+03, 1.000e+00],\n",
+       "       [3.118e+03, 1.000e+00],\n",
+       "       [3.153e+03, 1.000e+00],\n",
+       "       [3.149e+03, 1.000e+00],\n",
+       "       [3.149e+03, 1.000e+00],\n",
+       "       [3.173e+03, 1.000e+00],\n",
+       "       [3.237e+03, 1.000e+00],\n",
+       "       [3.245e+03, 1.000e+00],\n",
+       "       [3.266e+03, 1.000e+00],\n",
+       "       [3.275e+03, 1.000e+00],\n",
+       "       [3.286e+03, 1.000e+00],\n",
+       "       [3.302e+03, 1.000e+00],\n",
+       "       [3.308e+03, 1.000e+00],\n",
+       "       [3.323e+03, 1.000e+00],\n",
+       "       [3.342e+03, 1.000e+00],\n",
+       "       [3.346e+03, 1.000e+00],\n",
+       "       [3.422e+03, 1.000e+00],\n",
+       "       [3.453e+03, 1.000e+00],\n",
+       "       [3.453e+03, 1.000e+00],\n",
+       "       [3.500e+03, 1.000e+00],\n",
+       "       [3.530e+03, 1.000e+00],\n",
+       "       [3.570e+03, 1.000e+00],\n",
+       "       [3.576e+03, 1.000e+00],\n",
+       "       [3.614e+03, 1.000e+00],\n",
+       "       [3.636e+03, 1.000e+00],\n",
+       "       [3.661e+03, 1.000e+00],\n",
+       "       [3.693e+03, 1.000e+00],\n",
+       "       [3.716e+03, 1.000e+00],\n",
+       "       [3.773e+03, 1.000e+00],\n",
+       "       [3.790e+03, 1.000e+00],\n",
+       "       [3.806e+03, 1.000e+00],\n",
+       "       [3.843e+03, 1.000e+00],\n",
+       "       [3.848e+03, 1.000e+00],\n",
+       "       [3.848e+03, 1.000e+00],\n",
+       "       [3.851e+03, 1.000e+00],\n",
+       "       [3.973e+03, 1.000e+00],\n",
+       "       [3.976e+03, 1.000e+00],\n",
+       "       [3.878e+03, 1.000e+00],\n",
+       "       [3.963e+03, 1.000e+00],\n",
+       "       [3.985e+03, 1.000e+00],\n",
+       "       [4.079e+03, 1.000e+00],\n",
+       "       [4.080e+03, 1.000e+00],\n",
+       "       [4.107e+03, 1.000e+00],\n",
+       "       [4.118e+03, 1.000e+00],\n",
+       "       [4.133e+03, 1.000e+00],\n",
+       "       [4.156e+03, 1.000e+00],\n",
+       "       [4.194e+03, 1.000e+00],\n",
+       "       [4.195e+03, 1.000e+00],\n",
+       "       [4.207e+03, 1.000e+00],\n",
+       "       [4.212e+03, 1.000e+00],\n",
+       "       [4.213e+03, 1.000e+00],\n",
+       "       [4.213e+03, 1.000e+00],\n",
+       "       [4.216e+03, 1.000e+00],\n",
+       "       [4.235e+03, 1.000e+00],\n",
+       "       [4.258e+03, 1.000e+00],\n",
+       "       [4.273e+03, 1.000e+00],\n",
+       "       [4.277e+03, 1.000e+00],\n",
+       "       [4.290e+03, 1.000e+00],\n",
+       "       [4.336e+03, 1.000e+00],\n",
+       "       [4.339e+03, 1.000e+00],\n",
+       "       [4.352e+03, 1.000e+00],\n",
+       "       [4.383e+03, 1.000e+00],\n",
+       "       [4.385e+03, 1.000e+00],\n",
+       "       [4.441e+03, 1.000e+00],\n",
+       "       [4.492e+03, 1.000e+00],\n",
+       "       [4.518e+03, 1.000e+00],\n",
+       "       [4.554e+03, 1.000e+00],\n",
+       "       [4.565e+03, 1.000e+00],\n",
+       "       [4.610e+03, 1.000e+00],\n",
+       "       [4.628e+03, 1.000e+00],\n",
+       "       [4.637e+03, 1.000e+00],\n",
+       "       [4.638e+03, 1.000e+00],\n",
+       "       [4.700e+03, 1.000e+00],\n",
+       "       [4.700e+03, 1.000e+00],\n",
+       "       [4.701e+03, 1.000e+00],\n",
+       "       [4.708e+03, 1.000e+00],\n",
+       "       [4.750e+03, 1.000e+00],\n",
+       "       [4.751e+03, 1.000e+00],\n",
+       "       [4.764e+03, 1.000e+00],\n",
+       "       [4.780e+03, 1.000e+00],\n",
+       "       [4.806e+03, 1.000e+00],\n",
+       "       [4.822e+03, 1.000e+00],\n",
+       "       [4.848e+03, 1.000e+00],\n",
+       "       [4.858e+03, 1.000e+00],\n",
+       "       [4.861e+03, 1.000e+00],\n",
+       "       [4.862e+03, 1.000e+00],\n",
+       "       [4.888e+03, 1.000e+00],\n",
+       "       [4.891e+03, 1.000e+00],\n",
+       "       [4.914e+03, 1.000e+00],\n",
+       "       [4.918e+03, 1.000e+00],\n",
+       "       [4.932e+03, 1.000e+00],\n",
+       "       [4.944e+03, 1.000e+00],\n",
+       "       [4.948e+03, 1.000e+00],\n",
+       "       [4.964e+03, 1.000e+00],\n",
+       "       [4.975e+03, 1.000e+00],\n",
+       "       [5.001e+03, 1.000e+00],\n",
+       "       [5.002e+03, 1.000e+00],\n",
+       "       [5.072e+03, 1.000e+00],\n",
+       "       [5.135e+03, 1.000e+00],\n",
+       "       [5.199e+03, 1.000e+00],\n",
+       "       [5.353e+03, 1.000e+00],\n",
+       "       [5.358e+03, 1.000e+00],\n",
+       "       [5.361e+03, 1.000e+00],\n",
+       "       [5.489e+03, 1.000e+00],\n",
+       "       [5.495e+03, 1.000e+00],\n",
+       "       [5.505e+03, 1.000e+00],\n",
+       "       [5.530e+03, 1.000e+00],\n",
+       "       [5.578e+03, 1.000e+00],\n",
+       "       [5.583e+03, 1.000e+00],\n",
+       "       [5.588e+03, 1.000e+00],\n",
+       "       [5.599e+03, 1.000e+00],\n",
+       "       [5.641e+03, 1.000e+00],\n",
+       "       [5.643e+03, 1.000e+00],\n",
+       "       [5.650e+03, 1.000e+00],\n",
+       "       [5.661e+03, 1.000e+00],\n",
+       "       [5.702e+03, 1.000e+00],\n",
+       "       [5.728e+03, 1.000e+00],\n",
+       "       [5.752e+03, 1.000e+00],\n",
+       "       [5.753e+03, 1.000e+00],\n",
+       "       [5.755e+03, 1.000e+00],\n",
+       "       [5.775e+03, 1.000e+00]])"
+      ]
+     },
+     "execution_count": 11,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "events.time"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 12,
+   "id": "fcc2c653-f234-46ce-bbd9-a13fa01d977d",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "numpy.random.seed(100)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 13,
+   "id": "e0422470-af63-47a0-ba5b-40d0e2975824",
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stderr",
+     "output_type": "stream",
+     "text": [
+      "/tmp/ipykernel_3204526/489981337.py:1: DeprecationWarning: This function is deprecated. Use Knox\n",
+      "  result = knox(events.space, events.t, delta=20, tau=5, permutations=99)\n"
+     ]
+    }
+   ],
+   "source": [
+    "result = knox(events.space, events.t, delta=20, tau=5, permutations=99)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 14,
+   "id": "2b7576e8-42dc-4fed-841f-bab6d105d557",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{'stat': 13, 'pvalue': array([0.17])}"
+      ]
+     },
+     "execution_count": 14,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "result"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 15,
+   "id": "4c0fe4ab-8884-4709-9b43-683b1ac14eb0",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(188, 2)"
+      ]
+     },
+     "execution_count": 15,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "events.space.shape"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 16,
+   "id": "082197b3-a7cc-4829-8e74-045943e28675",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(188, 1)"
+      ]
+     },
+     "execution_count": 16,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "events.t.shape"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "50ea59b1-d82f-4fbf-97b0-55aac4ead2b4",
+   "metadata": {},
+   "source": [
+    "## New Implementation\n",
+    "\n",
+    "- Global Knox with analytical inference\n",
+    "- Global Knox with space/time distance queries\n",
+    "- Local Knox with analytical inference\n",
+    "- Local Knox with conditional permutations\n",
+    "- Better Reporting"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 17,
+   "id": "4d60c4c9-95ee-42c3-b458-bfce15315292",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import geopandas"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 18,
+   "id": "2653a3e2-af07-431e-9001-2f0d0f55cc9f",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "df = geopandas.read_file(path)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 19,
+   "id": "d44e2752-1711-492c-819e-ce621db4ad70",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/html": [
+       "<div>\n",
+       "<style scoped>\n",
+       "    .dataframe tbody tr th:only-of-type {\n",
+       "        vertical-align: middle;\n",
+       "    }\n",
+       "\n",
+       "    .dataframe tbody tr th {\n",
+       "        vertical-align: top;\n",
+       "    }\n",
+       "\n",
+       "    .dataframe thead th {\n",
+       "        text-align: right;\n",
+       "    }\n",
+       "</style>\n",
+       "<table border=\"1\" class=\"dataframe\">\n",
+       "  <thead>\n",
+       "    <tr style=\"text-align: right;\">\n",
+       "      <th></th>\n",
+       "      <th>ID</th>\n",
+       "      <th>X</th>\n",
+       "      <th>Y</th>\n",
+       "      <th>T</th>\n",
+       "      <th>AGE</th>\n",
+       "      <th>DATE</th>\n",
+       "      <th>geometry</th>\n",
+       "    </tr>\n",
+       "  </thead>\n",
+       "  <tbody>\n",
+       "    <tr>\n",
+       "      <th>0</th>\n",
+       "      <td>1.0</td>\n",
+       "      <td>300.0</td>\n",
+       "      <td>302.0</td>\n",
+       "      <td>413.0</td>\n",
+       "      <td>22.0</td>\n",
+       "      <td>1901-02-16</td>\n",
+       "      <td>POINT (300.000 302.000)</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>1</th>\n",
+       "      <td>2.0</td>\n",
+       "      <td>291.0</td>\n",
+       "      <td>270.0</td>\n",
+       "      <td>472.0</td>\n",
+       "      <td>5.0</td>\n",
+       "      <td>1901-04-16</td>\n",
+       "      <td>POINT (291.000 270.000)</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>2</th>\n",
+       "      <td>3.0</td>\n",
+       "      <td>326.0</td>\n",
+       "      <td>263.0</td>\n",
+       "      <td>511.0</td>\n",
+       "      <td>12.0</td>\n",
+       "      <td>1901-05-25</td>\n",
+       "      <td>POINT (326.000 263.000)</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>3</th>\n",
+       "      <td>4.0</td>\n",
+       "      <td>299.0</td>\n",
+       "      <td>376.0</td>\n",
+       "      <td>689.0</td>\n",
+       "      <td>6.0</td>\n",
+       "      <td>1901-11-19</td>\n",
+       "      <td>POINT (299.000 376.000)</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>4</th>\n",
+       "      <td>5.0</td>\n",
+       "      <td>267.0</td>\n",
+       "      <td>327.0</td>\n",
+       "      <td>730.0</td>\n",
+       "      <td>4.0</td>\n",
+       "      <td>1901-12-30</td>\n",
+       "      <td>POINT (267.000 327.000)</td>\n",
+       "    </tr>\n",
+       "  </tbody>\n",
+       "</table>\n",
+       "</div>"
+      ],
+      "text/plain": [
+       "    ID      X      Y      T   AGE        DATE                 geometry\n",
+       "0  1.0  300.0  302.0  413.0  22.0  1901-02-16  POINT (300.000 302.000)\n",
+       "1  2.0  291.0  270.0  472.0   5.0  1901-04-16  POINT (291.000 270.000)\n",
+       "2  3.0  326.0  263.0  511.0  12.0  1901-05-25  POINT (326.000 263.000)\n",
+       "3  4.0  299.0  376.0  689.0   6.0  1901-11-19  POINT (299.000 376.000)\n",
+       "4  5.0  267.0  327.0  730.0   4.0  1901-12-30  POINT (267.000 327.000)"
+      ]
+     },
+     "execution_count": 19,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "df.head()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 20,
+   "id": "10469df1-d859-4652-a0c2-0ee5468110b4",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "<Axes: >"
+      ]
+     },
+     "execution_count": 20,
+     "metadata": {},
+     "output_type": "execute_result"
+    },
+    {
+     "data": {
+      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPoAAAGdCAYAAAA7am5rAAAAOXR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//7vwwAu3HjhsmY5ORk9uc//9lpcxaC4f4MtLe3s7lz57Lk5GT266+/Wv28K/9uZKM7EMYYcnJy8Pnnn+PAgQNISEjgHLt161akpKRg+PDhVs976tQpdHR0IDpaWtsLM8ag0+mMy9XuS9T29naUlZUZm4ukpKTA39/fZEx9fT1qa2s5G5C4GsP9AV2aPCsrCz/++CP279/fqzzbHC79uzn9p8WLeOGFF5hCoWCHDh0yCbHcunXLZJxGo2F9+vRhRUVFvc7x008/sbVr17Ljx4+zuro6tmfPHnb//fezkSNHujQMlZ+fzw4fPszq6urYyZMn2apVq5iPjw/76quvGGNd4TWFQsE+//xzVlNTw5588kmz4bXY2Fi2f/9+VlVVxaZOnSqZ8Jql++vo6GCZmZksNjaWVVdXm/xtdTodY0x6fzcSdAcCwOzr448/Nhn33nvvsaCgILMx1l9++YVNmjSJhYeHM7lczu677z724osvsuvXrzvpLszz+9//nsXHxzO5XM7uuusuNm3aNKOQM9a1TH311VeZUqlkAQEBbNKkSaympsbkHK2trSwnJ4eFh4ezoKAglpGRwX755Rdn34pZLN1fXV0d59/24MGDjDHp/d2oTJUgvACy0QnCCyBBJwgvgASdILwAEnSC8AJI0AnCCyBBJwgvgASdILwAEnSC8AJI0AnCCyBBJwgvgASdILwAEnSC8AL+P8AUJjWv8wV7AAAAAElFTkSuQmCC",
+      "text/plain": [
+       "<Figure size 640x480 with 1 Axes>"
+      ]
+     },
+     "metadata": {},
+     "output_type": "display_data"
+    }
+   ],
+   "source": [
+    "df.plot()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 21,
+   "id": "8fde7933-82b4-41db-99b0-90bac7481c49",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "from pointpats.spacetime import Knox"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 22,
+   "id": "4b5e2057-39b2-4b9b-aafc-e16758558578",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "results = Knox(df[['X', 'Y']], df[[\"T\"]], delta=20, tau=5)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 23,
+   "id": "57c4ea44-538c-42d5-9b04-71e3ccb1619f",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "13"
+      ]
+     },
+     "execution_count": 23,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "results.statistic_"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 24,
+   "id": "48d141cc-b604-419d-bfc5-9ff46696e1d4",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "0.28"
+      ]
+     },
+     "execution_count": 24,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "results.p_sim"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 25,
+   "id": "f8951730-4f33-47f2-8936-d459046b5778",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "0.14624558197140414"
+      ]
+     },
+     "execution_count": 25,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "results.p_poisson"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 26,
+   "id": "7b67a026-0b33-4a20-9394-bc07f8c964e4",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "numpy.random.seed(123456)\n",
+    "results = Knox(df[['X', 'Y']], df[[\"T\"]], delta=20, tau=5,keep=True)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 27,
+   "id": "2b8f3e5c-2fe4-49da-999f-f56002e5a2f4",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([[1.300e+01, 3.416e+03],\n",
+       "       [3.900e+01, 1.411e+04]])"
+      ]
+     },
+     "execution_count": 27,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "results.observed"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 28,
+   "id": "cc201594-dc3d-40d5-8958-7eea166ca3c7",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([[1.01438161e+01, 3.41885618e+03],\n",
+       "       [4.18561839e+01, 1.41071438e+04]])"
+      ]
+     },
+     "execution_count": 28,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "results.expected"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 29,
+   "id": "43185747-b6ae-4381-aa22-2401933c8d30",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "True"
+      ]
+     },
+     "execution_count": 29,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "results.keep"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 30,
+   "id": "fc52cc8f-6e23-406b-8f8d-4c9d2b3b5dd5",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "0.24"
+      ]
+     },
+     "execution_count": 30,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "results.p_sim"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 31,
+   "id": "c43b4594-8d3f-4a9b-b10f-0faa7ee44d09",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "results = Knox(df[['X', 'Y']], df[[\"T\"]], delta=20, tau=5, keep=True)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 32,
+   "id": "222cd0e9-2b19-4bd0-a436-a45ed3fa80ce",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "True"
+      ]
+     },
+     "execution_count": 32,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "hasattr(results, \"sim\")"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 33,
+   "id": "b96c1cfd-1a80-469f-9257-19356109dc70",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([16., 10., 13.,  7., 10.,  9.,  8., 10., 10.,  9.,  7., 14.,  9.,\n",
+       "       11., 11., 13.,  8.,  9.,  8.,  8.,  8.,  7.,  8., 13.,  8., 12.,\n",
+       "       10., 11.,  9., 12.,  8.,  6.,  9., 11., 12., 16., 14., 11., 13.,\n",
+       "       12., 11.,  8., 13.,  7., 10.,  4.,  8., 14.,  9., 12., 12.,  6.,\n",
+       "        8., 10.,  8.,  9.,  7.,  8., 11., 12., 10., 17., 10.,  8., 12.,\n",
+       "       13.,  9.,  8.,  9., 10., 11.,  6., 10., 13., 17., 11.,  8.,  8.,\n",
+       "       10.,  7., 10.,  9., 13., 10.,  7., 13.,  6.,  9., 11.,  9., 14.,\n",
+       "       14.,  6., 11., 13., 12., 10., 10., 11.])"
+      ]
+     },
+     "execution_count": 33,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "results.sim"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 35,
+   "id": "06145a2b-6c8f-4cc7-abaa-e840cdabb197",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "from pointpats.spacetime import KnoxLocal\n",
+    "numpy.random.seed(12345)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 36,
+   "id": "1d8a9059-c1d2-428b-a58a-cdd1658ab150",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "lres = results = KnoxLocal(df[['X', 'Y']], df[[\"T\"]], delta=20, tau=5)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 37,
+   "id": "aff0fa64-dda0-41ca-a614-1254273ed136",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(188,)"
+      ]
+     },
+     "execution_count": 37,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "lres.statistic_.shape"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 38,
+   "id": "02a8b0ef-daf3-4cd6-afe4-2d0a791a0942",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(array([ 25,  26,  30,  31,  35,  36,  41,  42,  46,  47,  51,  52, 102,\n",
+       "        103, 116, 118, 122, 123, 137, 138, 139, 140, 158, 159, 162, 163]),)"
+      ]
+     },
+     "execution_count": 38,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "gt0ids = numpy.where(lres.nsti>0)\n",
+    "gt0ids"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 39,
+   "id": "0e9b36af-e7f9-44d5-9c28-e6b9fc49f675",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,\n",
+       "       1., 1., 1., 1., 1., 1., 1., 1., 1.])"
+      ]
+     },
+     "execution_count": 39,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "lres.nsti[gt0ids]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 40,
+   "id": "aa74c51b-2a2d-4992-b244-6031aef4e6af",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([0.1348993 , 0.14220663, 0.07335085, 0.08400282, 0.1494317 ,\n",
+       "       0.21524073, 0.0175806 , 0.04599869, 0.17523687, 0.18209188,\n",
+       "       0.19111321, 0.16830444, 0.13734428, 0.14703242, 0.06796364,\n",
+       "       0.03192559, 0.13734428, 0.17523687, 0.12998154, 0.1933476 ,\n",
+       "       0.13244507, 0.13244507, 0.12502644, 0.14703242, 0.12502644,\n",
+       "       0.12998154])"
+      ]
+     },
+     "execution_count": 40,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "lres.p_hypergeom[gt0ids]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 41,
+   "id": "f252aad8-e872-4217-9549-c644da41b4c4",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([0.3 , 0.33, 0.11, 0.17, 0.3 , 0.42, 0.06, 0.06, 0.33, 0.34, 0.36,\n",
+       "       0.38, 0.3 , 0.29, 0.41, 0.19, 0.31, 0.39, 0.18, 0.39, 0.48, 0.41,\n",
+       "       0.22, 0.41, 0.39, 0.32])"
+      ]
+     },
+     "execution_count": 41,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "lres.p_sims[gt0ids]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "f6377b09-2b94-4fd3-9f85-9c378c015464",
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3 (ipykernel)",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.11.4"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/pointpats/spacetime.py b/pointpats/spacetime.py
index 61d7039..905eae1 100644
--- a/pointpats/spacetime.py
+++ b/pointpats/spacetime.py
@@ -2,17 +2,38 @@
 Methods for identifying space-time interaction in spatio-temporal event
 data.
 """
-__author__ = "Nicholas Malizia <nmalizia@asu.edu>", "Sergio J. Rey \
-<srey@asu.edu>", "Philip Stephens <philip.stephens@asu.edu"
-
-__all__ = ['SpaceTimeEvents', 'knox', 'mantel', 'jacquez', 'modified_knox']
+__author__ = (
+    "Eli Knaap <eknaap@sdsu.edu>",
+    "Nicholas Malizia <nmalizia@asu.edu>",
+    "Sergio J. Rey <srey@sdsu.edu>",
+    "Philip Stephens <philip.stephens@asu.edu",
+)
+
+__all__ = [
+    "SpaceTimeEvents",
+    "knox",
+    "mantel",
+    "jacquez",
+    "modified_knox",
+    "Knox",
+    "KnoxLocal",
+]
 
 import os
+from datetime import date
+from functools import cached_property
+from warnings import warn
+
+import geopandas as gpd
 import libpysal as lps
 import numpy as np
+import pandas
 import scipy.stats as stats
 from libpysal import cg
-from datetime import date
+from pandas.api.types import is_numeric_dtype
+from scipy.spatial import KDTree
+from scipy.stats import hypergeom, poisson
+
 
 class SpaceTimeEvents:
     """
@@ -113,10 +134,11 @@ class SpaceTimeEvents:
     >>> (events.t[1][0] - events.t[0][0]).days
     59
     """
+
     def __init__(self, path, time_col, infer_timestamp=False):
         shp = lps.io.open(path)
         head, tail = os.path.split(path)
-        dbf_tail = tail.split(".")[0]+".dbf"
+        dbf_tail = tail.split(".")[0] + ".dbf"
         dbf = lps.io.open(lps.examples.get_path(dbf_tail))
 
         # extract the spatial coordinates from the shapefile
@@ -138,8 +160,10 @@ def __init__(self, path, time_col, infer_timestamp=False):
                 col = [(d - day1).days for d in col]
                 t = np.array(col)
             else:
-                print("Unable to parse your time column as Python datetime \
-                      objects, proceeding as integers.")
+                print(
+                    "Unable to parse your time column as Python datetime \
+                      objects, proceeding as integers."
+                )
                 t = np.array(col)
         else:
             t = np.array(dbf.by_col(time_col))
@@ -223,6 +247,7 @@ def knox(s_coords, t_coords, delta, tau, permutations=99, debug=False):
     >>> print("%2.2f"%result['pvalue'])
     0.17
     """
+    warn("This function is deprecated. Use Knox", DeprecationWarning, stacklevel=2)
 
     # Do a kdtree on space first as the number of ties (identical points) is
     # likely to be lower for space than time.
@@ -238,7 +263,7 @@ def knox(s_coords, t_coords, delta, tau, permutations=99, debug=False):
     d_t = (t_coords[ids[:, 0]] - t_coords[ids[:, 1]]) ** 2
     n_st = sum(d_t <= tau2)
 
-    knox_result = {'stat': n_st[0]}
+    knox_result = {"stat": n_st[0]}
 
     if permutations:
         joint = np.zeros((permutations, 1), int)
@@ -250,12 +275,14 @@ def knox(s_coords, t_coords, delta, tau, permutations=99, debug=False):
         larger = sum(joint >= n_st[0])
         if (permutations - larger) < larger:
             larger = permutations - larger
-        p_sim = (larger + 1.) / (permutations + 1.)
-        knox_result['pvalue'] = p_sim
+        p_sim = (larger + 1.0) / (permutations + 1.0)
+        knox_result["pvalue"] = p_sim
     return knox_result
 
 
-def mantel(s_coords, t_coords, permutations=99, scon=1.0, spow=-1.0, tcon=1.0, tpow=-1.0):
+def mantel(
+    s_coords, t_coords, permutations=99, scon=1.0, spow=-1.0, tcon=1.0, tpow=-1.0
+):
     """
     Standardized Mantel test for spatio-temporal interaction. :cite:`Mantel:1967`
 
@@ -339,8 +366,8 @@ def mantel(s_coords, t_coords, permutations=99, scon=1.0, spow=-1.0, tcon=1.0, t
     timemat = cg.distance_matrix(t)
 
     # calculate the transformed standardized statistic
-    timevec = (timemat[np.tril_indices(timemat.shape[0], k = -1)] + tcon) ** tpow
-    distvec = (distmat[np.tril_indices(distmat.shape[0], k = -1)] + scon) ** spow
+    timevec = (timemat[np.tril_indices(timemat.shape[0], k=-1)] + tcon) ** tpow
+    distvec = (distmat[np.tril_indices(distmat.shape[0], k=-1)] + scon) ** spow
     stat = stats.pearsonr(timevec, distvec)[0].sum()
 
     # return the results (if no inference)
@@ -351,7 +378,7 @@ def mantel(s_coords, t_coords, permutations=99, scon=1.0, spow=-1.0, tcon=1.0, t
     dist = []
     for i in range(permutations):
         trand = _shuffle_matrix(timemat, np.arange(n))
-        timevec = (trand[np.tril_indices(trand.shape[0], k = -1)] + tcon) ** tpow
+        timevec = (trand[np.tril_indices(trand.shape[0], k=-1)] + tcon) ** tpow
         m = stats.pearsonr(timevec, distvec)[0].sum()
         dist.append(m)
 
@@ -362,7 +389,7 @@ def mantel(s_coords, t_coords, permutations=99, scon=1.0, spow=-1.0, tcon=1.0, t
     pvalue = (count + 1.0) / (permutations + 1.0)
 
     # report the results
-    mantel_result = {'stat': stat, 'pvalue': pvalue}
+    mantel_result = {"stat": stat, "pvalue": pvalue}
     return mantel_result
 
 
@@ -409,14 +436,14 @@ def jacquez(s_coords, t_coords, k, permutations=99):
     The Jacquez test counts the number of events that are k nearest
     neighbors in both time and space. The following runs the Jacquez test
     on the example data and reports the resulting statistic. In this case,
-    there are 13 instances where events are nearest neighbors in both space
+    there are 12 instances where events are nearest neighbors in both space
     and time.
     # turning off as kdtree changes from scipy < 0.12 return 13
 
     >>> np.random.seed(100)
     >>> result = jacquez(events.space, events.t ,k=3,permutations=99)
     >>> print(result['stat'])
-    13
+    12
 
     The significance of this can be assessed by calling the p-
     value from the results dictionary, as shown below. Again, no
@@ -477,7 +504,7 @@ def jacquez(s_coords, t_coords, k, permutations=99):
     pvalue = (count + 1.0) / (permutations + 1.0)
 
     # report the results
-    jacquez_result = {'stat': stat, 'pvalue': pvalue}
+    jacquez_result = {"stat": stat, "pvalue": pvalue}
     return jacquez_result
 
 
@@ -566,7 +593,7 @@ def modified_knox(s_coords, t_coords, delta, tau, permutations=99):
 
     # calculate the observed (original) statistic
     knoxmat = timemat * spacmat
-    obsstat = (knoxmat.sum() - n)
+    obsstat = knoxmat.sum() - n
 
     # calculate the expectated value
     ssumvec = np.reshape((spacbin.sum(axis=0) - 1), (n, 1))
@@ -590,7 +617,7 @@ def modified_knox(s_coords, t_coords, delta, tau, permutations=99):
 
         # calculate the observed knox again
         knoxmat = timemat * spacmat
-        obsstat = (knoxmat.sum() - n)
+        obsstat = knoxmat.sum() - n
 
         # calculate the expectated value again
         ssumvec = np.reshape((spacbin.sum(axis=0) - 1), (n, 1))
@@ -608,9 +635,10 @@ def modified_knox(s_coords, t_coords, delta, tau, permutations=99):
     pvalue = (count + 1.0) / (permutations + 1.0)
 
     # return results
-    modknox_result = {'stat': stat, 'pvalue': pvalue}
+    modknox_result = {"stat": stat, "pvalue": pvalue}
     return modknox_result
 
+
 def _shuffle_matrix(X, ids):
     """
     Random permutation of rows and columns of a matrix
@@ -629,3 +657,860 @@ def _shuffle_matrix(X, ids):
     """
     np.random.shuffle(ids)
     return X[ids, :][:, ids]
+
+
+def _knox(s_coords, t_coords, delta, tau, permutations=99, keep=False):
+    """
+    Parameters
+    ==========
+
+    s_coords: array-like
+      spatial coordinates
+    t_coords: array-like
+      temporal coordinates
+    delta: float
+      distance threshold
+    tau: float
+      temporal threshold
+    permutations: int
+      number of permutations
+    keep: bool
+      return values from permutations (default False)
+
+
+    Returns
+    =======
+
+    summary table observed
+    summary table h0
+
+    ns
+    nt
+    nst
+    n
+    p-value
+    """
+
+    n = s_coords.shape[0]
+
+    stree = KDTree(s_coords)
+    ttree = KDTree(t_coords)
+    sneighbors = stree.query_ball_tree(stree, r=delta)
+    sneighbors = [
+        set(neighbors).difference([i]) for i, neighbors in enumerate(sneighbors)
+    ]
+    tneighbors = ttree.query_ball_tree(ttree, r=tau)
+    tneighbors = [
+        set(neighbors).difference([i]) for i, neighbors in enumerate(tneighbors)
+    ]
+
+    # number of spatial neighbor pairs
+    ns = np.array([len(neighbors) for neighbors in sneighbors])  # by i
+
+    NS = ns.sum() / 2  # total
+
+    # number of temporal neigbor pairs
+    nt = np.array([len(neighbors) for neighbors in tneighbors])
+    NT = nt.sum() / 2
+
+    # s-t neighbors (list of lists)
+    stneighbors = [
+        sneighbors_i.intersection(tneighbors_i)
+        for sneighbors_i, tneighbors_i in zip(sneighbors, tneighbors)
+    ]
+
+    # number of spatio-temporal neigbor pairs
+    nst = np.array([len(neighbors) for neighbors in stneighbors])
+    NST = nst.sum() / 2
+
+    all_pairs = []
+    pairs = {}
+    for i, neigh in enumerate(stneighbors):
+        if len(neigh) > 0:
+            all_pairs.extend([sorted((i, j)) for j in neigh])
+    st_pairs = set([tuple(l) for l in all_pairs])
+
+    # ENST: expected number of spatio-temporal neighbors under HO
+    pairs = n * (n - 1) / 2
+    ENST = NS * NT / pairs
+
+    # observed table
+    observed = np.zeros((2, 2))
+
+    NS_ = NS - NST  # spatial only
+    NT_ = NT - NST  # temporal only
+
+    observed[0, 0] = NST
+    observed[0, 1] = NS_
+    observed[1, 0] = NT_
+    observed[1, 1] = pairs - NST - NS_ - NT_
+
+    # expected table
+
+    expected = np.zeros((2, 2))
+    expected[0, 0] = ENST
+    expected[0, 1] = NS - expected[0, 0]
+    expected[1, 0] = NT - expected[0, 0]
+    expected[1, 1] = pairs - expected.sum()
+
+    p_value_poisson = 1 - poisson.cdf(NST, expected[0, 0])
+
+    results = {}
+    results["ns"] = ns.sum() / 2
+    results["nt"] = nt.sum() / 2
+    results["nst"] = nst.sum() / 2
+    results["pairs"] = pairs
+    results["expected"] = expected
+    results["observed"] = observed
+    results["p_value_poisson"] = p_value_poisson
+    results["st_pairs"] = st_pairs
+    results["sneighbors"] = sneighbors
+    results["tneighbors"] = tneighbors
+    results["stneighbors"] = stneighbors
+
+    if permutations > 0:
+        exceedence = 0
+        n = len(sneighbors)
+        ids = np.arange(n)
+        if keep:
+            ST = np.zeros(permutations)
+
+        for perm in range(permutations):
+            st = 0
+            rids = np.random.permutation(ids)
+            for i in range(n):
+                ri = rids[i]
+                tni = tneighbors[ri]
+                rjs = [rids[j] for j in sneighbors[i]]
+                sti = [j for j in rjs if j in tni]
+                st += len(sti)
+            st /= 2
+            if st >= results["nst"]:
+                exceedence += 1
+            if keep:
+                ST[perm] = st
+        results["p_value_sim"] = (exceedence + 1) / (permutations + 1)
+        results["exceedence"] = exceedence
+        if keep:
+            results["st_perm"] = ST
+
+    return results
+
+
+class Knox:
+    """
+    Global Knox statistic for space-time interactions
+
+    Parameters
+    ----------
+
+    s_coords: array-like
+      spatial coordinates of point events
+
+    t_coords: array-like
+      temporal coordinates of point events (floats or ints, not dateTime)
+
+    delta: float
+      spatial threshold defining distance below which pairs are spatial
+      neighbors
+
+    tau: float
+      temporal threshold defining distance below which pairs are temporal
+      neighbors
+
+    permutations: int
+      number of random permutations for inference
+
+    keep: bool
+      whether to store realized values of the statistic under permutations
+
+
+
+    Attributes
+    ----------
+
+    s_coords: array-like
+      spatial coordinates of point events
+
+    t_coords: array-like
+      temporal coordinates of point events (floats or ints, not dateTime)
+
+    delta: float
+      spatial threshold defining distance below which pairs are spatial
+      neighbors
+
+    tau: float
+      temporal threshold defining distance below which pairs are temporal
+      neighbors
+
+    permutations: int
+      number of random permutations for inference
+
+    keep: bool
+      whether to store realized values of the statistic under permutations
+
+    nst: int
+      number of space-time pairs
+
+    p_poisson: float
+      Analytical p-value under Poisson assumption
+
+    p_sim: float
+      Pseudo p-value based on random permutations
+
+    expected: array
+      Two-by-two array with expected counts under the null of no space-time
+      interactions. [[NST, NS_], [NT_, N__]] where NST is the expected number
+      of space-time pairs, NS_ is the expected number of spatial (but not also
+      temporal) pairs, NT_ is the number of expected temporal (but not also
+      spatial pairs), N__ is the number of pairs that are neighor spatial or
+      temporal neighbors.
+
+    observed: array
+      Same structure as expected with the observed pair classifications
+
+    sim: array
+      Global statistics from permutations (if keep=True)
+
+
+    Notes
+    -----
+
+    Technical details can be found in :cite:`Rogerson:2001`
+
+
+    Examples
+    --------
+    >>> import libpysal
+    >>> path = libpysal.examples.get_path('burkitt.shp')
+    >>> import geopandas
+    >>> df = geopandas.read_file(path)
+    >>> from pointpats.spacetime import Knox
+    >>> global_knox = Knox(df[['X', 'Y']], df[["T"]], delta=20, tau=5)
+    >>> global_knox.statistic_
+    13
+    >>> global_knox.p_poisson
+    0.14624558197140414
+    >>> global_knox.observed
+    array([[1.300e+01, 3.416e+03],
+           [3.900e+01, 1.411e+04]])
+    >>> global_knox.expected
+    array([[1.01438161e+01, 3.41885618e+03],
+           [4.18561839e+01, 1.41071438e+04]])
+    >>> hasattr(global_knox, 'sim')
+    False
+    >>> import numpy
+    >>> numpy.random.seed(12345)
+    >>> global_knox = Knox(df[['X', 'Y']], df[["T"]], delta=20, tau=5, keep=True)
+    >>> hasattr(global_knox, 'sim')
+    True
+    >>> global_knox.p_sim
+    0.21
+    """
+
+    def __init__(self, s_coords, t_coords, delta, tau, permutations=99, keep=False):
+        self.s_coords = s_coords
+        self.t_coords = t_coords
+        self.delta = delta
+        self.tau = tau
+        self.permutations = permutations
+        self.keep = keep
+        results = _knox(s_coords, t_coords, delta, tau, permutations, keep)
+        self.nst = int(results["nst"])
+        if permutations > 0:
+            self.p_sim = results["p_value_sim"]
+            if keep:
+                self.sim = results["st_perm"]
+
+        self.p_poisson = results["p_value_poisson"]
+        self.observed = results["observed"]
+        self.expected = results["expected"]
+        self.statistic_ = self.nst
+
+    @classmethod
+    def from_dataframe(
+        cls,
+        dataframe,
+        time_col: int,
+        delta: int,
+        tau: int,
+        permutations: int = 99,
+        keep: bool = False,
+    ):
+        """Compute a Knox statistic from a dataframe of Point observations
+
+        Parameters
+        ----------
+        dataframe : geopandas.GeoDataFrame
+            geodataframe holding observations. Should be in a projected coordinate
+            system with geometries stored as Point
+        time_col : str
+            column in the dataframe storing the time values (integer coordinate)
+            for each observation. For example if the observations are stored with
+            a timestamp, the time_col should be converted to a series of integers
+            representing, e.g. hours, days, seconds, etc.
+        delta : int
+            delta parameter defining the spatial neighbor threshold measured in the
+            same units as the dataframe CRS
+        tau : int
+            tau parameter defining the temporal neihgbor threshold (in the units
+            measured by `time_col`)
+        permutations : int, optional
+            permutations to use for computation inference, by default 99
+        keep : bool
+            whether to store realized values of the statistic under permutations
+
+        Returns
+        -------
+        pointpats.spacetime.Knox
+            a fitted Knox class
+
+        """
+        s_coords, t_coords = _spacetime_points_to_arrays(dataframe, time_col)
+
+        return cls(s_coords, dataframe[[time_col]], delta, tau, permutations, keep)
+
+
+def _knox_local(s_coords, t_coords, delta, tau, permutations=99, keep=False, crit=0.05):
+    """
+
+    Parameters
+    ----------
+
+    s_coords: array (nx2)
+        spatial coordinates
+
+    t_coords: array (nx1)
+        temporal coordinates
+
+    delta: numeric
+        spatial threshold distance for neighbor relation
+
+    tau: numeric
+        temporal threshold distance for neighbor relation
+
+    permutations: int
+        number of permutations for conditional randomization inference
+
+    keep: bool
+        whether to store local statistics from the permtuations
+
+    crit: float
+        signficance level for determination of hot spots
+
+    """
+    # think about passing in the global object as an option to avoid recomputing the trees
+    res = _knox(s_coords, t_coords, delta, tau, permutations=permutations)
+    sneighbors = {i: tuple(ns) for i, ns in enumerate(res["sneighbors"])}
+    tneighbors = {i: tuple(nt) for i, nt in enumerate(res["tneighbors"])}
+
+    n = len(s_coords)
+    ids = np.arange(n)
+    res["nsti"] = np.zeros(n)  # number of observed st_pairs for observation i
+    res["nsi"] = [len(r) for r in res["sneighbors"]]
+    res["nti"] = [len(r) for r in res["tneighbors"]]
+    for pair in res["st_pairs"]:
+        i, j = pair
+        res["nsti"][i] += 1
+        res["nsti"][j] += 1
+
+    nsti = res["nsti"]
+    nsi = res["nsi"]
+    nti = res["nti"]
+
+    # rather than do n*permutations, we reuse the permutations
+    # ensuring that each permutation is conditional on a focal unit i
+    # for each of the permutations we loop over i and swap labels between the
+    # label at index i in the current permutation and the label at the index
+    # assigned i in the permutation.
+
+    if permutations > 0:
+        exceedence = np.zeros(n)
+        if keep:
+            STI = np.zeros((n, permutations))
+        for perm in range(permutations):
+            rids = np.random.permutation(ids)
+            for i in range(n):
+                rids_i = rids.copy()
+                # set observed value of focal unit i
+                # swap with value assigned to rids[i]
+                # example
+                # 0 1 2 (ids)
+                # 2 0 1 (rids)
+                # i=0
+                # 0 2 1 (rids_i)
+                # i=1
+                # 2 1 0 (rids_i)
+                # i=2
+                # 1 0 2 (rids_i)
+
+                rids_i[rids == i] = rids[i]
+                rids_i[i] = i
+
+                # calculate local stat
+                rjs = [rids_i[j] for j in sneighbors[i]]
+                tni = tneighbors[i]
+                sti = [j for j in rjs if j in tni]
+                count = len(sti)
+                if count >= res["nsti"][i]:
+                    exceedence[i] += 1
+                if keep:
+                    STI[i, perm] = count
+
+        if keep:
+            res["sti_perm"] = STI
+        res["exceedence_pvalue"] = (exceedence + 1) / (permutations + 1)
+        res["exceedences"] = exceedence
+
+    # analytical inference
+    ntjis = [len(r) for r in res["tneighbors"]]
+    n1 = n - 1
+    hg_pvalues = [
+        1 - hypergeom.cdf(nsti[i] - 1, n1, ntjis, nsi[i]).mean() for i in range(n)
+    ]
+    res["hg_pvalues"] = np.array(hg_pvalues)
+
+    # identification of hot spots
+
+    adjlist = []
+    for i, j in res["st_pairs"]:
+        adjlist.append([i, j])
+    adjlist = pandas.DataFrame(data=adjlist, columns=["focal", "neighbor"])
+    adjlist = adjlist.sort_values(by=["focal", "neighbor"])
+    adjlist.reset_index(drop=True, inplace=True)
+
+    adjlist["orientation"] = ""
+    for index, row in adjlist.iterrows():
+        focal = row["focal"]
+        neighbor = row["neighbor"]
+        ft = t_coords[focal]
+        nt = t_coords[neighbor]
+        if ft < nt:
+            adjlist.iloc[index, 2] = "lead"
+        elif ft > nt:
+            adjlist.iloc[index, 2] = "lag"
+        else:
+            adjlist.iloc[index, 2] = "coincident"
+
+    res["stadjlist"] = adjlist
+    return res
+
+
+class KnoxLocal:
+    """
+    Local Knox statistics for space-time interactions
+
+    Parameters
+    ----------
+
+    s_coords: array (nx2)
+      spatial coordinates of point events
+
+    t_coords: array (nx1)
+      temporal coordinates of point events (floats or ints, not dateTime)
+
+    delta: float
+      spatial threshold defining distance below which pairs are spatial
+      neighbors
+
+    tau: float
+      temporal threshold defining distance below which pairs are temporal
+      neighbors
+
+    permutations: int
+      number of random permutations for inference
+
+    keep: bool
+      whether to store realized values of the statistic under permutations
+
+    conditional: bool
+      whether to include conditional permutation inference
+
+    crit: float
+      signifcance level for local statistics
+
+    crs: str (optional)
+      coordinate reference system string for s_coords
+
+
+
+    Attributes
+    ----------
+
+    s_coords: array (nx2)
+      spatial coordinates of point events
+
+    t_coords: array (nx1)
+      temporal coordinates of point events (floats or ints, not dateTime)
+
+    delta: float
+      spatial threshold defining distance below which pairs are spatial
+      neighbors
+
+    tau: float
+      temporal threshold defining distance below which pairs are temporal
+      neighbors
+
+    permutations: int
+      number of random permutations for inference
+
+    keep: bool
+      whether to store realized values of the statistic under permutations
+
+    nst: int
+      number of space-time pairs (global)
+
+    p_poisson: float
+      Analytical p-value under Poisson assumption (global)
+
+    p_sim: float
+      Pseudo p-value based on random permutations (global)
+
+    expected: array
+      Two-by-two array with expected counts under the null of no space-time
+      interactions. [[NST, NS_], [NT_, N__]] where NST is the expected number
+      of space-time pairs, NS_ is the expected number of spatial (but not also
+      temporal) pairs, NT_ is the number of expected temporal (but not also
+      spatial pairs), N__ is the number of pairs that are neighor spatial or
+      temporal neighbors. (global)
+
+    observed: array
+      Same structure as expected with the observed pair classifications (global)
+
+    sim: array
+      Global statistics from permutations (if keep=True and keep=True) (global)
+
+    p_sims: array
+      Local psuedo p-values from conditional permutations (if permutations>0)
+
+    sims: array
+      Local statistics from conditional permutations (if keep=True and
+      permutations>0)
+
+    nsti: array
+      Local statistics
+
+    p_hypergeom: array
+      Analytical p-values based on hypergeometric distribution
+
+
+
+    Notes
+    -----
+
+    Technical details can be found in :cite:`Rogerson:2001`. The conditional
+    permutation inference is unique to pysal.pointpats.
+
+
+    Examples
+    -------
+    >>> import libpysal
+    >>> path = libpysal.examples.get_path('burkitt.shp')
+    >>> import geopandas
+    >>> df = geopandas.read_file(path)
+    >>> from pointpats.spacetime import Knox
+    >>> import numpy
+    >>> numpy.random.seed(12345)
+    >>> local_knox = KnoxLocal(df[['X', 'Y']], df[["T"]], delta=20, tau=5, keep=True)
+    >>> local_knox.statistic_.shape
+    (188,)
+    >>> lres = local_knox
+    >>> gt0ids = numpy.where(lres.nsti>0)
+    >>> gt0ids # doctest: +NORMALIZE_WHITESPACE
+    (array([ 25,  26,  30,  31,  35,  36,  41,  42,  46,  47,  51,  52, 102,
+              103, 116, 118, 122, 123, 137, 138, 139, 140, 158, 159, 162, 163]),)
+    >>> lres.nsti[gt0ids]
+    array([1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+           1., 1., 1., 1., 1., 1., 1., 1., 1.])
+    >>> lres.p_hypergeom[gt0ids]
+    array([0.1348993 , 0.14220663, 0.07335085, 0.08400282, 0.1494317 ,
+           0.21524073, 0.0175806 , 0.04599869, 0.17523687, 0.18209188,
+           0.19111321, 0.16830444, 0.13734428, 0.14703242, 0.06796364,
+           0.03192559, 0.13734428, 0.17523687, 0.12998154, 0.1933476 ,
+           0.13244507, 0.13244507, 0.12502644, 0.14703242, 0.12502644,
+           0.12998154])
+    >>> lres.p_sims[gt0ids]
+    array([0.3 , 0.33, 0.11, 0.17, 0.3 , 0.42, 0.06, 0.06, 0.33, 0.34, 0.36,
+           0.38, 0.3 , 0.29, 0.41, 0.19, 0.31, 0.39, 0.18, 0.39, 0.48, 0.41,
+           0.22, 0.41, 0.39, 0.32])
+    """
+
+    def __init__(
+        self,
+        s_coords,
+        t_coords,
+        delta,
+        tau,
+        permutations=99,
+        keep=False,
+        crit=0.05,
+        crs=None,
+    ):
+
+        if not isinstance(t_coords, np.ndarray):
+            raise ValueError("t_coords  should be numpy.ndarray type")
+        if not isinstance(s_coords, np.ndarray):
+            raise ValueError("s_coords  should be numpy.ndarray type")
+        n_s, k = s_coords.shape
+        if k < 2:
+            raise ValueError("s_coords shape required to be nx2")
+        n_t, k = t_coords.shape
+        if n_s != n_t:
+            raise ValueError("t_coords and s_coords need to be same length")
+
+        self.s_coords = s_coords
+        self.t_coords = t_coords
+        self.delta = delta
+        self.tau = tau
+        self.permutations = permutations
+        self.keep = keep
+        self.crit = crit
+        results = _knox_local(s_coords, t_coords, delta, tau, permutations, keep, crit)
+        self.adjlist = results["stadjlist"]
+        self.nst = int(results["nst"])
+        if permutations > 0:
+            self.p_sim = results["p_value_sim"]
+            if keep:
+                self.sim = results["sti_perm"]
+
+        self.p_poisson = results["p_value_poisson"]
+        self.observed = results["observed"]
+        self.expected = results["expected"]
+        self.p_hypergeom = results["hg_pvalues"]
+        if permutations > 0:
+            self.p_sims = results["exceedence_pvalue"]
+            if keep:
+                self.sims = results["sti_perm"]
+        self.nsti = results["nsti"]
+        # self.hot_spots = results["hot_spots"]
+        self._crs = crs
+        self.statistic_ = self.nsti
+        # reconstruct df
+        geom = gpd.points_from_xy(self.s_coords[:, 0], self.s_coords[:, 1])
+        _gdf = gpd.GeoDataFrame(geometry=geom, crs=self._crs)
+        _gdf["t_coords"] = self.t_coords
+        self._gdf = _gdf.reset_index()
+
+    @classmethod
+    def from_dataframe(
+        cls,
+        dataframe,
+        time_col: str,
+        delta: int,
+        tau: int,
+        permutations: int = 99,
+        keep: bool = False,
+        crit: float = 0.05,
+    ):
+        """Compute a set of local Knox statistics from a dataframe of Point observations
+
+        Parameters
+        ----------
+        dataframe : geopandas.GeoDataFrame
+            dataframe holding observations. Should be in a projected coordinate system
+            with geometries stored as Points
+        time_col : str
+            column in the dataframe storing the time values (integer coordinate)
+            for each observation. For example if the observations are stored with
+            a timestamp, the time_col should be converted to a series of integers
+            representing, e.g. hours, days, seconds, etc.
+        delta : int
+            delta parameter defining the spatial neighbor threshold measured in the
+            same units as the dataframe CRS
+        tau : int
+            tau parameter defining the temporal neihgbor threshold (in the units
+            measured by `time_col`)
+        permutations : int, optional
+            permutations to use for computational inference, by default 99
+        keep : bool
+            whether to store realized values of the statistic under permutations
+        crit: float
+            signficance level for determination of hot spots
+
+        Returns
+        -------
+        pointpats.spacetime.LocalKnox
+            a fitted KnoxLocal class
+
+        """
+        s_coords, t_coords = _spacetime_points_to_arrays(dataframe, time_col)
+
+        return cls(
+            s_coords, t_coords, delta, tau, permutations, keep, crs=dataframe.crs
+        )
+
+    def hot_spots(self, crit=0.05, inference="permutation"):
+        if inference == "permutation":
+            if not hasattr(self, "p_sims"):
+                warn(
+                    "Pseudo-p values not availalable. Permutation-based p-values require "
+                    "fitting the KnoxLocal class using `permutations` set to a large "
+                    "number. Using analytic p-values instead"
+                )
+                ps = self.p_hypergeom
+            else:
+                ps = self.p_sims
+        elif inference == "analytic":
+            ps = self.p_hypergeom
+        else:
+            raise ValueError("inference must be either `permutation` or `analytic`")
+        # determine hot spots
+        pdf = pandas.DataFrame(data=ps, columns=["pvalue"])
+        pdf_sig = pdf[pdf.pvalue <= crit]
+        adjlist = self.adjlist
+        hot_spots = pandas.merge(
+            adjlist, pdf_sig, how="right", left_on="focal", right_index=True
+        ).reset_index(drop=True)
+
+        return hot_spots
+
+    def plot(
+        self,
+        kind="all",
+        colors={"focal": "red", "neighbor": "blue", "nonsig": "grey"},
+        crit=0.05,
+        inference="permutation",
+    ):
+
+        # logic for conditional formatting (focal as different color than lead/lag neighbors,
+
+        # arrows, close clique as a hull or not
+
+        if kind.lower() == "all":
+            self._gdf["color"] = "grey"
+            self._gdf["pvalue"] = self.p_hypergeom
+            # neighbors = self.adjlist.neighbor.unique()
+            # print(neighbors)
+
+            mask = self._gdf[self._gdf.pvalue <= crit].index.values
+            neighbors = self.adjlist[self.adjlist.focal.isin(mask)].neighbor.unique()
+            self._gdf.loc[neighbors, "color"] = "blue"
+            self._gdf.loc[self._gdf.pvalue <= crit, "color"] = "red"
+
+            g = self._gdf
+            m = g[g.color == "grey"].plot(color="grey")
+            g[g.color == "blue"].plot(ax=m, color="blue")
+            g[g.color == "red"].plot(ax=m, color="red")
+
+            return m
+
+            # return self._gdf.plot(color=self._gdf.color.values)
+
+        elif kind.lower() == "hotspots":
+            hot_spots = self.hot_spots(crit, inference=inference)
+            return self._gdfhs.plot()
+
+    def explore(
+        self,
+        crit=0.05,
+        inference="permutation",
+        style_kwds=None,
+        tiles="CartoDB Positron",
+    ):
+
+        # logic for conditional formatting (focal as different color than lead/lag neighbors,
+        # arrows, close clique as a hull or not
+
+        # interactivity: on-click, mouse-over functions sending to folium
+
+        # how to populate tool-tip columns
+
+        # markerclustering?
+        if style_kwds is None:
+            style_kwds = {}
+        g = self._gdf.copy()
+
+        g["color"] = "grey"
+
+        if inference == "permutation":
+            if not hasattr(self, "p_sims"):
+                warn(
+                    "Pseudo-p values not availalable. Permutation-based p-values require "
+                    "fitting the KnoxLocal class using `permutations` set to a large "
+                    "number. Using analytic p-values instead"
+                )
+                g["pvalue"] = self.p_hypergeom
+            else:
+                g["pvalue"] = self.p_sims
+        elif inference == "analytic":
+            g["pvalue"] = self.p_hypergeom
+        else:
+            raise ValueError("inference must be either `permutation` or `analytic`")
+
+        mask = g[g.pvalue <= crit].index.values
+        neighbors = self.adjlist[self.adjlist.focal.isin(mask)].neighbor.unique()
+        g.loc[neighbors, "color"] = "blue"
+        g.loc[g.pvalue <= crit, "color"] = "red"
+        nbs = self.adjlist.groupby("focal").agg(list)["neighbor"]
+        g = g.merge(nbs, left_on="index", right_index=True, how="left")
+
+        m = g[g.color == "grey"].explore(
+            color="grey", style_kwds=style_kwds, tiles=tiles
+        )
+        blues = g[g.color == "blue"]
+        if blues.shape[0] == 0:
+            warn("empty neighbor set.")
+        else:
+            m = blues.explore(m=m, color="blue", style_kwds=style_kwds)
+        m = g[g.color == "red"].explore(m=m, color="red", style_kwds=style_kwds)
+
+        return m
+
+    @cached_property
+    def _gdfhs(self):
+        # merge df with self.hotspots
+        return self._gdf.merge(self.hot_spots, left_index=True, right_on="focal")
+
+
+def _spacetime_points_to_arrays(dataframe, time_col):
+    """convert long-form geodataframe into arrays for kdtree
+
+    Parameters
+    ----------
+    dataframe : geopandas.GeoDataFrame
+        geodataframe with point geometries
+    time_col : str
+        name of the column on dataframe that stores time values
+
+    Returns
+    -------
+    tuple
+        two numpy arrays holding spatial coodinates s_coords (n,2)
+        and temporal coordinates t_coords (n,1)
+
+    """
+    if dataframe.crs is None:
+        warn(
+            "There is no CRS set on the dataframe. The KDTree will assume coordinates "
+            "are stored in Euclidean distances"
+        )
+    else:
+        if dataframe.crs.is_geographic:
+            raise ValueError(
+                "The input dataframe must be in a projected coordinate system."
+            )
+
+    assert dataframe.geom_type.unique().tolist() == [
+        "Point"
+    ], "The Knox statistic is only defined for Point geometries"
+
+    # kdtree wont operate on datetime
+    if is_numeric_dtype(dataframe[time_col].dtype) is False:
+        raise ValueError(
+            "The time values must be stored as "
+            f"a numeric dtype but the column {time_col} is stored as "
+            f"{dataframe[time_col].dtype}"
+        )
+
+    s_coords = np.vstack((dataframe.geometry.x.values, dataframe.geometry.y.values)).T
+    t_coords = np.vstack(dataframe[time_col].values)
+
+    return s_coords, t_coords
+
+
+def _time_to_int(df, column, fmt="%Y%m%d"):
+    """Create an integer valued column for time"""
+    time_series = pandas.to_datetime(df[column], format=fmt)
+    min_time = time_series.min()
+    time_int = time_series.appy(lambda x: x - min_time)
+    return time_int.dt.days


Test patch:
diff --git a/pointpats/tests/test_spacetime.py b/pointpats/tests/test_spacetime.py
index 94d1ffb..38a939d 100644
--- a/pointpats/tests/test_spacetime.py
+++ b/pointpats/tests/test_spacetime.py
@@ -1,35 +1,336 @@
-import unittest
+from warnings import warn
+
+import geopandas as gpd
 import libpysal as lps
-from pointpats import SpaceTimeEvents, knox, mantel, jacquez, modified_knox
-import scipy
+import numpy
+from pytest import approx
+
+from pointpats import (
+    Knox,
+    KnoxLocal,
+    SpaceTimeEvents,
+    jacquez,
+    knox,
+    mantel,
+    modified_knox,
+)
+
+
+class TestKnox:
+    def setup_method(self):
+        path = lps.examples.get_path("burkitt.shp")
+        self.gdf = gpd.read_file(path)
+
+    def test_knox(self):
+        global_knox = Knox(self.gdf[["X", "Y"]], self.gdf[["T"]], delta=20, tau=5)
+        assert global_knox.statistic_ == 13
+        assert global_knox.p_poisson == 0.14624558197140414
+        assert hasattr(global_knox, "sim") == False
+        numpy.testing.assert_array_equal(
+            global_knox.observed, [[1.300e01, 3.416e03], [3.900e01, 1.411e04]]
+        )
+        numpy.testing.assert_allclose(
+            global_knox.expected,
+            [[1.01438161e01, 3.41885618e03], [4.1856139e01, 1.41071438e04]],
+            rtol=1e-5,
+            atol=0,
+        )
+
+        numpy.random.seed(12345)
+        global_knox = Knox(
+            self.gdf[["X", "Y"]], self.gdf[["T"]], delta=20, tau=5, keep=True
+        )
+        assert global_knox.statistic_ == 13
+        assert hasattr(global_knox, "sim") == True
+        assert global_knox.p_sim == 0.21
 
+    def test_knox_from_gdf(self):
+        gdf = self.gdf.copy()
+        # not technically the correct CRS...
+        gdf.crs = 21096
+        global_knox = Knox.from_dataframe(gdf, time_col="T", delta=20, tau=5)
+        assert global_knox.statistic_ == 13
+        assert global_knox.p_poisson == 0.14624558197140414
+        assert hasattr(global_knox, "sim") == False
+        numpy.testing.assert_array_equal(
+            global_knox.observed, [[1.300e01, 3.416e03], [3.900e01, 1.411e04]]
+        )
+        numpy.testing.assert_allclose(
+            global_knox.expected,
+            [[1.01438161e01, 3.41885618e03], [4.1856139e01, 1.41071438e04]],
+            rtol=1e-5,
+            atol=0,
+        )
+
+        # no CRS should raise a warning
+        global_knox = Knox.from_dataframe(self.gdf, time_col="T", delta=20, tau=5)
+        numpy.testing.assert_allclose(
+            global_knox.expected,
+            [[1.01438161e01, 3.41885618e03], [4.1856139e01, 1.41071438e04]],
+            rtol=1e-5,
+            atol=0,
+        )
+
+        # unprojected coords
+        try:
+            gdf.crs = 4326
+            global_knox = Knox.from_dataframe(gdf, time_col="T", delta=20, tau=5)
+        except ValueError:
+            warn("successfully caught crs error")
+            pass
 
-class SpaceTimeEvents_Tester(unittest.TestCase):
-    def setUp(self):
-        self.path = lps.examples.get_path("burkitt.shp")
+        # non-numeric type for time
+        try:
+            gdf["T"] = gdf["T"].astype("O")
+            global_knox = Knox.from_dataframe(gdf, time_col="T", delta=20, tau=5)
+        except ValueError:
+            warn("successfully caught dtype error")
+            pass
 
-    def test_SpaceTimeEvents(self):
-        events = SpaceTimeEvents(self.path, "T")
-        self.assertEqual(events.n, 188)
-        self.assertEqual(list(events.space[0]), [300.0, 302.0])
-        self.assertEqual(list(events.t[0]), [413])
+        numpy.random.seed(12345)
+        global_knox = Knox(
+            self.gdf[["X", "Y"]], self.gdf[["T"]], delta=20, tau=5, keep=True
+        )
+        assert global_knox.statistic_ == 13
+        assert hasattr(global_knox, "sim") == True
+        assert global_knox.p_sim == 0.21
 
 
-class Knox_Tester(unittest.TestCase):
-    def setUp(self):
+class TestKnoxLocal:
+    def setup_method(self):
         path = lps.examples.get_path("burkitt.shp")
-        self.events = SpaceTimeEvents(path, "T")
+        self.gdf = gpd.read_file(path)
 
-    def test_knox(self):
-        result = knox(self.events.space, self.events.t, delta=20, tau=5, permutations=1)
-        self.assertEqual(result["stat"], 13.0)
+    def test_knox_local(self):
+        numpy.random.seed(12345)
+        local_knox = KnoxLocal(
+            self.gdf[["X", "Y"]].values, self.gdf[["T"]].values, delta=20, tau=5, keep=True
+        )
+        assert local_knox.statistic_.shape == (188,)
+        lres = local_knox
+        gt0ids = numpy.where(lres.nsti > 0)
+        numpy.testing.assert_array_equal(
+            gt0ids,
+            [
+                [
+                    25,
+                    26,
+                    30,
+                    31,
+                    35,
+                    36,
+                    41,
+                    42,
+                    46,
+                    47,
+                    51,
+                    52,
+                    102,
+                    103,
+                    116,
+                    118,
+                    122,
+                    123,
+                    137,
+                    138,
+                    139,
+                    140,
+                    158,
+                    159,
+                    162,
+                    163,
+                ]
+            ],
+        )
+        numpy.testing.assert_allclose(
+            lres.p_hypergeom[gt0ids],
+            [
+                0.1348993,
+                0.14220663,
+                0.07335085,
+                0.08400282,
+                0.1494317,
+                0.21524073,
+                0.0175806,
+                0.04599869,
+                0.17523687,
+                0.18209188,
+                0.19111321,
+                0.16830444,
+                0.13734428,
+                0.14703242,
+                0.06796364,
+                0.03192559,
+                0.13734428,
+                0.17523687,
+                0.12998154,
+                0.1933476,
+                0.13244507,
+                0.13244507,
+                0.12502644,
+                0.14703242,
+                0.12502644,
+                0.12998154,
+            ],
+            rtol=1e-5,
+            atol=0,
+        )
+        numpy.testing.assert_array_equal(
+            lres.p_sims[gt0ids],
+            [
+                0.3,
+                0.33,
+                0.11,
+                0.17,
+                0.3,
+                0.42,
+                0.06,
+                0.06,
+                0.33,
+                0.34,
+                0.36,
+                0.38,
+                0.3,
+                0.29,
+                0.41,
+                0.19,
+                0.31,
+                0.39,
+                0.18,
+                0.39,
+                0.48,
+                0.41,
+                0.22,
+                0.41,
+                0.39,
+                0.32,
+            ],
+        )
 
+    def test_knox_local_from_gdf(self):
+        gdf = self.gdf
+        gdf.crs = 21096
+        numpy.random.seed(12345)
+        local_knox = KnoxLocal.from_dataframe(
+            gdf, time_col="T", delta=20, tau=5, keep=True
+        )
+        assert local_knox.statistic_.shape == (188,)
+        lres = local_knox
+        gt0ids = numpy.where(lres.nsti > 0)
+        numpy.testing.assert_array_equal(
+            gt0ids,
+            [
+                [
+                    25,
+                    26,
+                    30,
+                    31,
+                    35,
+                    36,
+                    41,
+                    42,
+                    46,
+                    47,
+                    51,
+                    52,
+                    102,
+                    103,
+                    116,
+                    118,
+                    122,
+                    123,
+                    137,
+                    138,
+                    139,
+                    140,
+                    158,
+                    159,
+                    162,
+                    163,
+                ]
+            ],
+        )
+        numpy.testing.assert_allclose(
+            lres.p_hypergeom[gt0ids],
+            [
+                0.1348993,
+                0.14220663,
+                0.07335085,
+                0.08400282,
+                0.1494317,
+                0.21524073,
+                0.0175806,
+                0.04599869,
+                0.17523687,
+                0.18209188,
+                0.19111321,
+                0.16830444,
+                0.13734428,
+                0.14703242,
+                0.06796364,
+                0.03192559,
+                0.13734428,
+                0.17523687,
+                0.12998154,
+                0.1933476,
+                0.13244507,
+                0.13244507,
+                0.12502644,
+                0.14703242,
+                0.12502644,
+                0.12998154,
+            ],
+            rtol=1e-5,
+            atol=0,
+        )
+        numpy.testing.assert_array_equal(
+            lres.p_sims[gt0ids],
+            [
+                0.3,
+                0.33,
+                0.11,
+                0.17,
+                0.3,
+                0.42,
+                0.06,
+                0.06,
+                0.33,
+                0.34,
+                0.36,
+                0.38,
+                0.3,
+                0.29,
+                0.41,
+                0.19,
+                0.31,
+                0.39,
+                0.18,
+                0.39,
+                0.48,
+                0.41,
+                0.22,
+                0.41,
+                0.39,
+                0.32,
+            ],
+        )
 
-class Mantel_Tester(unittest.TestCase):
-    def setUp(self):
+
+# old tests refactored to pytest
+
+
+class TestSpaceTimeEvents:
+    def setup_method(self):
         path = lps.examples.get_path("burkitt.shp")
         self.events = SpaceTimeEvents(path, "T")
 
+    def test_space_time_events(self):
+        assert self.events.n == 188
+
+    def test_knox(self):
+        result = knox(self.events.space, self.events.t, delta=20, tau=5, permutations=1)
+        assert result["stat"] == 13.0
+
     def test_mantel(self):
         result = mantel(
             self.events.space,
@@ -40,43 +341,17 @@ def test_mantel(self):
             tcon=0.0,
             tpow=1.0,
         )
-        self.assertAlmostEqual(result["stat"], 0.014154, 6)
-
 
-class Jacquez_Tester(unittest.TestCase):
-    def setUp(self):
-        path = lps.examples.get_path("burkitt.shp")
-        self.events = SpaceTimeEvents(path, "T")
+        assert result["stat"] == approx(0.014154, rel=1e-4)
 
     def test_jacquez(self):
         result = jacquez(self.events.space, self.events.t, k=3, permutations=1)
-        self.assertEqual(result["stat"], 12)
 
-
-class ModifiedKnox_Tester(unittest.TestCase):
-    def setUp(self):
-        path = lps.examples.get_path("burkitt.shp")
-        self.events = SpaceTimeEvents(path, "T")
+        assert result["stat"] == 12
 
     def test_modified_knox(self):
         result = modified_knox(
             self.events.space, self.events.t, delta=20, tau=5, permutations=1
         )
-        self.assertAlmostEqual(result["stat"], 2.810160, 6)
-
-
-suite = unittest.TestSuite()
-test_classes = [
-    SpaceTimeEvents_Tester,
-    Knox_Tester,
-    Mantel_Tester,
-    Jacquez_Tester,
-    ModifiedKnox_Tester,
-]
-for i in test_classes:
-    a = unittest.TestLoader().loadTestsFromTestCase(i)
-    suite.addTest(a)
 
-if __name__ == "__main__":
-    runner = unittest.TextTestRunner()
-    runner.run(suite)
+        assert result["stat"] == approx(2.810160, rel=1e-4)