diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..497ee55e --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,48 @@ +name: Build and Deploy + +on: + push: + branches: + - main + pull_request: + branches: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Install the dependencies + run: | + python -m pip install -r requirements.txt + - name: Build the JupyterLite site + run: | + cp README.md content + jupyter lite build --contents content --output-dir dist + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./dist + + deploy: + needs: build + if: github.ref == 'refs/heads/main' + permissions: + pages: write + id-token: write + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore index 377535a0..f763470e 100644 --- a/.gitignore +++ b/.gitignore @@ -208,6 +208,7 @@ __pycache__/ # Distribution / packaging .Python build/ +docs/build develop-eggs/ dist/ downloads/ @@ -329,3 +330,8 @@ pip-log.txt mesa_geo/visualization/templates/css/* mesa_geo/visualization/templates/js/* !mesa_geo/visualization/templates/js/MapModule.js + +# Jupyter Lite files +.jupyterlite.doit.db +*.jupyterlite.doit.db +.virtual_documents \ No newline at end of file diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/.nojekyll @@ -0,0 +1 @@ + diff --git a/.readthedocs.yml b/.readthedocs.yml index 02b1d464..4b1829c2 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,4 +1,4 @@ -# Read the Docs configuration file + # Read the Docs configuration file # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details # Required @@ -6,11 +6,13 @@ version: 2 # Build documentation in the docs/ directory with Sphinx sphinx: - configuration: docs/conf.py + configuration: docs/source/conf.py + fail_on_warning: false # Optionally build your docs in additional formats such as PDF formats: - pdf + - epub build: os: "ubuntu-22.04" @@ -24,3 +26,4 @@ python: path: . extra_requirements: - docs + diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index 7a55772f..00000000 --- a/docs/Makefile +++ /dev/null @@ -1,177 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = _build - -# User-friendly check for sphinx-build -ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) -$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) -endif - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . - -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext - -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " texinfo to make Texinfo files" - @echo " info to make Texinfo files and run them through makeinfo" - @echo " gettext to make PO message catalogs" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " xml to make Docutils-native XML files" - @echo " pseudoxml to make pseudoxml-XML files for display purposes" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - -clean: - rm -rf $(BUILDDIR)/* - -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Mesa-Geo.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Mesa-Geo.qhc" - -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/Mesa-Geo" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Mesa-Geo" - @echo "# devhelp" - -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." - -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -latexpdfja: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through platex and dvipdfmx..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -texinfo: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." - -info: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo "Running Texinfo files through makeinfo..." - make -C $(BUILDDIR)/texinfo info - @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." - -gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale - @echo - @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." - -xml: - $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml - @echo - @echo "Build finished. The XML files are in $(BUILDDIR)/xml." - -pseudoxml: - $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml - @echo - @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." diff --git a/docs/README.md b/docs/README.md deleted file mode 100644 index 715105b4..00000000 --- a/docs/README.md +++ /dev/null @@ -1,44 +0,0 @@ -Docs for Mesa-Geo -============= - -The readable version of the docs is hosted at [mesa-geo.readthedocs.org](http://mesa-geo.readthedocs.org/). - -This folder contains the docs that build the docs for Mesa-Geo on readthdocs. - -## How to publish updates to the docs - -Updating docs can be confusing. Here are the basic setups. - -### Install dependencies - -From the project root, install the dependencies for building the docs: - -```shell -pip install -e ".[docs]" -``` - -### Submit a pull request with updates - -1. Create branch (either via branching or fork of repo) -- try to use a descriptive name. - * `git checkout -b doc-updates` -2. Update the docs. Save. -3. Build the docs, from the inside of the docs folder. - * `make html` -4. Commit the changes. If there are new files, you will have to explicit add them. - * `git commit -am "update docs"` -5. Push the branch. - * `git push origin doc-updates` -6. From here you will want to submit a pull request to main. - -### Update read the docs - -From this point, you will need to find someone that has access to readthedocs. Currently, that is [@wang-boyu](https://github.com/wang-boyu). - -1. Accept the pull request into main. -2. Log into readthedocs and launch a new build -- builds take about 10 minutes or so. - -## Helpful Sphnix tips -* Build html from docs: - * `make html` -* Autogenerate / update sphninx from docstrings (replace your name as the author): - * `sphinx-apidoc -A "Jackie Kazil" -F -o docs mesa_geo/` diff --git a/docs/apis/visualization.rst b/docs/apis/visualization.rst deleted file mode 100644 index a801859f..00000000 --- a/docs/apis/visualization.rst +++ /dev/null @@ -1,16 +0,0 @@ -Visualization -------------- - -.. automodule:: visualization.__init__ - :members: - -Modules -~~~~~~~ - -.. automodule:: visualization.modules.__init__ - :members: - -.. automodule:: visualization.modules.MapVisualization - :members: - :inherited-members: - :undoc-members: \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py deleted file mode 100644 index 74f34a08..00000000 --- a/docs/conf.py +++ /dev/null @@ -1,293 +0,0 @@ -#!/usr/bin/env python3 -# -# Mesa-Geo documentation build configuration file, created by -# sphinx-quickstart on Sun Jan 4 23:34:09 2015. -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -from pathlib import Path - - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use Path.resolve() to make it absolute, like shown here. -sys.path.insert(0, str(Path(".").resolve())) -sys.path.insert(0, "../examples") -sys.path.insert(0, "../mesa_geo") - - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -# needs_sphinx = '1.0' - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.doctest", - "sphinx.ext.intersphinx", - "sphinx.ext.todo", - "sphinx.ext.coverage", - "sphinx.ext.mathjax", - "sphinx.ext.ifconfig", - "sphinx.ext.viewcode", - "myst_nb", -] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# The suffix of source filenames. -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = "index" - -# General information about the project. -project = "Mesa-Geo" -copyright = "2017-2023, Project Mesa-Geo Team" - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The short X.Y version. -version = "0.7.1" -# The full version, including alpha/beta/rc tags. -release = "0.7.1" - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -add_module_names = False - -# Sort members by the order in the source files instead of alphabetically -autodoc_member_order = "bysource" - -# Show both the class-level docstring and the constructor docstring -autoclass_content = "both" - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -nb_execution_timeout = 60 -nb_execution_mode = "cache" - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "pydata_sphinx_theme" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -# html_theme_options = {} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = "images/mesa_geo_logo.png" - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = "images/mesa_geo_logo.ico" - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -html_show_sphinx = False - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Output file base name for HTML help builder. -htmlhelp_basename = "MesaGeodoc" - - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - #'preamble': '', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - "index", - "Mesa-Geo.tex", - "Mesa-Geo Documentation", - "Project Mesa-Geo Team", - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ("index", "mesa-geo", "Mesa-Geo Documentation", ["Project Mesa-Geo Team"], 1) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - "index", - "Mesa-Geo", - "Mesa-Geo Documentation", - "Project Mesa-Geo Team", - "Mesa-Geo", - "One line description of project.", - "Miscellaneous", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {"http://docs.python.org/": None} diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index dc1312ab..00000000 --- a/docs/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=source -set BUILDDIR=build - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.https://www.sphinx-doc.org/ - exit /b 1 -) - -if "%1" == "" goto help - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd diff --git a/docs/apis/api_main.md b/docs/source/apis/api_main.md similarity index 84% rename from docs/apis/api_main.md rename to docs/source/apis/api_main.md index fc7746f3..92aa1d93 100644 --- a/docs/apis/api_main.md +++ b/docs/source/apis/api_main.md @@ -8,6 +8,6 @@ GeoBase GeoAgent GeoSpace Raster Layers -visualization Tile Layers +Visualization ``` \ No newline at end of file diff --git a/docs/apis/geo_base.rst b/docs/source/apis/geo_base.rst similarity index 100% rename from docs/apis/geo_base.rst rename to docs/source/apis/geo_base.rst diff --git a/docs/apis/geoagent.rst b/docs/source/apis/geoagent.rst similarity index 100% rename from docs/apis/geoagent.rst rename to docs/source/apis/geoagent.rst diff --git a/docs/apis/geospace.rst b/docs/source/apis/geospace.rst similarity index 100% rename from docs/apis/geospace.rst rename to docs/source/apis/geospace.rst diff --git a/docs/apis/raster_layers.rst b/docs/source/apis/raster_layers.rst similarity index 100% rename from docs/apis/raster_layers.rst rename to docs/source/apis/raster_layers.rst diff --git a/docs/apis/tile_layers.rst b/docs/source/apis/tile_layers.rst similarity index 100% rename from docs/apis/tile_layers.rst rename to docs/source/apis/tile_layers.rst diff --git a/docs/source/apis/visualization.rst b/docs/source/apis/visualization.rst new file mode 100644 index 00000000..b98c2eeb --- /dev/null +++ b/docs/source/apis/visualization.rst @@ -0,0 +1,9 @@ +.. automodule:: mesa_geo.visualization.geojupyter_viz + :members: + :inherited-members: + :undoc-members: + +.. automodule:: mesa_geo.visualization.leaflet_viz + :members: + :inherited-members: + :undoc-members: \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 00000000..49beb4bb --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,171 @@ +#!/usr/bin/env python3 +# +# Mesa-Geo documentation build configuration file, created by +# sphinx-quickstart on Sun Jan 4 23:34:09 2015. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os +import subprocess + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use Path.resolve() to make it absolute, like shown here. +sys.path.insert(0, os.path.abspath('.')) + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.doctest", + "sphinx.ext.intersphinx", + "sphinx.ext.todo", + "sphinx.ext.coverage", + "sphinx.ext.mathjax", + "sphinx.ext.ifconfig", + "sphinx.ext.viewcode", + "myst_nb", + 'jupyterlite_sphinx', +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# The suffix of source filenames. +source_suffix = [".rst", ".md", ".ipynb"] + +# The master toctree document. +master_doc = "index" + +# General information about the project. +project = "Mesa-Geo" +copyright = "2017-2024, Project Mesa-Geo Team" + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +version = "1.0" +release = "1.0" + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# language = None + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = "sphinx" + +# -- Options for HTML output ---------------------------------------------- + +html_theme = "alabaster" + +# -- Options for JupyterLite ---------------------------------------------- +jupyterlite_contents = ["source/tutorials/intro_tutorial.ipynb"] + + + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + #'papersize': 'letterpaper', + # The font size ('10pt', '11pt' or '12pt'). + #'pointsize': '10pt', + # Additional stuff for the LaTeX preamble. + #'preamble': '', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ("index", "Mesa.tex", "Mesa Documentation", "Project Mesa Team", "manual") +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +# latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +# latex_use_parts = False + +# If true, show page references after internal links. +# latex_show_pagerefs = False + +# If true, show URL addresses after external links. +# latex_show_urls = False + +# Documents to append as an appendix to all manuals. +# latex_appendices = [] + +# If false, no module index is generated. +# latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [("index", "mesa", "Mesa Documentation", ["Project Mesa Team"], 1)] + +# If true, show URL addresses after external links. +# man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ( + "index", + "Mesa", + "Mesa Documentation", + "Project Mesa Team", + "Mesa", + "One line description of project.", + "Miscellaneous", + ) +] + +# Documents to append as an appendix to all manuals. +# texinfo_appendices = [] + +# If false, no module index is generated. +# texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +# texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +# texinfo_no_detailmenu = False + +# Example configuration for intersphinx: refer to the Python standard library. +#intersphinx_mapping = {"http://docs.python.org/": None} + +def setup(app): + app.add_js_file('open_new_tab.js') + + kernel_name = 'mesageodev' + display_name = 'Python (Mesa Geo)' + subprocess.run([ + 'python', '-m', 'ipykernel', 'install', '--user', + '--name', kernel_name, '--display-name', display_name + ]) \ No newline at end of file diff --git a/docs/examples/geo_schelling.md b/docs/source/examples/geo_schelling.md similarity index 100% rename from docs/examples/geo_schelling.md rename to docs/source/examples/geo_schelling.md diff --git a/docs/examples/geo_schelling_points.md b/docs/source/examples/geo_schelling_points.md similarity index 100% rename from docs/examples/geo_schelling_points.md rename to docs/source/examples/geo_schelling_points.md diff --git a/docs/examples/geo_sir.md b/docs/source/examples/geo_sir.md similarity index 100% rename from docs/examples/geo_sir.md rename to docs/source/examples/geo_sir.md diff --git a/docs/examples/overview.md b/docs/source/examples/overview.md similarity index 100% rename from docs/examples/overview.md rename to docs/source/examples/overview.md diff --git a/docs/examples/population.md b/docs/source/examples/population.md similarity index 100% rename from docs/examples/population.md rename to docs/source/examples/population.md diff --git a/docs/examples/rainfall.md b/docs/source/examples/rainfall.md similarity index 100% rename from docs/examples/rainfall.md rename to docs/source/examples/rainfall.md diff --git a/docs/examples/urban_growth.md b/docs/source/examples/urban_growth.md similarity index 100% rename from docs/examples/urban_growth.md rename to docs/source/examples/urban_growth.md diff --git a/docs/index.md b/docs/source/index.md similarity index 88% rename from docs/index.md rename to docs/source/index.md index a9cdfa32..2fc48622 100644 --- a/docs/index.md +++ b/docs/source/index.md @@ -33,13 +33,13 @@ Since Mesa-Geo is in early development you could also install the latest version pip install -e git+https://github.com/projectmesa/mesa-geo.git#egg=mesa-geo ``` -Take a look at the [examples](https://github.com/projectmesa/mesa-examples/tree/main/gis) folder for sample models demonstrating Mesa-Geo features. - For more help on using Mesa-Geo, check out the following resources: -- [Introductory Tutorial](http://mesa-geo.readthedocs.org/en/main/tutorials/intro_tutorial.html) -- [Docs](http://mesa-geo.readthedocs.org/en/main/) -- [Mesa-Geo Discussions](https://github.com/projectmesa/mesa-geo/discussions) +- [Introductory Tutorial](tutorials/overview.md) +- [Examples](examples/overview.md) +- [API Documentation](apis/api_main.md) +- [Discussions](https://github.com/projectmesa/mesa/discussions) +- [Issues](https://github.com/projectmesa/mesa-geo/issues) - [PyPI](https://pypi.org/project/mesa-geo/) ## Contributing to Mesa-Geo @@ -67,14 +67,16 @@ To cite Mesa-Geo in your publication, you can use the [CITATION.bib](https://git maxdepth: 2 hidden: true --- + Introduction -Tutorial -examples/overview -API Documentation +Introductory Tutorial +Examples +API Documentation + ``` ## Indices and tables - {ref}`genindex` - {ref}`modindex` -- {ref}`search` +- {ref}`search` \ No newline at end of file diff --git a/docs/tutorials/data/nuts_rg_60M_2013_lvl_2.geojson b/docs/source/tutorials/data/nuts_rg_60M_2013_lvl_2.geojson similarity index 100% rename from docs/tutorials/data/nuts_rg_60M_2013_lvl_2.geojson rename to docs/source/tutorials/data/nuts_rg_60M_2013_lvl_2.geojson diff --git a/docs/tutorials/intro_schelling.ipynb b/docs/source/tutorials/intro_tutorial.ipynb similarity index 96% rename from docs/tutorials/intro_schelling.ipynb rename to docs/source/tutorials/intro_tutorial.ipynb index 4ae7bbbd..fa1e5ac7 100644 --- a/docs/tutorials/intro_schelling.ipynb +++ b/docs/source/tutorials/intro_tutorial.ipynb @@ -22,7 +22,7 @@ "id": "e72b67b0-df4a-42b8-be21-207911e0d04d", "metadata": {}, "source": [ - "## Introductory Tutorial\n", + "# Introductory Tutorial\n", "\n", "This tutorial introduces Mesa-Geo, a GIS integrated Agent Based model platform that is part of the [Mesa ABM Ecosystem](https://mesa.readthedocs.io/en/stable/) \n", "\n", @@ -45,7 +45,7 @@ "* **random** this is a standard python library and used in this model to randomize the country (agents) behavior and preferences\n", "* **mesa** this is the core ABM library that provides basic ABM functionality for `mesa-geo`\n", "* **mesa_geo** this library add GIS features to Mesa to allow for GIS integration into Agent Based Models\n", - "* **mesa_geo.experimental** is a sub_module of mesa_geo, we import this module to make the code more concise so we we do not have to type mg.experimental every time we use this visualization module" + "* **mesa_geo.visualization** is a sub_module of mesa_geo, we import this module to make the code more concise so we we do not have to type mg.visualization every time we use this visualization module" ] }, { @@ -53,10 +53,7 @@ "execution_count": 1, "id": "37528711-4873-42e7-be7f-926130026dd8", "metadata": { - "has_explanation": true, - "jupyter": { - "source_hidden": true - } + "has_explanation": true }, "outputs": [], "source": [ @@ -72,7 +69,7 @@ "id": "e5e2bee2-d440-43c7-81fb-01e6a817e5e5", "metadata": {}, "source": [ - "### Create the Agents\n", + "## Create the Agents\n", "\n", "The next cell creates the GeoAgents, in which European country is randomly assigned a preference of minority or majority and then if the agent is unhappy moves. " ] @@ -166,7 +163,7 @@ "id": "6eac24f2-af00-40bd-b146-1be7a66b1644", "metadata": {}, "source": [ - "### Model Class\n", + "## Model Class\n", "\n", "This class initiates the model class, which acts as a \"manager\" for the simulation, it holds the geo-spatial space. It holds the schedule of agents and their order, and the data collector to collect information from the model." ] @@ -262,7 +259,7 @@ "id": "3ed4ea12-4417-476e-bf6c-4a5f95871005", "metadata": {}, "source": [ - "### Build the Visual\n", + "## Build the Visual\n", "\n", "This section of code set ups the conditions for drawing the agents and defining the model parameters. The next cell passes the `schelling_draw` function and model parameters into Mesa Geo's `GeoJupyterViz` so we can see a visual for our simulation. " ] @@ -341,7 +338,7 @@ "id": "d247f4be-6edd-42b5-8e1a-88ce3604ec09", "metadata": {}, "source": [ - "### Run the Model" + "## Run the Model" ] }, { @@ -378,7 +375,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "6d3d9315432144ad9f34204b6e6fe8a2", + "model_id": "5024c6fa891f4dc4b559e6ae23db8f16", "version_major": 2, "version_minor": 0 }, @@ -423,7 +420,7 @@ ], "metadata": { "kernelspec": { - "display_name": "MesaGeoDev", + "display_name": "Python (Mesa Geo)", "language": "python", "name": "mesageodev" }, @@ -437,7 +434,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.2" + "version": "3.12.3" } }, "nbformat": 4, diff --git a/docs/source/tutorials/intro_tutorial_colab.ipynb b/docs/source/tutorials/intro_tutorial_colab.ipynb new file mode 100644 index 00000000..2f735e6f --- /dev/null +++ b/docs/source/tutorials/intro_tutorial_colab.ipynb @@ -0,0 +1,324 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "60542812-8cbe-498b-b689-b0d01c80c148", + "metadata": { + "explanatory": true + }, + "source": [ + "#explanatory\n", + "\n", + "This cell imports the necessary libraries we will need for this demonstration\n", + "\n", + "* **random** is imported for ...\n", + "* **mesa** imports core mesa to give us basic agentbased model functionality\n", + "* **mesa_geo** imports GIS functionality for agent based models\n", + "* **mesa_geo.experimental** is a sub-module of `mesa_geo` that will will import as mge so we do not have to write out `mesa_geo.experimental` everytime" + ] + }, + { + "cell_type": "markdown", + "id": "e72b67b0-df4a-42b8-be21-207911e0d04d", + "metadata": {}, + "source": [ + "# Introductory Tutorial\n", + "\n", + "This tutorial introduces Mesa-Geo, a GIS integrated Agent Based model platform that is part of the [Mesa ABM Ecosystem](https://mesa.readthedocs.io/en/stable/) \n", + "\n", + "In this tutorial we will build a Geo-Schelling model, which takes the seminal [Schelling Segregation model](https://en.wikipedia.org/wiki/Schelling%27s_model_of_segregation) and replicates with the countries of Europe, were the countries \"move\" their preference similar to the Schelling Model. \n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "35dbfaed-26a6-463a-a0f2-b26989e7e824", + "metadata": { + "has_explanation": false + }, + "outputs": [], + "source": [ + "!pip install mesa-geo --quiet\n", + "\n", + "import random\n", + "\n", + "import mesa\n", + "import mesa_geo as mg\n", + "import mesa_geo.visualization as mgv" + ] + }, + { + "cell_type": "markdown", + "id": "e5e2bee2-d440-43c7-81fb-01e6a817e5e5", + "metadata": {}, + "source": [ + "## Create the Agents\n", + "\n", + "The next cell creates the GeoAgents, in which European country is randomly assigned a preference of minority or majority and then if the agent is unhappy moves. " + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "27cac12c-515e-4ef4-83cc-d06918921c70", + "metadata": { + "has_explanation": false + }, + "outputs": [], + "source": [ + "class SchellingAgent(mg.GeoAgent):\n", + " \"\"\"Schelling segregation agent.\"\"\"\n", + "\n", + " def __init__(self, unique_id, model, geometry, crs, agent_type=None):\n", + " \"\"\"Create a new Schelling agent.\n", + "\n", + " Args:\n", + " unique_id: Unique identifier for the agent.\n", + " agent_type: Indicator for the agent's type (minority=1, majority=0)\n", + " \"\"\"\n", + " super().__init__(unique_id, model, geometry, crs)\n", + " self.atype = agent_type\n", + "\n", + " def step(self):\n", + " \"\"\"Advance agent one step.\"\"\"\n", + " similar = 0\n", + " different = 0\n", + " neighbors = self.model.space.get_neighbors(self)\n", + " if neighbors:\n", + " for neighbor in neighbors:\n", + " if neighbor.atype is None:\n", + " continue\n", + " elif neighbor.atype == self.atype:\n", + " similar += 1\n", + " else:\n", + " different += 1\n", + "\n", + " # If unhappy, move:\n", + " if similar < different:\n", + " # Select an empty region\n", + " empties = [a for a in self.model.space.agents if a.atype is None]\n", + " # Switch atypes and add/remove from scheduler\n", + " new_region = random.choice(empties)\n", + " new_region.atype = self.atype\n", + " self.model.schedule.add(new_region)\n", + " self.atype = None\n", + " self.model.schedule.remove(self)\n", + " else:\n", + " self.model.happy += 1\n", + "\n", + " def __repr__(self):\n", + " return \"Agent \" + str(self.unique_id)" + ] + }, + { + "cell_type": "markdown", + "id": "6eac24f2-af00-40bd-b146-1be7a66b1644", + "metadata": {}, + "source": [ + "## Model Class\n", + "\n", + "This class initiates the model class, which acts as a \"manager\" for the simulation, it holds the geo-spatial space. It holds the schedule of agents and their order, and the data collector to collect information from the model." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "9c9a9738-7e8f-458c-b0aa-cfc69c04ee87", + "metadata": { + "has_explanation": false, + "jupyter": { + "source_hidden": true + } + }, + "outputs": [], + "source": [ + "class GeoSchelling(mesa.Model):\n", + " \"\"\"Model class for the Schelling segregation model.\"\"\"\n", + "\n", + " def __init__(self, density=0.6, minority_pc=0.2, export_data=False):\n", + " super().__init__()\n", + " self.density = density\n", + " self.minority_pc = minority_pc\n", + " self.export_data = export_data\n", + "\n", + " self.schedule = mesa.time.RandomActivation(self)\n", + " self.space = mg.GeoSpace(crs=\"EPSG:4326\", warn_crs_conversion=True)\n", + "\n", + " self.happy = 0\n", + " self.datacollector = mesa.DataCollector({\"happy\": \"happy\"})\n", + "\n", + " self.running = True\n", + "\n", + " # Set up the grid with patches for every NUTS region\n", + " ac = mg.AgentCreator(SchellingAgent, model=self)\n", + " agents = ac.from_file(\"data/nuts_rg_60M_2013_lvl_2.geojson\")\n", + " self.space.add_agents(agents)\n", + "\n", + " # Set up agents\n", + " for agent in agents:\n", + " if random.random() < self.density:\n", + " if random.random() < self.minority_pc:\n", + " agent.atype = 1\n", + " else:\n", + " agent.atype = 0\n", + " self.schedule.add(agent)\n", + "\n", + " def export_agents_to_file(self) -> None:\n", + " self.space.get_agents_as_GeoDataFrame(agent_cls=SchellingAgent).to_crs(\n", + " \"epsg:4326\"\n", + " ).to_file(\"data/schelling_agents.geojson\", driver=\"GeoJSON\")\n", + "\n", + " def step(self):\n", + " \"\"\"Run one step of the model.\n", + "\n", + " If All agents are happy, halt the model.\n", + " \"\"\"\n", + "\n", + " self.happy = 0 # Reset counter of happy agents\n", + " self.schedule.step()\n", + " self.datacollector.collect(self)\n", + "\n", + " if self.happy == self.schedule.get_agent_count():\n", + " self.running = False\n", + "\n", + " if not self.running and self.export_data:\n", + " self.export_agents_to_file()" + ] + }, + { + "cell_type": "markdown", + "id": "3ed4ea12-4417-476e-bf6c-4a5f95871005", + "metadata": {}, + "source": [ + "## Build the Visual\n", + "\n", + "This section of code set ups the conditions for drawing the agents and defining the model parameters. The next cell passes the `schelling_draw` function and model parameters into Mesa Geo's `GeoJupyterViz` so we can see a visual for our simulation. " + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "0bf74b4c-36ab-416c-a4db-ab5104189d92", + "metadata": { + "has_explanation": false + }, + "outputs": [], + "source": [ + "def schelling_draw(agent):\n", + " \"\"\"\n", + " Portrayal Method for canvas\n", + " \"\"\"\n", + " portrayal = {}\n", + " if agent.atype is None:\n", + " portrayal[\"color\"] = \"Grey\"\n", + " elif agent.atype == 0:\n", + " portrayal[\"color\"] = \"Orange\"\n", + " else:\n", + " portrayal[\"color\"] = \"Blue\"\n", + " return portrayal\n", + "\n", + "\n", + "model_params = {\n", + " \"density\": {\n", + " \"type\": \"SliderFloat\",\n", + " \"value\": 0.6,\n", + " \"label\": \"Population Density\",\n", + " \"min\": 0.0,\n", + " \"max\": 0.9, #there must be an empty space for the agent to move\n", + " \"step\": 0.1,\n", + " },\n", + " \"minority_pc\": {\n", + " \"type\": \"SliderFloat\",\n", + " \"value\": 0.2,\n", + " \"label\": \"Fraction Minority\",\n", + " \"min\": 0.0,\n", + " \"max\": 1.0,\n", + " \"step\": 0.05,\n", + " },\n", + " \"export_data\": {\n", + " \"type\": \"Checkbox\",\n", + " \"value\": False,\n", + " \"description\": \"Export Data\",\n", + " \"disabled\": False,\n", + " },\n", + "}" + ] + }, + { + "cell_type": "markdown", + "id": "d247f4be-6edd-42b5-8e1a-88ce3604ec09", + "metadata": {}, + "source": [ + "## Run the Model" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "c8a2533e-95ba-4a2b-b21a-56e05fe3b7b2", + "metadata": { + "has_explanation": false + }, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "5024c6fa891f4dc4b559e6ae23db8f16", + "version_major": 2, + "version_minor": 0 + }, + "text/html": [ + "Cannot show widget. You probably want to rerun the code cell above (Click in the code cell, and press Shift+Enter +)." + ], + "text/plain": [ + "Cannot show ipywidgets in text" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "page = mgv.GeoJupyterViz(\n", + " GeoSchelling,\n", + " model_params,\n", + " measures=[\"happy\"],\n", + " name=\"Geo-Schelling Model\",\n", + " agent_portrayal=schelling_draw,\n", + " zoom=3,\n", + " center_point=[52, 12],\n", + ")\n", + "# This is required to render the visualization in the Jupyter notebook\n", + "page" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7cbb2272-b33d-4f1d-9c90-1abbdc876723", + "metadata": { + "has_explanation": false, + "jupyter": { + "source_hidden": true + } + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3.12 (XPython)", + "language": "python", + "name": "xpython" + }, + "language_info": { + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "version": "3.12.2" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/docs/source/tutorials/overview.md b/docs/source/tutorials/overview.md new file mode 100644 index 00000000..bfad1240 --- /dev/null +++ b/docs/source/tutorials/overview.md @@ -0,0 +1,45 @@ + +# Introductory Tutorial + +**Geo-Schelling Model** + +In this tutorial we will build a Geo-Schelling model, which takes the seminal +[Schelling Segregation model](https://en.wikipedia.org/wiki/Schelling%27s_model_of_segregation) +and replicates with the countries of Europe, were the countries "move" their +preference similar to the Schelling Model. + +Users can use Google Colab or Jupyter Lite to use this tutorial. + +[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/tpike3/mesa-geo/blob/newsphinx/docs/source/tutorials/intro_tutorial_colab.ipynb) + +This tutorial uses JupyterLite to allow users to immediately access and adjust +code. + +This tutorial also uses [Jupyter Bridge](https://pypi.org/project/jupyter-bridge/) +so users can see more detailed explanations of each code cell if desired by +clicking the book icon. + +```{eval-rst} +.. jupyterlite:: intro_tutorial.ipynb + :width: 100% + :height: 600px + :prompt: Do The Geo-Schelling Tutorial! + :prompt_color: #00aa42 + +.. jupyterlite:: intro_tutorial.ipynb + :new_tab: True + :prompt: Open in a new tab! + +``` + +```{toctree} +--- +maxdepth: 2 +hidden: true +--- + +Introductory Tutorial +Intro Tutorial Colab + +``` + diff --git a/mesa_geo/__init__.py b/mesa_geo/__init__.py index 8021bd5c..a89c0915 100644 --- a/mesa_geo/__init__.py +++ b/mesa_geo/__init__.py @@ -6,7 +6,6 @@ import datetime -from mesa_geo import visualization from mesa_geo.geoagent import AgentCreator, GeoAgent from mesa_geo.geospace import GeoSpace from mesa_geo.raster_layers import Cell, ImageLayer, RasterLayer diff --git a/mesa_geo/visualization/geojupyter_viz.py b/mesa_geo/visualization/geojupyter_viz.py index 4e850672..91bad90c 100644 --- a/mesa_geo/visualization/geojupyter_viz.py +++ b/mesa_geo/visualization/geojupyter_viz.py @@ -1,10 +1,10 @@ import sys import matplotlib.pyplot as plt -import mesa.visualization.components.matplotlib as components_matplotlib +import mesa.experimental.components.matplotlib as components_matplotlib import solara import xyzservices.providers as xyz -from mesa.visualization import jupyter_viz as jv +from mesa.experimental import jupyter_viz as jv from solara.alias import rv import mesa_geo.visualization.leaflet_viz as leaflet_viz diff --git a/setup.cfg b/setup.cfg index 4af7ad02..4c954408 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,7 +30,7 @@ python_requires = >=3.9 packages = find: include_package_data = True install_requires = - mesa~=2.1.0 + mesa~=2.3.0 geopandas libpysal rtree @@ -40,15 +40,14 @@ install_requires = pyproj folium xyzservices>=2022.9.0 + ipyleaflet + jupyter_bridge + xeus-python + + [options.package_data] -mesa_geo = - visualization/templates/*.html - visualization/templates/css/* - visualization/templates/css/external/* - visualization/templates/js/* - visualization/templates/js/external/* - visualization/templates/external/**/**/* +mesa_geo = *.md, *.rst, *.ipynb [options.extras_require] dev = @@ -62,6 +61,10 @@ docs = sphinx_rtd_theme pydata_sphinx_theme myst-nb + jupyterlite_sphinx + xeus-python + + [options.packages.find] exclude =