diff --git a/docs/Makefile b/docs/Makefile index d0c3cbf..d4bb2cb 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -5,8 +5,8 @@ # from the environment for the first two. SPHINXOPTS ?= SPHINXBUILD ?= sphinx-build -SOURCEDIR = source -BUILDDIR = build +SOURCEDIR = . +BUILDDIR = _build # Put it first so that "make" without argument is like "make help". help: diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..f51fcfb --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,32 @@ +import os +import sys +sys.path.insert(0, os.path.abspath('../src/epidemik/')) + +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = 'epidemik' +copyright = '2024, Bruno Goncalves' +author = 'Bruno Goncalves' +release = '0.0.20' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [] + +templates_path = ['_templates'] +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = 'sphinx_rtd_theme' +html_static_path = ['_static'] diff --git a/docs/epidemik.rst b/docs/epidemik.rst new file mode 100644 index 0000000..374f1c5 --- /dev/null +++ b/docs/epidemik.rst @@ -0,0 +1,45 @@ +epidemik package +================ + +Submodules +---------- + +epidemik.EpiModel module +------------------------ + +.. automodule:: epidemik.EpiModel + :members: + :undoc-members: + :show-inheritance: + +epidemik.MetaEpiModel module +---------------------------- + +.. automodule:: epidemik.MetaEpiModel + :members: + :undoc-members: + :show-inheritance: + +epidemik.NetworkEpiModel module +------------------------------- + +.. automodule:: epidemik.NetworkEpiModel + :members: + :undoc-members: + :show-inheritance: + +epidemik.utils module +--------------------- + +.. automodule:: epidemik.utils + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: epidemik + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..4c59ea2 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,20 @@ +.. epidemik documentation master file, created by + sphinx-quickstart on Mon Apr 15 09:20:13 2024. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to epidemik's documentation! +==================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/make.bat b/docs/make.bat index 6247f7e..32bb245 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -7,10 +7,8 @@ REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) -set SOURCEDIR=source -set BUILDDIR=build - -if "%1" == "" goto help +set SOURCEDIR=. +set BUILDDIR=_build %SPHINXBUILD% >NUL 2>NUL if errorlevel 9009 ( @@ -21,10 +19,12 @@ if errorlevel 9009 ( echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ + echo.https://www.sphinx-doc.org/ exit /b 1 ) +if "%1" == "" goto help + %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% goto end diff --git a/docs/modules.rst b/docs/modules.rst new file mode 100644 index 0000000..6b48f2e --- /dev/null +++ b/docs/modules.rst @@ -0,0 +1,7 @@ +epidemik +======== + +.. toctree:: + :maxdepth: 4 + + epidemik diff --git a/docs/requirements.txt b/docs/requirements.txt index 53fc1f3..5cedc4e 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,2 +1,6 @@ -sphinx==7.1.2 -sphinx-rtd-theme==1.3.0rc1 +matplotlib>=3.3 +networkx>=3 +numpy>=1.2 +pandas>=2.0 +scipy>=1.10 +tqdm>=4 diff --git a/docs/source/conf.py b/docs/source/conf.py deleted file mode 100644 index 2cbf19f..0000000 --- a/docs/source/conf.py +++ /dev/null @@ -1,55 +0,0 @@ -# Configuration file for the Sphinx documentation builder. -# -# This file only contains a selection of the most common options. For a full -# list see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -# -- Path setup -------------------------------------------------------------- - -# 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 os.path.abspath to make it absolute, like shown here. -# -# import os -# import sys -# sys.path.insert(0, os.path.abspath('.')) - - -# -- Project information ----------------------------------------------------- - -project = 'epidemik' -copyright = '2024, Bruno Gonçalves' -author = 'Bruno Gonçalves' - -# The full version, including alpha/beta/rc tags -release = '0.0.14' - - -# -- General configuration --------------------------------------------------- - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ -] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path. -exclude_patterns = [] - - -# -- 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 = 'alabaster' - -# 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'] \ No newline at end of file diff --git a/docs/source/index.rst b/docs/source/index.rst deleted file mode 100644 index 419d004..0000000 --- a/docs/source/index.rst +++ /dev/null @@ -1,60 +0,0 @@ -.. epidemik documentation master file, created by - sphinx-quickstart on Mon Apr 8 18:21:22 2024. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to epidemik's documentation! -==================================== - -.. toctree:: - :maxdepth: 2 - :caption: Contents: - - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` - - -Introduction text. - -.. note:: - - This would show up as a boxed note to the reader. It's good for ensuring important points/hints are seen but should be used sparingly. It's also a good way to note that "This guide is under developement." - - -Section Title -------------- - -We use double backticks to indicate ``inline-code`` including file names, function and method names, paths, etc. - -Longer code-blocks should begin with the ``.. code-block:: [type]`` directive and should be indented at least one -level. There should also be a blank line before and after it as shown below. - -.. code-block:: bash - - if ($needs_documentation) { - use $these_guidelines; - $contribute_docs = $appreciated; - } - -Section 1.1 Title -^^^^^^^^^^^^^^^^^ - -The use of appropriate sections makes reading documentation and later specific details easier. Sub sections such -as this one will be hidden unless the main section is already selected. - -The following toctree specifies that there are 3 files with additional content for the current page. -The order is as it will appear in the sidebar and the link titles will be the "Title of File" for each file. - -.. toctree:: - :maxdepth: 2 - :caption: Contents: - - dir/file1 - dir/file2 - dir/file3 \ No newline at end of file diff --git a/tests/tests_MetaEpiModel.py b/tests/tests_MetaEpiModel.py index e4075ea..e92004c 100644 --- a/tests/tests_MetaEpiModel.py +++ b/tests/tests_MetaEpiModel.py @@ -5,8 +5,8 @@ class MetaEpiModelTestCase(unittest.TestCase): def setUp(self): - self.travel = pd.DataFrame({'A': [0.9, 0.1], 'B':[0.1, 0.9]}, index=["A", "B"]) - self.population = pd.DataFrame({'Population':[100000, 10000]}, index=["A", "B"]) + self.travel = pd.DataFrame({'A': [0.99, 0.1], 'B':[0.01, 0.9]}, index=["A", "B"]) + self.population = pd.DataFrame({'Population':[100_000, 10_000]}, index=["A", "B"]) self.SIR = MetaEpiModel(self.travel, self.population) self.beta = 0.3