Improve tutorial
* Improve text * Move to docs * Autogenerate with sphinx * Fix naming issue `environment.run` (double name) * Add to tests
@ -4,7 +4,7 @@
|
|||||||
Soil is an extensible and user-friendly Agent-based Social Simulator for Social Networks.
|
Soil is an extensible and user-friendly Agent-based Social Simulator for Social Networks.
|
||||||
Learn how to run your own simulations with our [documentation](http://soilsim.readthedocs.io).
|
Learn how to run your own simulations with our [documentation](http://soilsim.readthedocs.io).
|
||||||
|
|
||||||
Follow our [tutorial](examples/tutorial/soil_tutorial.ipynb) to develop your own agent models.
|
Follow our [tutorial](docs/tutorial/soil_tutorial.ipynb) to develop your own agent models.
|
||||||
|
|
||||||
> **Warning**
|
> **Warning**
|
||||||
> Soil 1.0 introduced many fundamental changes. Check the [documention on how to update your simulations to work with newer versions](docs/notes_v1.0.rst)
|
> Soil 1.0 introduced many fundamental changes. Check the [documention on how to update your simulations to work with newer versions](docs/notes_v1.0.rst)
|
||||||
|
10
docs/conf.py
@ -31,7 +31,10 @@
|
|||||||
# Add any Sphinx extension module names here, as strings. They can be
|
# Add any Sphinx extension module names here, as strings. They can be
|
||||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||||
# ones.
|
# ones.
|
||||||
extensions = ['IPython.sphinxext.ipython_console_highlighting']
|
extensions = [
|
||||||
|
"IPython.sphinxext.ipython_console_highlighting",
|
||||||
|
"nbsphinx",
|
||||||
|
]
|
||||||
|
|
||||||
# Add any paths that contain templates here, relative to this directory.
|
# Add any paths that contain templates here, relative to this directory.
|
||||||
templates_path = ['_templates']
|
templates_path = ['_templates']
|
||||||
@ -64,7 +67,7 @@ release = '0.1'
|
|||||||
#
|
#
|
||||||
# This is also used if you do content translation via gettext catalogs.
|
# This is also used if you do content translation via gettext catalogs.
|
||||||
# Usually you set "language" from the command line for these cases.
|
# Usually you set "language" from the command line for these cases.
|
||||||
language = None
|
language = "en"
|
||||||
|
|
||||||
# List of patterns, relative to source directory, that match files and
|
# List of patterns, relative to source directory, that match files and
|
||||||
# directories to ignore when looking for source files.
|
# directories to ignore when looking for source files.
|
||||||
@ -152,6 +155,3 @@ texinfo_documents = [
|
|||||||
author, 'Soil', 'One line description of project.',
|
author, 'Soil', 'One line description of project.',
|
||||||
'Miscellaneous'),
|
'Miscellaneous'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,19 +2,20 @@ Welcome to Soil's documentation!
|
|||||||
================================
|
================================
|
||||||
|
|
||||||
Soil is an opinionated Agent-based Social Simulator in Python focused on Social Networks.
|
Soil is an opinionated Agent-based Social Simulator in Python focused on Social Networks.
|
||||||
|
To get started developing your own simulations and agent behaviors, check out our :doc:`Tutorial <soil_tutorial>` and the `examples on GitHub <https://github.com/gsi-upm/soil/tree/master/examples>`.
|
||||||
|
|
||||||
|
Soil can be installed through pip (see more details in the :doc:`installation` page):.
|
||||||
|
|
||||||
.. image:: soil.png
|
.. image:: soil.png
|
||||||
:width: 80%
|
:width: 80%
|
||||||
:align: center
|
:align: center
|
||||||
|
|
||||||
Soil can be installed through pip (see more details in the :doc:`installation` page):
|
|
||||||
|
|
||||||
.. code:: bash
|
.. code:: bash
|
||||||
|
|
||||||
pip install soil
|
pip install soil
|
||||||
|
|
||||||
|
|
||||||
To get started developing your own simulations and agent behaviors, check out our :doc:`Tutorial <soil_tutorial>` and the `examples on GitHub <https://github.com/gsi-upm/soil/tree/master/examples>.
|
|
||||||
|
|
||||||
If you use Soil in your research, do not forget to cite this paper:
|
If you use Soil in your research, do not forget to cite this paper:
|
||||||
|
|
||||||
@ -46,7 +47,8 @@ If you use Soil in your research, do not forget to cite this paper:
|
|||||||
:caption: Learn more about soil:
|
:caption: Learn more about soil:
|
||||||
|
|
||||||
installation
|
installation
|
||||||
Tutorial <soil_tutorial>
|
Tutorial <tutorial/soil_tutorial>
|
||||||
|
notes_v1.0
|
||||||
|
|
||||||
..
|
..
|
||||||
|
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
Upgrading to Soil 1.0
|
||||||
|
---------------------
|
||||||
|
|
||||||
What are the main changes in version 1.0?
|
What are the main changes in version 1.0?
|
||||||
#########################################
|
#########################################
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 952 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 53 KiB |
@ -1 +1,2 @@
|
|||||||
ipython>=7.31.1
|
ipython>=7.31.1
|
||||||
|
nbsphinx==0.9.1
|
||||||
|
4
setup.py
@ -17,9 +17,9 @@ def parse_requirements(filename):
|
|||||||
install_reqs = parse_requirements("requirements.txt")
|
install_reqs = parse_requirements("requirements.txt")
|
||||||
test_reqs = parse_requirements("test-requirements.txt")
|
test_reqs = parse_requirements("test-requirements.txt")
|
||||||
extras_require={
|
extras_require={
|
||||||
'mesa': ['mesa>=0.8.9'],
|
|
||||||
'geo': ['scipy>=1.3'],
|
'geo': ['scipy>=1.3'],
|
||||||
'web': ['tornado']
|
'web': ['tornado'],
|
||||||
|
'ipython': ['ipython==8.12', 'nbformat==5.8'],
|
||||||
}
|
}
|
||||||
extras_require['all'] = [dep for package in extras_require.values() for dep in package]
|
extras_require['all'] = [dep for package in extras_require.values() for dep in package]
|
||||||
|
|
||||||
|
@ -216,10 +216,11 @@ class BaseEnvironment(Model):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def run(cls, *,
|
def run(cls, *,
|
||||||
|
name=None,
|
||||||
iterations=1,
|
iterations=1,
|
||||||
num_processes=1, **kwargs):
|
num_processes=1, **kwargs):
|
||||||
from .simulation import Simulation
|
from .simulation import Simulation
|
||||||
return Simulation(name=cls.__name__,
|
return Simulation(name=name or cls.__name__,
|
||||||
model=cls, iterations=iterations,
|
model=cls, iterations=iterations,
|
||||||
num_processes=num_processes, **kwargs).run()
|
num_processes=num_processes, **kwargs).run()
|
||||||
|
|
||||||
|
@ -2,3 +2,5 @@ pytest
|
|||||||
pytest-profiling
|
pytest-profiling
|
||||||
scipy>=1.3
|
scipy>=1.3
|
||||||
tornado
|
tornado
|
||||||
|
nbconvert==7.3.1
|
||||||
|
nbformat==5.8.0
|
||||||
|
@ -7,7 +7,7 @@ ROOT = os.path.abspath(os.path.dirname(__file__))
|
|||||||
|
|
||||||
class TestNotebooks(TestCase):
|
class TestNotebooks(TestCase):
|
||||||
def test_tutorial(self):
|
def test_tutorial(self):
|
||||||
notebook = os.path.join(ROOT, "../examples/tutorial/soil_tutorial.ipynb")
|
notebook = os.path.join(ROOT, "../docs/tutorial/soil_tutorial.ipynb")
|
||||||
with open(notebook) as f:
|
with open(notebook) as f:
|
||||||
nb = nbformat.read(f, as_version=4)
|
nb = nbformat.read(f, as_version=4)
|
||||||
ep = ExecutePreprocessor(timeout=60000, kernel_name='python3')
|
ep = ExecutePreprocessor(timeout=60000, kernel_name='python3')
|
||||||
|