diff --git a/docs/tutorials/intro_tutorial.ipynb b/docs/tutorials/intro_tutorial.ipynb index 1ca0777c..2713c570 100644 --- a/docs/tutorials/intro_tutorial.ipynb +++ b/docs/tutorials/intro_tutorial.ipynb @@ -33,21 +33,27 @@ " (You can use the table of contents button on the left side of the interface to skip to any specific part)\n", "\n", "\n", - "Users can use Google Colab (Please ensure you run the Colab dependency import cell) \n", + "Users can use Google Colab\\* (Please ensure you run the Colab dependency import cell- below) \n", "\n", - "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/projectmesa/mesa-geo/blob/main/docs/tutorials/intro_tutorial.ipynb)\n" + "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/projectmesa/mesa-geo/blob/main/docs/tutorials/intro_tutorial.ipynb)\n", + "\n", + "\\*Based on a recent Google Colab update currently, Solara visuals are not rendering. However, the link still provides a easy way to download the jupyter file. You can see the issue on the [Solara GitHub site](https://github.com/widgetti/solara/issues/323)\n", + "\n", + "You can also [download the file directly from GitHub](https://github.com/projectmesa/mesa-geo/blob/main/docs/tutorials/intro_tutorial.ipynb)\n" ] }, { - "cell_type": "raw", - "id": "c0c702b3-c307-4f00-9530-468e29f53184", + "cell_type": "code", + "execution_count": null, + "id": "0b0dc4bb-cf8a-4c21-82aa-4a1cc43f1871", "metadata": {}, + "outputs": [], "source": [ - "#Run this if in colab\n", + "#Run this if in colab or if you need to install mesa and mesa-geo in your local environment. \n", "!pip install mesa --quiet\n", "!pip install mesa-geo --quiet\n", "!mkdir -p data\n", - "!wget -P data https://raw.githubusercontent.com/projectmesa/mesa-geo/tree/main/docs/tutorials/data/TorontoNeighbourhoods.geojson" + "!wget -P data https://raw.githubusercontent.com/projectmesa/mesa-geo/main/docs/tutorials/data/TorontoNeighbourhoods.geojson" ] }, { @@ -93,7 +99,7 @@ "\n", "import mesa\n", "import mesa_geo as mg\n", - "import mesa_geo.visualization as mgv\n" + "import mesa_geo.visualization as mgv # the warning that appears from Solara is fixed in Mesa 3.0 you can install the pre-release with pip install -U --pre-mesa\n" ] }, { @@ -336,6 +342,7 @@ " self, pop_size=30, mobility_range=500, init_infection=0.2, exposure_dist=500, max_infection_risk=0.2,\n", " max_recovery_time=5\n", " ):\n", + " super().__init__()\n", " self.schedule = mesa.time.RandomActivationByType(self)\n", " self.space = mg.GeoSpace(warn_crs_conversion=False)\n", " \n", @@ -632,10 +639,7 @@ "execution_count": null, "id": "50aab416-959f-4d72-abd9-844ed42c784d", "metadata": { - "has_explanation": true, - "jupyter": { - "source_hidden": true - } + "has_explanation": true }, "outputs": [], "source": [ @@ -769,6 +773,7 @@ " self, pop_size=30, mobility_range=500, init_infection=0.2, exposure_dist=500, max_infection_risk=0.2,\n", " max_recovery_time=5\n", " ):\n", + " super().__init__()\n", " #Scheduler\n", " self.schedule = mesa.time.RandomActivationByType(self)\n", " #Space\n", @@ -1087,6 +1092,14 @@ "# This is required to render the visualization in the Jupyter notebook\n", "page" ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "324cabe0-68be-4aab-a70d-10ffcd328114", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { @@ -1105,7 +1118,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.3" + "version": "3.12.5" } }, "nbformat": 4,