diff --git a/demand_from_node_poi_detailed.ipynb b/demand_from_node_poi_detailed.ipynb
new file mode 100644
index 0000000..c38976d
--- /dev/null
+++ b/demand_from_node_poi_detailed.ipynb
@@ -0,0 +1,1588 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "view-in-github",
+ "colab_type": "text"
+ },
+ "source": [
+ ""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "_ghEaf-d2Fdm"
+ },
+ "source": [
+ "**Step 0: load the OSM file from the repository of OSM testing datasets**"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "id": "e3xZMKsJ2Ew2"
+ },
+ "outputs": [],
+ "source": [
+ "!rm -rf ./grid2demand/\n",
+ "# !git clone https://github.com/xyluo25/grid2demand.git\n",
+ "\n",
+ "# %cd grid2demand/datasets"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "CexwTGDB0D0A"
+ },
+ "source": [
+ "Check the file icon on the left hand side, makesure file map.osm exists."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "j6y7B8WX-d46"
+ },
+ "source": [
+ "**Step 1: install python packages**"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "Mysg2UEz0cu5",
+ "outputId": "59e532c1-6abe-4854-ec00-a9ec98fe58ac",
+ "collapsed": true
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "Requirement already satisfied: osm2gmns in /usr/local/lib/python3.10/dist-packages (0.7.6)\n",
+ "Requirement already satisfied: numpy>=1.26.4 in /usr/local/lib/python3.10/dist-packages (from osm2gmns) (2.0.0)\n",
+ "Requirement already satisfied: osmium>=3.7.0 in /usr/local/lib/python3.10/dist-packages (from osm2gmns) (3.7.0)\n",
+ "Requirement already satisfied: pyufunc>=0.2.1 in /usr/local/lib/python3.10/dist-packages (from osm2gmns) (0.2.9)\n",
+ "Requirement already satisfied: Requests>=2.31.0 in /usr/local/lib/python3.10/dist-packages (from osm2gmns) (2.31.0)\n",
+ "Requirement already satisfied: setuptools>=68.2.2 in /usr/local/lib/python3.10/dist-packages (from osm2gmns) (70.1.0)\n",
+ "Requirement already satisfied: Shapely>=2.0.3 in /usr/local/lib/python3.10/dist-packages (from osm2gmns) (2.0.4)\n",
+ "Requirement already satisfied: matplotlib>=3.8.2 in /usr/local/lib/python3.10/dist-packages (from osm2gmns) (3.9.0)\n",
+ "Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.8.2->osm2gmns) (1.2.1)\n",
+ "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.8.2->osm2gmns) (0.12.1)\n",
+ "Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.8.2->osm2gmns) (4.53.0)\n",
+ "Requirement already satisfied: kiwisolver>=1.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.8.2->osm2gmns) (1.4.5)\n",
+ "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.8.2->osm2gmns) (24.1)\n",
+ "Requirement already satisfied: pillow>=8 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.8.2->osm2gmns) (9.4.0)\n",
+ "Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.8.2->osm2gmns) (3.1.2)\n",
+ "Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.8.2->osm2gmns) (2.8.2)\n",
+ "Requirement already satisfied: pandas in /usr/local/lib/python3.10/dist-packages (from pyufunc>=0.2.1->osm2gmns) (2.2.2)\n",
+ "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from Requests>=2.31.0->osm2gmns) (3.3.2)\n",
+ "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from Requests>=2.31.0->osm2gmns) (3.7)\n",
+ "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from Requests>=2.31.0->osm2gmns) (2.0.7)\n",
+ "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from Requests>=2.31.0->osm2gmns) (2024.6.2)\n",
+ "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.7->matplotlib>=3.8.2->osm2gmns) (1.16.0)\n",
+ "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas->pyufunc>=0.2.1->osm2gmns) (2023.4)\n",
+ "Requirement already satisfied: tzdata>=2022.7 in /usr/local/lib/python3.10/dist-packages (from pandas->pyufunc>=0.2.1->osm2gmns) (2024.1)\n",
+ "Requirement already satisfied: grid2demand in /usr/local/lib/python3.10/dist-packages (0.4.7)\n",
+ "Requirement already satisfied: numpy>=1.26.4 in /usr/local/lib/python3.10/dist-packages (from grid2demand) (2.0.0)\n",
+ "Requirement already satisfied: osm2gmns>=0.7.5 in /usr/local/lib/python3.10/dist-packages (from grid2demand) (0.7.6)\n",
+ "Requirement already satisfied: pandas>=2.2.1 in /usr/local/lib/python3.10/dist-packages (from grid2demand) (2.2.2)\n",
+ "Requirement already satisfied: pyufunc>=0.2.1 in /usr/local/lib/python3.10/dist-packages (from grid2demand) (0.2.9)\n",
+ "Requirement already satisfied: Shapely>=2.0.3 in /usr/local/lib/python3.10/dist-packages (from grid2demand) (2.0.4)\n",
+ "Requirement already satisfied: tqdm in /usr/local/lib/python3.10/dist-packages (from grid2demand) (4.66.4)\n",
+ "Requirement already satisfied: osmium>=3.7.0 in /usr/local/lib/python3.10/dist-packages (from osm2gmns>=0.7.5->grid2demand) (3.7.0)\n",
+ "Requirement already satisfied: Requests>=2.31.0 in /usr/local/lib/python3.10/dist-packages (from osm2gmns>=0.7.5->grid2demand) (2.31.0)\n",
+ "Requirement already satisfied: setuptools>=68.2.2 in /usr/local/lib/python3.10/dist-packages (from osm2gmns>=0.7.5->grid2demand) (70.1.0)\n",
+ "Requirement already satisfied: matplotlib>=3.8.2 in /usr/local/lib/python3.10/dist-packages (from osm2gmns>=0.7.5->grid2demand) (3.9.0)\n",
+ "Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.10/dist-packages (from pandas>=2.2.1->grid2demand) (2.8.2)\n",
+ "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas>=2.2.1->grid2demand) (2023.4)\n",
+ "Requirement already satisfied: tzdata>=2022.7 in /usr/local/lib/python3.10/dist-packages (from pandas>=2.2.1->grid2demand) (2024.1)\n",
+ "Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.8.2->osm2gmns>=0.7.5->grid2demand) (1.2.1)\n",
+ "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.8.2->osm2gmns>=0.7.5->grid2demand) (0.12.1)\n",
+ "Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.8.2->osm2gmns>=0.7.5->grid2demand) (4.53.0)\n",
+ "Requirement already satisfied: kiwisolver>=1.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.8.2->osm2gmns>=0.7.5->grid2demand) (1.4.5)\n",
+ "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.8.2->osm2gmns>=0.7.5->grid2demand) (24.1)\n",
+ "Requirement already satisfied: pillow>=8 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.8.2->osm2gmns>=0.7.5->grid2demand) (9.4.0)\n",
+ "Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.8.2->osm2gmns>=0.7.5->grid2demand) (3.1.2)\n",
+ "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.8.2->pandas>=2.2.1->grid2demand) (1.16.0)\n",
+ "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from Requests>=2.31.0->osm2gmns>=0.7.5->grid2demand) (3.3.2)\n",
+ "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from Requests>=2.31.0->osm2gmns>=0.7.5->grid2demand) (3.7)\n",
+ "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from Requests>=2.31.0->osm2gmns>=0.7.5->grid2demand) (2.0.7)\n",
+ "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from Requests>=2.31.0->osm2gmns>=0.7.5->grid2demand) (2024.6.2)\n",
+ "Requirement already satisfied: pyufunc in /usr/local/lib/python3.10/dist-packages (0.2.9)\n",
+ "Requirement already satisfied: pandas in /usr/local/lib/python3.10/dist-packages (from pyufunc) (2.2.2)\n",
+ "Requirement already satisfied: numpy in /usr/local/lib/python3.10/dist-packages (from pyufunc) (2.0.0)\n",
+ "Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.10/dist-packages (from pandas->pyufunc) (2.8.2)\n",
+ "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas->pyufunc) (2023.4)\n",
+ "Requirement already satisfied: tzdata>=2022.7 in /usr/local/lib/python3.10/dist-packages (from pandas->pyufunc) (2024.1)\n",
+ "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.8.2->pandas->pyufunc) (1.16.0)\n"
+ ]
+ }
+ ],
+ "source": [
+ "!pip install osm2gmns\n",
+ "!pip install grid2demand\n",
+ "!pip install pyufunc\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "# load datasets from github\n",
+ "import pyufunc as pf\n",
+ "pf.github_file_downloader(r\"https://github.com/xyluo25/grid2demand/tree/main/datasets\")"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 1000
+ },
+ "collapsed": true,
+ "id": "4F5trI7pqHNo",
+ "outputId": "83e87108-f65c-4606-a4a5-85659f3e62c8"
+ },
+ "execution_count": 10,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "pyufunc supports Python 3.10 or higher.\n",
+ "\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "name": "stderr",
+ "text": [
+ "\n",
+ "A module that was compiled using NumPy 1.x cannot be run in\n",
+ "NumPy 2.0.0 as it may crash. To support both 1.x and 2.x\n",
+ "versions of NumPy, modules must be compiled with NumPy 2.0.\n",
+ "Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.\n",
+ "\n",
+ "If you are a user of the module, the easiest solution will be to\n",
+ "downgrade to 'numpy<2' or try to upgrade the affected module.\n",
+ "We expect that some modules will need time to support NumPy 2.\n",
+ "\n",
+ "Traceback (most recent call last): File \"/usr/lib/python3.10/runpy.py\", line 196, in _run_module_as_main\n",
+ " return _run_code(code, main_globals, None,\n",
+ " File \"/usr/lib/python3.10/runpy.py\", line 86, in _run_code\n",
+ " exec(code, run_globals)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/colab_kernel_launcher.py\", line 37, in \n",
+ " ColabKernelApp.launch_instance()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/traitlets/config/application.py\", line 992, in launch_instance\n",
+ " app.start()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelapp.py\", line 619, in start\n",
+ " self.io_loop.start()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/platform/asyncio.py\", line 195, in start\n",
+ " self.asyncio_loop.run_forever()\n",
+ " File \"/usr/lib/python3.10/asyncio/base_events.py\", line 603, in run_forever\n",
+ " self._run_once()\n",
+ " File \"/usr/lib/python3.10/asyncio/base_events.py\", line 1909, in _run_once\n",
+ " handle._run()\n",
+ " File \"/usr/lib/python3.10/asyncio/events.py\", line 80, in _run\n",
+ " self._context.run(self._callback, *self._args)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/ioloop.py\", line 685, in \n",
+ " lambda f: self._run_callback(functools.partial(callback, future))\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/ioloop.py\", line 738, in _run_callback\n",
+ " ret = callback()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 825, in inner\n",
+ " self.ctx_run(self.run)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 786, in run\n",
+ " yielded = self.gen.send(value)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\", line 361, in process_one\n",
+ " yield gen.maybe_future(dispatch(*args))\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 234, in wrapper\n",
+ " yielded = ctx_run(next, result)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\", line 261, in dispatch_shell\n",
+ " yield gen.maybe_future(handler(stream, idents, msg))\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 234, in wrapper\n",
+ " yielded = ctx_run(next, result)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\", line 539, in execute_request\n",
+ " self.do_execute(\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 234, in wrapper\n",
+ " yielded = ctx_run(next, result)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py\", line 302, in do_execute\n",
+ " res = shell.run_cell(code, store_history=store_history, silent=silent)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/zmqshell.py\", line 539, in run_cell\n",
+ " return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 2975, in run_cell\n",
+ " result = self._run_cell(\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3030, in _run_cell\n",
+ " return runner(coro)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/async_helpers.py\", line 78, in _pseudo_sync_runner\n",
+ " coro.send(None)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3257, in run_cell_async\n",
+ " has_raised = await self.run_ast_nodes(code_ast.body, cell_name,\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3473, in run_ast_nodes\n",
+ " if (await self.run_code(code, result, async_=asy)):\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3553, in run_code\n",
+ " exec(code_obj, self.user_global_ns, self.user_ns)\n",
+ " File \"\", line 2, in \n",
+ " import pyufunc as pf\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/__init__.py\", line 16, in \n",
+ " from .util_datetime import * # datetime functions # noqa: F403\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_datetime/__init__.py\", line 15, in \n",
+ " from ._dt_group import (group_dt_yearly,\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_datetime/_dt_group.py\", line 19, in \n",
+ " def group_dt_yearly(df: pd.DataFrame, interval: int = 1, col: list = [\"datetime\", \"value\"]) -> pd.DataFrame:\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_common/_dependency_requires_decorator.py\", line 107, in inner\n",
+ " available = [is_module_importable(arg) for arg in arg_import_name]\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_common/_dependency_requires_decorator.py\", line 107, in \n",
+ " available = [is_module_importable(arg) for arg in arg_import_name]\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_common/_import_package.py\", line 236, in is_module_importable\n",
+ " exec(f\"import {module_name}\")\n",
+ " File \"\", line 1, in \n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pandas/__init__.py\", line 26, in \n",
+ " from pandas.compat import (\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pandas/compat/__init__.py\", line 27, in \n",
+ " from pandas.compat.pyarrow import (\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pandas/compat/pyarrow.py\", line 8, in \n",
+ " import pyarrow as pa\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyarrow/__init__.py\", line 65, in \n",
+ " import pyarrow.lib as _lib\n"
+ ]
+ },
+ {
+ "output_type": "error",
+ "ename": "AttributeError",
+ "evalue": "_ARRAY_API not found",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;31mAttributeError\u001b[0m: _ARRAY_API not found"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "name": "stderr",
+ "text": [
+ "\n",
+ "A module that was compiled using NumPy 1.x cannot be run in\n",
+ "NumPy 2.0.0 as it may crash. To support both 1.x and 2.x\n",
+ "versions of NumPy, modules must be compiled with NumPy 2.0.\n",
+ "Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.\n",
+ "\n",
+ "If you are a user of the module, the easiest solution will be to\n",
+ "downgrade to 'numpy<2' or try to upgrade the affected module.\n",
+ "We expect that some modules will need time to support NumPy 2.\n",
+ "\n",
+ "Traceback (most recent call last): File \"/usr/lib/python3.10/runpy.py\", line 196, in _run_module_as_main\n",
+ " return _run_code(code, main_globals, None,\n",
+ " File \"/usr/lib/python3.10/runpy.py\", line 86, in _run_code\n",
+ " exec(code, run_globals)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/colab_kernel_launcher.py\", line 37, in \n",
+ " ColabKernelApp.launch_instance()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/traitlets/config/application.py\", line 992, in launch_instance\n",
+ " app.start()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelapp.py\", line 619, in start\n",
+ " self.io_loop.start()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/platform/asyncio.py\", line 195, in start\n",
+ " self.asyncio_loop.run_forever()\n",
+ " File \"/usr/lib/python3.10/asyncio/base_events.py\", line 603, in run_forever\n",
+ " self._run_once()\n",
+ " File \"/usr/lib/python3.10/asyncio/base_events.py\", line 1909, in _run_once\n",
+ " handle._run()\n",
+ " File \"/usr/lib/python3.10/asyncio/events.py\", line 80, in _run\n",
+ " self._context.run(self._callback, *self._args)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/ioloop.py\", line 685, in \n",
+ " lambda f: self._run_callback(functools.partial(callback, future))\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/ioloop.py\", line 738, in _run_callback\n",
+ " ret = callback()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 825, in inner\n",
+ " self.ctx_run(self.run)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 786, in run\n",
+ " yielded = self.gen.send(value)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\", line 361, in process_one\n",
+ " yield gen.maybe_future(dispatch(*args))\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 234, in wrapper\n",
+ " yielded = ctx_run(next, result)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\", line 261, in dispatch_shell\n",
+ " yield gen.maybe_future(handler(stream, idents, msg))\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 234, in wrapper\n",
+ " yielded = ctx_run(next, result)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\", line 539, in execute_request\n",
+ " self.do_execute(\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 234, in wrapper\n",
+ " yielded = ctx_run(next, result)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py\", line 302, in do_execute\n",
+ " res = shell.run_cell(code, store_history=store_history, silent=silent)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/zmqshell.py\", line 539, in run_cell\n",
+ " return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 2975, in run_cell\n",
+ " result = self._run_cell(\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3030, in _run_cell\n",
+ " return runner(coro)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/async_helpers.py\", line 78, in _pseudo_sync_runner\n",
+ " coro.send(None)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3257, in run_cell_async\n",
+ " has_raised = await self.run_ast_nodes(code_ast.body, cell_name,\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3473, in run_ast_nodes\n",
+ " if (await self.run_code(code, result, async_=asy)):\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3553, in run_code\n",
+ " exec(code_obj, self.user_global_ns, self.user_ns)\n",
+ " File \"\", line 2, in \n",
+ " import pyufunc as pf\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/__init__.py\", line 16, in \n",
+ " from .util_datetime import * # datetime functions # noqa: F403\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_datetime/__init__.py\", line 15, in \n",
+ " from ._dt_group import (group_dt_yearly,\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_datetime/_dt_group.py\", line 19, in \n",
+ " def group_dt_yearly(df: pd.DataFrame, interval: int = 1, col: list = [\"datetime\", \"value\"]) -> pd.DataFrame:\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_common/_dependency_requires_decorator.py\", line 107, in inner\n",
+ " available = [is_module_importable(arg) for arg in arg_import_name]\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_common/_dependency_requires_decorator.py\", line 107, in \n",
+ " available = [is_module_importable(arg) for arg in arg_import_name]\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_common/_import_package.py\", line 236, in is_module_importable\n",
+ " exec(f\"import {module_name}\")\n",
+ " File \"\", line 1, in \n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pandas/__init__.py\", line 49, in \n",
+ " from pandas.core.api import (\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pandas/core/api.py\", line 9, in \n",
+ " from pandas.core.dtypes.dtypes import (\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pandas/core/dtypes/dtypes.py\", line 24, in \n",
+ " from pandas._libs import (\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyarrow/__init__.py\", line 65, in \n",
+ " import pyarrow.lib as _lib\n"
+ ]
+ },
+ {
+ "output_type": "error",
+ "ename": "AttributeError",
+ "evalue": "_ARRAY_API not found",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;31mAttributeError\u001b[0m: _ARRAY_API not found"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "name": "stderr",
+ "text": [
+ "\n",
+ "A module that was compiled using NumPy 1.x cannot be run in\n",
+ "NumPy 2.0.0 as it may crash. To support both 1.x and 2.x\n",
+ "versions of NumPy, modules must be compiled with NumPy 2.0.\n",
+ "Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.\n",
+ "\n",
+ "If you are a user of the module, the easiest solution will be to\n",
+ "downgrade to 'numpy<2' or try to upgrade the affected module.\n",
+ "We expect that some modules will need time to support NumPy 2.\n",
+ "\n",
+ "Traceback (most recent call last): File \"/usr/lib/python3.10/runpy.py\", line 196, in _run_module_as_main\n",
+ " return _run_code(code, main_globals, None,\n",
+ " File \"/usr/lib/python3.10/runpy.py\", line 86, in _run_code\n",
+ " exec(code, run_globals)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/colab_kernel_launcher.py\", line 37, in \n",
+ " ColabKernelApp.launch_instance()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/traitlets/config/application.py\", line 992, in launch_instance\n",
+ " app.start()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelapp.py\", line 619, in start\n",
+ " self.io_loop.start()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/platform/asyncio.py\", line 195, in start\n",
+ " self.asyncio_loop.run_forever()\n",
+ " File \"/usr/lib/python3.10/asyncio/base_events.py\", line 603, in run_forever\n",
+ " self._run_once()\n",
+ " File \"/usr/lib/python3.10/asyncio/base_events.py\", line 1909, in _run_once\n",
+ " handle._run()\n",
+ " File \"/usr/lib/python3.10/asyncio/events.py\", line 80, in _run\n",
+ " self._context.run(self._callback, *self._args)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/ioloop.py\", line 685, in \n",
+ " lambda f: self._run_callback(functools.partial(callback, future))\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/ioloop.py\", line 738, in _run_callback\n",
+ " ret = callback()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 825, in inner\n",
+ " self.ctx_run(self.run)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 786, in run\n",
+ " yielded = self.gen.send(value)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\", line 361, in process_one\n",
+ " yield gen.maybe_future(dispatch(*args))\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 234, in wrapper\n",
+ " yielded = ctx_run(next, result)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\", line 261, in dispatch_shell\n",
+ " yield gen.maybe_future(handler(stream, idents, msg))\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 234, in wrapper\n",
+ " yielded = ctx_run(next, result)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\", line 539, in execute_request\n",
+ " self.do_execute(\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 234, in wrapper\n",
+ " yielded = ctx_run(next, result)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py\", line 302, in do_execute\n",
+ " res = shell.run_cell(code, store_history=store_history, silent=silent)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/zmqshell.py\", line 539, in run_cell\n",
+ " return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 2975, in run_cell\n",
+ " result = self._run_cell(\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3030, in _run_cell\n",
+ " return runner(coro)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/async_helpers.py\", line 78, in _pseudo_sync_runner\n",
+ " coro.send(None)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3257, in run_cell_async\n",
+ " has_raised = await self.run_ast_nodes(code_ast.body, cell_name,\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3473, in run_ast_nodes\n",
+ " if (await self.run_code(code, result, async_=asy)):\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3553, in run_code\n",
+ " exec(code_obj, self.user_global_ns, self.user_ns)\n",
+ " File \"\", line 2, in \n",
+ " import pyufunc as pf\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/__init__.py\", line 21, in \n",
+ " from .util_img import * # image functions # noqa: F403\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_img/__init__.py\", line 8, in \n",
+ " from ._img_cvt import (\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_img/_img_cvt.py\", line 21, in \n",
+ " from ._img_operate import img_CV_to_PIL, img_PIL_to_CV\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_img/_img_operate.py\", line 78, in \n",
+ " def img_PIL_to_CV(img: Image.Image) -> np.ndarray:\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_common/_dependency_requires_decorator.py\", line 107, in inner\n",
+ " available = [is_module_importable(arg) for arg in arg_import_name]\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_common/_dependency_requires_decorator.py\", line 107, in \n",
+ " available = [is_module_importable(arg) for arg in arg_import_name]\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_common/_import_package.py\", line 236, in is_module_importable\n",
+ " exec(f\"import {module_name}\")\n",
+ " File \"\", line 1, in \n",
+ " File \"/usr/local/lib/python3.10/dist-packages/google/colab/_import_hooks/_cv2.py\", line 78, in load_module\n",
+ " cv_module = imp.load_module(name, *module_info)\n",
+ " File \"/usr/lib/python3.10/imp.py\", line 245, in load_module\n",
+ " return load_package(name, filename)\n",
+ " File \"/usr/lib/python3.10/imp.py\", line 217, in load_package\n",
+ " return _load(spec)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/cv2/__init__.py\", line 181, in \n",
+ " bootstrap()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/cv2/__init__.py\", line 153, in bootstrap\n",
+ " native_module = importlib.import_module(\"cv2\")\n",
+ " File \"/usr/lib/python3.10/importlib/__init__.py\", line 126, in import_module\n",
+ " return _bootstrap._gcd_import(name[level:], package, level)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/google/colab/_import_hooks/_cv2.py\", line 78, in load_module\n",
+ " cv_module = imp.load_module(name, *module_info)\n",
+ " File \"/usr/lib/python3.10/imp.py\", line 243, in load_module\n",
+ " return load_dynamic(name, filename, file)\n",
+ " File \"/usr/lib/python3.10/imp.py\", line 343, in load_dynamic\n",
+ " return _load(spec)\n"
+ ]
+ },
+ {
+ "output_type": "error",
+ "ename": "AttributeError",
+ "evalue": "_ARRAY_API not found",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;31mAttributeError\u001b[0m: _ARRAY_API not found"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "name": "stderr",
+ "text": [
+ "\n",
+ "A module that was compiled using NumPy 1.x cannot be run in\n",
+ "NumPy 2.0.0 as it may crash. To support both 1.x and 2.x\n",
+ "versions of NumPy, modules must be compiled with NumPy 2.0.\n",
+ "Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.\n",
+ "\n",
+ "If you are a user of the module, the easiest solution will be to\n",
+ "downgrade to 'numpy<2' or try to upgrade the affected module.\n",
+ "We expect that some modules will need time to support NumPy 2.\n",
+ "\n",
+ "Traceback (most recent call last): File \"/usr/lib/python3.10/runpy.py\", line 196, in _run_module_as_main\n",
+ " return _run_code(code, main_globals, None,\n",
+ " File \"/usr/lib/python3.10/runpy.py\", line 86, in _run_code\n",
+ " exec(code, run_globals)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/colab_kernel_launcher.py\", line 37, in \n",
+ " ColabKernelApp.launch_instance()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/traitlets/config/application.py\", line 992, in launch_instance\n",
+ " app.start()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelapp.py\", line 619, in start\n",
+ " self.io_loop.start()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/platform/asyncio.py\", line 195, in start\n",
+ " self.asyncio_loop.run_forever()\n",
+ " File \"/usr/lib/python3.10/asyncio/base_events.py\", line 603, in run_forever\n",
+ " self._run_once()\n",
+ " File \"/usr/lib/python3.10/asyncio/base_events.py\", line 1909, in _run_once\n",
+ " handle._run()\n",
+ " File \"/usr/lib/python3.10/asyncio/events.py\", line 80, in _run\n",
+ " self._context.run(self._callback, *self._args)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/ioloop.py\", line 685, in \n",
+ " lambda f: self._run_callback(functools.partial(callback, future))\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/ioloop.py\", line 738, in _run_callback\n",
+ " ret = callback()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 825, in inner\n",
+ " self.ctx_run(self.run)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 786, in run\n",
+ " yielded = self.gen.send(value)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\", line 361, in process_one\n",
+ " yield gen.maybe_future(dispatch(*args))\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 234, in wrapper\n",
+ " yielded = ctx_run(next, result)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\", line 261, in dispatch_shell\n",
+ " yield gen.maybe_future(handler(stream, idents, msg))\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 234, in wrapper\n",
+ " yielded = ctx_run(next, result)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\", line 539, in execute_request\n",
+ " self.do_execute(\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 234, in wrapper\n",
+ " yielded = ctx_run(next, result)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py\", line 302, in do_execute\n",
+ " res = shell.run_cell(code, store_history=store_history, silent=silent)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/zmqshell.py\", line 539, in run_cell\n",
+ " return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 2975, in run_cell\n",
+ " result = self._run_cell(\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3030, in _run_cell\n",
+ " return runner(coro)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/async_helpers.py\", line 78, in _pseudo_sync_runner\n",
+ " coro.send(None)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3257, in run_cell_async\n",
+ " has_raised = await self.run_ast_nodes(code_ast.body, cell_name,\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3473, in run_ast_nodes\n",
+ " if (await self.run_code(code, result, async_=asy)):\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3553, in run_code\n",
+ " exec(code_obj, self.user_global_ns, self.user_ns)\n",
+ " File \"\", line 2, in \n",
+ " import pyufunc as pf\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/__init__.py\", line 21, in \n",
+ " from .util_img import * # image functions # noqa: F403\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_img/__init__.py\", line 8, in \n",
+ " from ._img_cvt import (\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_img/_img_cvt.py\", line 21, in \n",
+ " from ._img_operate import img_CV_to_PIL, img_PIL_to_CV\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_img/_img_operate.py\", line 106, in \n",
+ " def img_CV_to_PIL(img: np.ndarray) -> Image.Image:\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_common/_dependency_requires_decorator.py\", line 107, in inner\n",
+ " available = [is_module_importable(arg) for arg in arg_import_name]\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_common/_dependency_requires_decorator.py\", line 107, in \n",
+ " available = [is_module_importable(arg) for arg in arg_import_name]\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_common/_import_package.py\", line 236, in is_module_importable\n",
+ " exec(f\"import {module_name}\")\n",
+ " File \"\", line 1, in \n",
+ " File \"/usr/local/lib/python3.10/dist-packages/google/colab/_import_hooks/_cv2.py\", line 78, in load_module\n",
+ " cv_module = imp.load_module(name, *module_info)\n",
+ " File \"/usr/lib/python3.10/imp.py\", line 243, in load_module\n",
+ " return load_dynamic(name, filename, file)\n",
+ " File \"/usr/lib/python3.10/imp.py\", line 343, in load_dynamic\n",
+ " return _load(spec)\n"
+ ]
+ },
+ {
+ "output_type": "error",
+ "ename": "AttributeError",
+ "evalue": "_ARRAY_API not found",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;31mAttributeError\u001b[0m: _ARRAY_API not found"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "name": "stderr",
+ "text": [
+ "\n",
+ "A module that was compiled using NumPy 1.x cannot be run in\n",
+ "NumPy 2.0.0 as it may crash. To support both 1.x and 2.x\n",
+ "versions of NumPy, modules must be compiled with NumPy 2.0.\n",
+ "Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.\n",
+ "\n",
+ "If you are a user of the module, the easiest solution will be to\n",
+ "downgrade to 'numpy<2' or try to upgrade the affected module.\n",
+ "We expect that some modules will need time to support NumPy 2.\n",
+ "\n",
+ "Traceback (most recent call last): File \"/usr/lib/python3.10/runpy.py\", line 196, in _run_module_as_main\n",
+ " return _run_code(code, main_globals, None,\n",
+ " File \"/usr/lib/python3.10/runpy.py\", line 86, in _run_code\n",
+ " exec(code, run_globals)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/colab_kernel_launcher.py\", line 37, in \n",
+ " ColabKernelApp.launch_instance()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/traitlets/config/application.py\", line 992, in launch_instance\n",
+ " app.start()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelapp.py\", line 619, in start\n",
+ " self.io_loop.start()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/platform/asyncio.py\", line 195, in start\n",
+ " self.asyncio_loop.run_forever()\n",
+ " File \"/usr/lib/python3.10/asyncio/base_events.py\", line 603, in run_forever\n",
+ " self._run_once()\n",
+ " File \"/usr/lib/python3.10/asyncio/base_events.py\", line 1909, in _run_once\n",
+ " handle._run()\n",
+ " File \"/usr/lib/python3.10/asyncio/events.py\", line 80, in _run\n",
+ " self._context.run(self._callback, *self._args)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/ioloop.py\", line 685, in \n",
+ " lambda f: self._run_callback(functools.partial(callback, future))\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/ioloop.py\", line 738, in _run_callback\n",
+ " ret = callback()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 825, in inner\n",
+ " self.ctx_run(self.run)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 786, in run\n",
+ " yielded = self.gen.send(value)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\", line 361, in process_one\n",
+ " yield gen.maybe_future(dispatch(*args))\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 234, in wrapper\n",
+ " yielded = ctx_run(next, result)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\", line 261, in dispatch_shell\n",
+ " yield gen.maybe_future(handler(stream, idents, msg))\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 234, in wrapper\n",
+ " yielded = ctx_run(next, result)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\", line 539, in execute_request\n",
+ " self.do_execute(\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 234, in wrapper\n",
+ " yielded = ctx_run(next, result)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py\", line 302, in do_execute\n",
+ " res = shell.run_cell(code, store_history=store_history, silent=silent)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/zmqshell.py\", line 539, in run_cell\n",
+ " return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 2975, in run_cell\n",
+ " result = self._run_cell(\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3030, in _run_cell\n",
+ " return runner(coro)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/async_helpers.py\", line 78, in _pseudo_sync_runner\n",
+ " coro.send(None)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3257, in run_cell_async\n",
+ " has_raised = await self.run_ast_nodes(code_ast.body, cell_name,\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3473, in run_ast_nodes\n",
+ " if (await self.run_code(code, result, async_=asy)):\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3553, in run_code\n",
+ " exec(code_obj, self.user_global_ns, self.user_ns)\n",
+ " File \"\", line 2, in \n",
+ " import pyufunc as pf\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/__init__.py\", line 21, in \n",
+ " from .util_img import * # image functions # noqa: F403\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_img/__init__.py\", line 8, in \n",
+ " from ._img_cvt import (\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_img/_img_cvt.py\", line 21, in \n",
+ " from ._img_operate import img_CV_to_PIL, img_PIL_to_CV\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_img/_img_operate.py\", line 132, in \n",
+ " def img_translate(img: Union[np.ndarray, str, Image.Image],\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_common/_dependency_requires_decorator.py\", line 107, in inner\n",
+ " available = [is_module_importable(arg) for arg in arg_import_name]\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_common/_dependency_requires_decorator.py\", line 107, in \n",
+ " available = [is_module_importable(arg) for arg in arg_import_name]\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_common/_import_package.py\", line 236, in is_module_importable\n",
+ " exec(f\"import {module_name}\")\n",
+ " File \"\", line 1, in \n",
+ " File \"/usr/local/lib/python3.10/dist-packages/google/colab/_import_hooks/_cv2.py\", line 78, in load_module\n",
+ " cv_module = imp.load_module(name, *module_info)\n",
+ " File \"/usr/lib/python3.10/imp.py\", line 243, in load_module\n",
+ " return load_dynamic(name, filename, file)\n",
+ " File \"/usr/lib/python3.10/imp.py\", line 343, in load_dynamic\n",
+ " return _load(spec)\n"
+ ]
+ },
+ {
+ "output_type": "error",
+ "ename": "AttributeError",
+ "evalue": "_ARRAY_API not found",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;31mAttributeError\u001b[0m: _ARRAY_API not found"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "name": "stderr",
+ "text": [
+ "\n",
+ "A module that was compiled using NumPy 1.x cannot be run in\n",
+ "NumPy 2.0.0 as it may crash. To support both 1.x and 2.x\n",
+ "versions of NumPy, modules must be compiled with NumPy 2.0.\n",
+ "Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.\n",
+ "\n",
+ "If you are a user of the module, the easiest solution will be to\n",
+ "downgrade to 'numpy<2' or try to upgrade the affected module.\n",
+ "We expect that some modules will need time to support NumPy 2.\n",
+ "\n",
+ "Traceback (most recent call last): File \"/usr/lib/python3.10/runpy.py\", line 196, in _run_module_as_main\n",
+ " return _run_code(code, main_globals, None,\n",
+ " File \"/usr/lib/python3.10/runpy.py\", line 86, in _run_code\n",
+ " exec(code, run_globals)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/colab_kernel_launcher.py\", line 37, in \n",
+ " ColabKernelApp.launch_instance()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/traitlets/config/application.py\", line 992, in launch_instance\n",
+ " app.start()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelapp.py\", line 619, in start\n",
+ " self.io_loop.start()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/platform/asyncio.py\", line 195, in start\n",
+ " self.asyncio_loop.run_forever()\n",
+ " File \"/usr/lib/python3.10/asyncio/base_events.py\", line 603, in run_forever\n",
+ " self._run_once()\n",
+ " File \"/usr/lib/python3.10/asyncio/base_events.py\", line 1909, in _run_once\n",
+ " handle._run()\n",
+ " File \"/usr/lib/python3.10/asyncio/events.py\", line 80, in _run\n",
+ " self._context.run(self._callback, *self._args)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/ioloop.py\", line 685, in \n",
+ " lambda f: self._run_callback(functools.partial(callback, future))\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/ioloop.py\", line 738, in _run_callback\n",
+ " ret = callback()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 825, in inner\n",
+ " self.ctx_run(self.run)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 786, in run\n",
+ " yielded = self.gen.send(value)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\", line 361, in process_one\n",
+ " yield gen.maybe_future(dispatch(*args))\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 234, in wrapper\n",
+ " yielded = ctx_run(next, result)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\", line 261, in dispatch_shell\n",
+ " yield gen.maybe_future(handler(stream, idents, msg))\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 234, in wrapper\n",
+ " yielded = ctx_run(next, result)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\", line 539, in execute_request\n",
+ " self.do_execute(\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 234, in wrapper\n",
+ " yielded = ctx_run(next, result)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py\", line 302, in do_execute\n",
+ " res = shell.run_cell(code, store_history=store_history, silent=silent)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/zmqshell.py\", line 539, in run_cell\n",
+ " return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 2975, in run_cell\n",
+ " result = self._run_cell(\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3030, in _run_cell\n",
+ " return runner(coro)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/async_helpers.py\", line 78, in _pseudo_sync_runner\n",
+ " coro.send(None)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3257, in run_cell_async\n",
+ " has_raised = await self.run_ast_nodes(code_ast.body, cell_name,\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3473, in run_ast_nodes\n",
+ " if (await self.run_code(code, result, async_=asy)):\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3553, in run_code\n",
+ " exec(code_obj, self.user_global_ns, self.user_ns)\n",
+ " File \"\", line 2, in \n",
+ " import pyufunc as pf\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/__init__.py\", line 21, in \n",
+ " from .util_img import * # image functions # noqa: F403\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_img/__init__.py\", line 8, in \n",
+ " from ._img_cvt import (\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_img/_img_cvt.py\", line 21, in \n",
+ " from ._img_operate import img_CV_to_PIL, img_PIL_to_CV\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_img/_img_operate.py\", line 195, in \n",
+ " def img_rotate(img: Union[np.ndarray, str, Image.Image],\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_common/_dependency_requires_decorator.py\", line 107, in inner\n",
+ " available = [is_module_importable(arg) for arg in arg_import_name]\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_common/_dependency_requires_decorator.py\", line 107, in \n",
+ " available = [is_module_importable(arg) for arg in arg_import_name]\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_common/_import_package.py\", line 236, in is_module_importable\n",
+ " exec(f\"import {module_name}\")\n",
+ " File \"\", line 1, in \n",
+ " File \"/usr/local/lib/python3.10/dist-packages/google/colab/_import_hooks/_cv2.py\", line 78, in load_module\n",
+ " cv_module = imp.load_module(name, *module_info)\n",
+ " File \"/usr/lib/python3.10/imp.py\", line 243, in load_module\n",
+ " return load_dynamic(name, filename, file)\n",
+ " File \"/usr/lib/python3.10/imp.py\", line 343, in load_dynamic\n",
+ " return _load(spec)\n"
+ ]
+ },
+ {
+ "output_type": "error",
+ "ename": "AttributeError",
+ "evalue": "_ARRAY_API not found",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;31mAttributeError\u001b[0m: _ARRAY_API not found"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "name": "stderr",
+ "text": [
+ "\n",
+ "A module that was compiled using NumPy 1.x cannot be run in\n",
+ "NumPy 2.0.0 as it may crash. To support both 1.x and 2.x\n",
+ "versions of NumPy, modules must be compiled with NumPy 2.0.\n",
+ "Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.\n",
+ "\n",
+ "If you are a user of the module, the easiest solution will be to\n",
+ "downgrade to 'numpy<2' or try to upgrade the affected module.\n",
+ "We expect that some modules will need time to support NumPy 2.\n",
+ "\n",
+ "Traceback (most recent call last): File \"/usr/lib/python3.10/runpy.py\", line 196, in _run_module_as_main\n",
+ " return _run_code(code, main_globals, None,\n",
+ " File \"/usr/lib/python3.10/runpy.py\", line 86, in _run_code\n",
+ " exec(code, run_globals)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/colab_kernel_launcher.py\", line 37, in \n",
+ " ColabKernelApp.launch_instance()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/traitlets/config/application.py\", line 992, in launch_instance\n",
+ " app.start()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelapp.py\", line 619, in start\n",
+ " self.io_loop.start()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/platform/asyncio.py\", line 195, in start\n",
+ " self.asyncio_loop.run_forever()\n",
+ " File \"/usr/lib/python3.10/asyncio/base_events.py\", line 603, in run_forever\n",
+ " self._run_once()\n",
+ " File \"/usr/lib/python3.10/asyncio/base_events.py\", line 1909, in _run_once\n",
+ " handle._run()\n",
+ " File \"/usr/lib/python3.10/asyncio/events.py\", line 80, in _run\n",
+ " self._context.run(self._callback, *self._args)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/ioloop.py\", line 685, in \n",
+ " lambda f: self._run_callback(functools.partial(callback, future))\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/ioloop.py\", line 738, in _run_callback\n",
+ " ret = callback()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 825, in inner\n",
+ " self.ctx_run(self.run)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 786, in run\n",
+ " yielded = self.gen.send(value)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\", line 361, in process_one\n",
+ " yield gen.maybe_future(dispatch(*args))\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 234, in wrapper\n",
+ " yielded = ctx_run(next, result)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\", line 261, in dispatch_shell\n",
+ " yield gen.maybe_future(handler(stream, idents, msg))\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 234, in wrapper\n",
+ " yielded = ctx_run(next, result)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\", line 539, in execute_request\n",
+ " self.do_execute(\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 234, in wrapper\n",
+ " yielded = ctx_run(next, result)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py\", line 302, in do_execute\n",
+ " res = shell.run_cell(code, store_history=store_history, silent=silent)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/zmqshell.py\", line 539, in run_cell\n",
+ " return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 2975, in run_cell\n",
+ " result = self._run_cell(\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3030, in _run_cell\n",
+ " return runner(coro)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/async_helpers.py\", line 78, in _pseudo_sync_runner\n",
+ " coro.send(None)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3257, in run_cell_async\n",
+ " has_raised = await self.run_ast_nodes(code_ast.body, cell_name,\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3473, in run_ast_nodes\n",
+ " if (await self.run_code(code, result, async_=asy)):\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3553, in run_code\n",
+ " exec(code_obj, self.user_global_ns, self.user_ns)\n",
+ " File \"\", line 2, in \n",
+ " import pyufunc as pf\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/__init__.py\", line 21, in \n",
+ " from .util_img import * # image functions # noqa: F403\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_img/__init__.py\", line 8, in \n",
+ " from ._img_cvt import (\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_img/_img_cvt.py\", line 21, in \n",
+ " from ._img_operate import img_CV_to_PIL, img_PIL_to_CV\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_img/_img_operate.py\", line 278, in \n",
+ " def img_rotate_bound(img: Union[np.ndarray, str, Image.Image],\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_common/_dependency_requires_decorator.py\", line 107, in inner\n",
+ " available = [is_module_importable(arg) for arg in arg_import_name]\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_common/_dependency_requires_decorator.py\", line 107, in \n",
+ " available = [is_module_importable(arg) for arg in arg_import_name]\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_common/_import_package.py\", line 236, in is_module_importable\n",
+ " exec(f\"import {module_name}\")\n",
+ " File \"\", line 1, in \n",
+ " File \"/usr/local/lib/python3.10/dist-packages/google/colab/_import_hooks/_cv2.py\", line 78, in load_module\n",
+ " cv_module = imp.load_module(name, *module_info)\n",
+ " File \"/usr/lib/python3.10/imp.py\", line 243, in load_module\n",
+ " return load_dynamic(name, filename, file)\n",
+ " File \"/usr/lib/python3.10/imp.py\", line 343, in load_dynamic\n",
+ " return _load(spec)\n"
+ ]
+ },
+ {
+ "output_type": "error",
+ "ename": "AttributeError",
+ "evalue": "_ARRAY_API not found",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;31mAttributeError\u001b[0m: _ARRAY_API not found"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "name": "stderr",
+ "text": [
+ "\n",
+ "A module that was compiled using NumPy 1.x cannot be run in\n",
+ "NumPy 2.0.0 as it may crash. To support both 1.x and 2.x\n",
+ "versions of NumPy, modules must be compiled with NumPy 2.0.\n",
+ "Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.\n",
+ "\n",
+ "If you are a user of the module, the easiest solution will be to\n",
+ "downgrade to 'numpy<2' or try to upgrade the affected module.\n",
+ "We expect that some modules will need time to support NumPy 2.\n",
+ "\n",
+ "Traceback (most recent call last): File \"/usr/lib/python3.10/runpy.py\", line 196, in _run_module_as_main\n",
+ " return _run_code(code, main_globals, None,\n",
+ " File \"/usr/lib/python3.10/runpy.py\", line 86, in _run_code\n",
+ " exec(code, run_globals)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/colab_kernel_launcher.py\", line 37, in \n",
+ " ColabKernelApp.launch_instance()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/traitlets/config/application.py\", line 992, in launch_instance\n",
+ " app.start()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelapp.py\", line 619, in start\n",
+ " self.io_loop.start()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/platform/asyncio.py\", line 195, in start\n",
+ " self.asyncio_loop.run_forever()\n",
+ " File \"/usr/lib/python3.10/asyncio/base_events.py\", line 603, in run_forever\n",
+ " self._run_once()\n",
+ " File \"/usr/lib/python3.10/asyncio/base_events.py\", line 1909, in _run_once\n",
+ " handle._run()\n",
+ " File \"/usr/lib/python3.10/asyncio/events.py\", line 80, in _run\n",
+ " self._context.run(self._callback, *self._args)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/ioloop.py\", line 685, in \n",
+ " lambda f: self._run_callback(functools.partial(callback, future))\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/ioloop.py\", line 738, in _run_callback\n",
+ " ret = callback()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 825, in inner\n",
+ " self.ctx_run(self.run)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 786, in run\n",
+ " yielded = self.gen.send(value)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\", line 361, in process_one\n",
+ " yield gen.maybe_future(dispatch(*args))\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 234, in wrapper\n",
+ " yielded = ctx_run(next, result)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\", line 261, in dispatch_shell\n",
+ " yield gen.maybe_future(handler(stream, idents, msg))\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 234, in wrapper\n",
+ " yielded = ctx_run(next, result)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\", line 539, in execute_request\n",
+ " self.do_execute(\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 234, in wrapper\n",
+ " yielded = ctx_run(next, result)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py\", line 302, in do_execute\n",
+ " res = shell.run_cell(code, store_history=store_history, silent=silent)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/zmqshell.py\", line 539, in run_cell\n",
+ " return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 2975, in run_cell\n",
+ " result = self._run_cell(\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3030, in _run_cell\n",
+ " return runner(coro)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/async_helpers.py\", line 78, in _pseudo_sync_runner\n",
+ " coro.send(None)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3257, in run_cell_async\n",
+ " has_raised = await self.run_ast_nodes(code_ast.body, cell_name,\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3473, in run_ast_nodes\n",
+ " if (await self.run_code(code, result, async_=asy)):\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3553, in run_code\n",
+ " exec(code_obj, self.user_global_ns, self.user_ns)\n",
+ " File \"\", line 2, in \n",
+ " import pyufunc as pf\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/__init__.py\", line 21, in \n",
+ " from .util_img import * # image functions # noqa: F403\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_img/__init__.py\", line 8, in \n",
+ " from ._img_cvt import (\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_img/_img_cvt.py\", line 21, in \n",
+ " from ._img_operate import img_CV_to_PIL, img_PIL_to_CV\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_img/_img_operate.py\", line 355, in \n",
+ " def img_resize(img: Union[np.ndarray, str, Image.Image],\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_common/_dependency_requires_decorator.py\", line 107, in inner\n",
+ " available = [is_module_importable(arg) for arg in arg_import_name]\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_common/_dependency_requires_decorator.py\", line 107, in \n",
+ " available = [is_module_importable(arg) for arg in arg_import_name]\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_common/_import_package.py\", line 236, in is_module_importable\n",
+ " exec(f\"import {module_name}\")\n",
+ " File \"\", line 1, in \n",
+ " File \"/usr/local/lib/python3.10/dist-packages/google/colab/_import_hooks/_cv2.py\", line 78, in load_module\n",
+ " cv_module = imp.load_module(name, *module_info)\n",
+ " File \"/usr/lib/python3.10/imp.py\", line 243, in load_module\n",
+ " return load_dynamic(name, filename, file)\n",
+ " File \"/usr/lib/python3.10/imp.py\", line 343, in load_dynamic\n",
+ " return _load(spec)\n"
+ ]
+ },
+ {
+ "output_type": "error",
+ "ename": "AttributeError",
+ "evalue": "_ARRAY_API not found",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;31mAttributeError\u001b[0m: _ARRAY_API not found"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "name": "stderr",
+ "text": [
+ "\n",
+ "A module that was compiled using NumPy 1.x cannot be run in\n",
+ "NumPy 2.0.0 as it may crash. To support both 1.x and 2.x\n",
+ "versions of NumPy, modules must be compiled with NumPy 2.0.\n",
+ "Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.\n",
+ "\n",
+ "If you are a user of the module, the easiest solution will be to\n",
+ "downgrade to 'numpy<2' or try to upgrade the affected module.\n",
+ "We expect that some modules will need time to support NumPy 2.\n",
+ "\n",
+ "Traceback (most recent call last): File \"/usr/lib/python3.10/runpy.py\", line 196, in _run_module_as_main\n",
+ " return _run_code(code, main_globals, None,\n",
+ " File \"/usr/lib/python3.10/runpy.py\", line 86, in _run_code\n",
+ " exec(code, run_globals)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/colab_kernel_launcher.py\", line 37, in \n",
+ " ColabKernelApp.launch_instance()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/traitlets/config/application.py\", line 992, in launch_instance\n",
+ " app.start()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelapp.py\", line 619, in start\n",
+ " self.io_loop.start()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/platform/asyncio.py\", line 195, in start\n",
+ " self.asyncio_loop.run_forever()\n",
+ " File \"/usr/lib/python3.10/asyncio/base_events.py\", line 603, in run_forever\n",
+ " self._run_once()\n",
+ " File \"/usr/lib/python3.10/asyncio/base_events.py\", line 1909, in _run_once\n",
+ " handle._run()\n",
+ " File \"/usr/lib/python3.10/asyncio/events.py\", line 80, in _run\n",
+ " self._context.run(self._callback, *self._args)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/ioloop.py\", line 685, in \n",
+ " lambda f: self._run_callback(functools.partial(callback, future))\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/ioloop.py\", line 738, in _run_callback\n",
+ " ret = callback()\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 825, in inner\n",
+ " self.ctx_run(self.run)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 786, in run\n",
+ " yielded = self.gen.send(value)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\", line 361, in process_one\n",
+ " yield gen.maybe_future(dispatch(*args))\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 234, in wrapper\n",
+ " yielded = ctx_run(next, result)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\", line 261, in dispatch_shell\n",
+ " yield gen.maybe_future(handler(stream, idents, msg))\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 234, in wrapper\n",
+ " yielded = ctx_run(next, result)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\", line 539, in execute_request\n",
+ " self.do_execute(\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/tornado/gen.py\", line 234, in wrapper\n",
+ " yielded = ctx_run(next, result)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py\", line 302, in do_execute\n",
+ " res = shell.run_cell(code, store_history=store_history, silent=silent)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/ipykernel/zmqshell.py\", line 539, in run_cell\n",
+ " return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 2975, in run_cell\n",
+ " result = self._run_cell(\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3030, in _run_cell\n",
+ " return runner(coro)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/async_helpers.py\", line 78, in _pseudo_sync_runner\n",
+ " coro.send(None)\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3257, in run_cell_async\n",
+ " has_raised = await self.run_ast_nodes(code_ast.body, cell_name,\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3473, in run_ast_nodes\n",
+ " if (await self.run_code(code, result, async_=asy)):\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py\", line 3553, in run_code\n",
+ " exec(code_obj, self.user_global_ns, self.user_ns)\n",
+ " File \"\", line 2, in \n",
+ " import pyufunc as pf\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/__init__.py\", line 21, in \n",
+ " from .util_img import * # image functions # noqa: F403\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_img/__init__.py\", line 8, in \n",
+ " from ._img_cvt import (\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_img/_img_cvt.py\", line 21, in \n",
+ " from ._img_operate import img_CV_to_PIL, img_PIL_to_CV\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_img/_img_operate.py\", line 436, in \n",
+ " def img_show(img: Union[str, np.ndarray, Image.Image],\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_common/_dependency_requires_decorator.py\", line 107, in inner\n",
+ " available = [is_module_importable(arg) for arg in arg_import_name]\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_common/_dependency_requires_decorator.py\", line 107, in \n",
+ " available = [is_module_importable(arg) for arg in arg_import_name]\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/pyufunc/util_common/_import_package.py\", line 236, in is_module_importable\n",
+ " exec(f\"import {module_name}\")\n",
+ " File \"\", line 1, in \n",
+ " File \"/usr/local/lib/python3.10/dist-packages/google/colab/_import_hooks/_cv2.py\", line 78, in load_module\n",
+ " cv_module = imp.load_module(name, *module_info)\n",
+ " File \"/usr/lib/python3.10/imp.py\", line 243, in load_module\n",
+ " return load_dynamic(name, filename, file)\n",
+ " File \"/usr/lib/python3.10/imp.py\", line 343, in load_dynamic\n",
+ " return _load(spec)\n"
+ ]
+ },
+ {
+ "output_type": "error",
+ "ename": "AttributeError",
+ "evalue": "_ARRAY_API not found",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;31mAttributeError\u001b[0m: _ARRAY_API not found"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "Downloaded to: .//datasets/ASU/TAZ.csv\n",
+ "Downloaded to: .//datasets/ASU/accessibility.csv\n",
+ "Downloaded to: .//datasets/ASU/asu_parcels.csv\n",
+ "Downloaded to: .//datasets/ASU/asu_parcels.qmd\n",
+ "Downloaded to: .//datasets/ASU/connector.csv\n",
+ "Downloaded to: .//datasets/ASU/demand.csv\n",
+ "Downloaded to: .//datasets/ASU/demand_B3.csv\n",
+ "Downloaded to: .//datasets/ASU/ggis_GMNS.qgz\n",
+ "Downloaded to: .//datasets/ASU/input_agent.csv\n",
+ "Downloaded to: .//datasets/ASU/link.csv\n",
+ "Downloaded to: .//datasets/ASU/map.osm\n",
+ "Downloaded to: .//datasets/ASU/node.csv\n",
+ "Downloaded to: .//datasets/ASU/poi.csv\n",
+ "Downloaded to: .//datasets/ASU/poi_trip_rate.csv\n",
+ "Downloaded to: .//datasets/ASU/sample_GMNS_dataset.zip\n",
+ "Downloaded to: .//datasets/ASU/zone.csv\n",
+ "Downloaded to: .//datasets/Avondale_AZ/Avondale.osm\n",
+ "Downloaded to: .//datasets/Avondale_AZ/link.csv\n",
+ "Downloaded to: .//datasets/Avondale_AZ/node.csv\n",
+ "Downloaded to: .//datasets/Avondale_AZ/poi.csv\n",
+ "Downloaded to: .//datasets/BayArea/node.csv\n",
+ "Downloaded to: .//datasets/BayArea/poi.csv\n",
+ "Downloaded to: .//datasets/Chicago_Sketch/demand.csv\n",
+ "Downloaded to: .//datasets/Chicago_Sketch/link.csv\n",
+ "Downloaded to: .//datasets/Chicago_Sketch/node.csv\n",
+ "Downloaded to: .//datasets/Chicago_Sketch/settings.csv\n",
+ "Downloaded to: .//datasets/Chicago_Sketch/settings.yml\n",
+ "Downloaded to: .//datasets/DC_Downtown/DC.osm\n",
+ "Downloaded to: .//datasets/DC_Downtown/accessibility.csv\n",
+ "Downloaded to: .//datasets/DC_Downtown/demand.csv\n",
+ "Downloaded to: .//datasets/DC_Downtown/link.csv\n",
+ "Downloaded to: .//datasets/DC_Downtown/node.csv\n",
+ "Downloaded to: .//datasets/DC_Downtown/poi.csv\n",
+ "Downloaded to: .//datasets/DC_Downtown/poi_trip_rate.csv\n",
+ "Downloaded to: .//datasets/DC_Downtown/zone.csv\n",
+ "Downloaded to: .//datasets/Lima_Network/demand.csv\n",
+ "Downloaded to: .//datasets/Lima_Network/link.csv\n",
+ "Downloaded to: .//datasets/Lima_Network/node.csv\n",
+ "Downloaded to: .//datasets/Lima_Network/settings.csv\n",
+ "Downloaded to: .//datasets/Lima_Network/settings.yml\n",
+ "Downloaded to: .//datasets/NationalArboretum/accessibility.csv\n",
+ "Downloaded to: .//datasets/NationalArboretum/demand.csv\n",
+ "Downloaded to: .//datasets/NationalArboretum/link.csv\n",
+ "Downloaded to: .//datasets/NationalArboretum/map\n",
+ "Downloaded to: .//datasets/NationalArboretum/node.csv\n",
+ "Downloaded to: .//datasets/NationalArboretum/poi.csv\n",
+ "Downloaded to: .//datasets/NationalArboretum/poi_trip_rate.csv\n",
+ "Downloaded to: .//datasets/NationalArboretum/zone.csv\n",
+ "Downloaded to: .//datasets/Tuscon_zone/demand.csv\n",
+ "Downloaded to: .//datasets/Tuscon_zone/line_performance_summary.geojson\n",
+ "Downloaded to: .//datasets/Tuscon_zone/line_performance_summary.qmd\n",
+ "Downloaded to: .//datasets/Tuscon_zone/link.csv\n",
+ "Downloaded to: .//datasets/Tuscon_zone/link.geojson\n",
+ "Downloaded to: .//datasets/Tuscon_zone/link.qmd\n",
+ "Downloaded to: .//datasets/Tuscon_zone/link_performance_summary.csv\n",
+ "Downloaded to: .//datasets/Tuscon_zone/node.csv\n",
+ "Downloaded to: .//datasets/Tuscon_zone/node_synced.csv\n",
+ "Downloaded to: .//datasets/Tuscon_zone/poi.csv\n",
+ "Downloaded to: .//datasets/Tuscon_zone/poi_synced.csv\n",
+ "Downloaded to: .//datasets/Tuscon_zone/zone.csv\n",
+ "Downloaded to: .//datasets/Tuscon_zone/zone_synced.csv\n",
+ "Downloaded to: .//datasets/UMD/UMD.osm\n",
+ "Downloaded to: .//datasets/UMD/accessibility.csv\n",
+ "Downloaded to: .//datasets/UMD/demand.csv\n",
+ "Downloaded to: .//datasets/UMD/link.csv\n",
+ "Downloaded to: .//datasets/UMD/node.csv\n",
+ "Downloaded to: .//datasets/UMD/poi.csv\n",
+ "Downloaded to: .//datasets/UMD/poi_trip_rate.csv\n",
+ "Downloaded to: .//datasets/UMD/zone.csv\n",
+ "Downloaded to: .//datasets/dubai/demand.csv\n",
+ "Downloaded to: .//datasets/dubai/node.csv\n",
+ "Downloaded to: .//datasets/dubai/poi.csv\n",
+ "Downloaded to: .//datasets/dubai/zone.csv\n"
+ ]
+ },
+ {
+ "output_type": "execute_result",
+ "data": {
+ "text/plain": [
+ "73"
+ ]
+ },
+ "metadata": {},
+ "execution_count": 10
+ }
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "qrchDA-R0WN0"
+ },
+ "source": [
+ "**Step 2: convert OSM to GMNS Files**"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "KBLRJxWHpvmG"
+ },
+ "source": [
+ "go to the local folder in cloud computing environment"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "zTi7DW3Zp3T0",
+ "outputId": "2ae21327-024c-4565-c9b8-4943653db2ed"
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "/content\n"
+ ]
+ }
+ ],
+ "source": [
+ "!pwd"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "wTopPq99pubn",
+ "outputId": "bc3678be-c8c8-4d4c-fdb9-4b619a0bee9b"
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "/content/datasets/ASU\n"
+ ]
+ }
+ ],
+ "source": [
+ "%cd datasets/ASU"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 1000
+ },
+ "id": "3UL0MUnaHAD5",
+ "outputId": "613f940b-5c27-418d-b209-8ddf60f67163",
+ "collapsed": true
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "osm2gmns, 0.7.6\n",
+ "arguments used for network parsing:\n",
+ " filename: map.osm\n",
+ " network_types: ('auto',)\n",
+ " link_types: all\n",
+ " POI: True\n",
+ " POI_sampling_ratio: 0.1\n",
+ " strict_mode: True\n",
+ " offset: no\n",
+ " min_nodes: 1\n",
+ " combine: False\n",
+ " bbox: None\n",
+ " default_lanes: False\n",
+ " default_speed: False\n",
+ " default_capacity: False\n",
+ " start_node_id: 0\n",
+ " start_link_id: 0\n",
+ "\n",
+ "Building Network from OSM file\n",
+ " reading osm file\n",
+ " parsing osm network\n",
+ " generating nodes and links\n",
+ " generating POIs\n",
+ " number of nodes: 823, number of links: 1614, number of pois: 125\n",
+ "Generating Node Activity Information\n",
+ "Consolidating Complex Intersections\n",
+ " 0 intersections have been consolidated\n",
+ "Outputting Network Files\n",
+ "Outputting Network Files\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "data": {
+ "text/plain": [
+ " | | | | | | | | |