-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from fenfisdi/issue/12/update_docstrings
Updated documentation - minor refactors on code Features * base documentation with examples and how to install the package * refactored the predefined models into sub-packages * renamed ``Optimize.minimize`` -> ``Optimize.optimize``
- Loading branch information
Showing
28 changed files
with
595 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,6 +73,7 @@ instance/ | |
|
||
# Sphinx documentation | ||
docs/_build/ | ||
docs/source/_build | ||
|
||
# PyBuilder | ||
.pybuilder/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +0,0 @@ | ||
from ._seir_model import ModelSEIR | ||
from ._seirv_model import ModelSEIRV | ||
from ._seirv_fixed import ModelSimpleSEIRV | ||
from ._sir_model import ModelSIR | ||
|
||
__all__ = [ | ||
'ModelSEIR', | ||
'ModelSEIRV', | ||
'ModelSimpleSEIRV', | ||
'ModelSIR', | ||
] | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from ._seir_model import ModelSEIR | ||
from ._seirv_model import ModelSEIRV | ||
from ._seirv_fixed import ModelSimpleSEIRV | ||
from ._sir_model import ModelSIR | ||
|
||
__all__ = [ | ||
'ModelSEIR', | ||
'ModelSEIRV', | ||
'ModelSimpleSEIRV', | ||
'ModelSIR', | ||
] |
2 changes: 1 addition & 1 deletion
2
dinjo/predefined/_seir_model.py → dinjo/predefined/epidemiology/_seir_model.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from typing import List | ||
|
||
from ..model import ModelIVP | ||
from ...model import ModelIVP | ||
|
||
|
||
class ModelSEIR(ModelIVP): | ||
|
2 changes: 1 addition & 1 deletion
2
dinjo/predefined/_seirv_fixed.py → ...o/predefined/epidemiology/_seirv_fixed.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
dinjo/predefined/_seirv_model.py → ...o/predefined/epidemiology/_seirv_model.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from typing import List | ||
|
||
from ..model import ModelIVP | ||
from ...model import ModelIVP | ||
|
||
|
||
class ModelSEIRV(ModelIVP): | ||
|
2 changes: 1 addition & 1 deletion
2
dinjo/predefined/_sir_model.py → dinjo/predefined/epidemiology/_sir_model.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from typing import List | ||
|
||
from ..model import ModelIVP | ||
from ...model import ModelIVP | ||
|
||
|
||
class ModelSIR(ModelIVP): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from ._harmonic_oscillator import ModelOscillator | ||
|
||
__all__ = [ | ||
'ModelOscillator', | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from ...model import ModelIVP | ||
|
||
|
||
class ModelOscillator(ModelIVP): | ||
def build_model(self, t, y, w): | ||
"""Harmonic Oscillator differential equations | ||
""" | ||
q, p = y | ||
|
||
# Hamilton's equations | ||
dydt = [ | ||
p, | ||
- (w ** 2) * q | ||
] | ||
|
||
return dydt |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. _code-dinjo.model: | ||
|
||
========================= | ||
:mod:`dinjo.model` module | ||
========================= | ||
|
||
.. automodule:: dinjo.model | ||
:members: | ||
:undoc-members: reference_t_values | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. _code-dinjo.optimizer: | ||
|
||
============================= | ||
:mod:`dinjo.optimizer` module | ||
============================= | ||
|
||
.. automodule:: dinjo.optimizer | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
.. _code-dinjo.predefined.epidemiology: | ||
|
||
=============================================== | ||
:mod:`dinjo.predefined.epidemiology` subpackage | ||
=============================================== | ||
|
||
For your convenience, the classes | ||
:py:class:`~dinjo.predefined.epidemiology._seir_model.ModelSEIR`, | ||
:py:class:`~dinjo.predefined.epidemiology._seirv_model.ModelSEIRV`, | ||
:py:class:`~dinjo.predefined.epidemiology._seirv_fixed.ModelSimpleSEIRV`, | ||
:py:class:`~dinjo.predefined.epidemiology._sir_model.ModelSIR` | ||
can be imported directly from the subpackage | ||
:mod:`dinjo.predefined.epidemiology`: | ||
|
||
.. code-block:: python | ||
from dinjo.predefined.epidemiology import ( | ||
ModelSEIR, | ||
ModelSEIRV, | ||
ModelSimpleSEIRV, | ||
ModelSIR | ||
) | ||
Submodules | ||
========== | ||
|
||
:mod:`dinjo.predefined.epidemiology._seir_model` | ||
------------------------------------------------ | ||
|
||
.. automodule:: dinjo.predefined.epidemiology._seir_model | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
|
||
:mod:`dinjo.predefined.epidemiology._seirv_model` | ||
------------------------------------------------- | ||
|
||
.. automodule:: dinjo.predefined.epidemiology._seirv_model | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
|
||
:mod:`dinjo.predefined.epidemiology._seirv_fixed` | ||
------------------------------------------------- | ||
|
||
.. automodule:: dinjo.predefined.epidemiology._seirv_fixed | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
|
||
:mod:`dinjo.predefined.epidemiology._sir_model` | ||
------------------------------------------------ | ||
|
||
.. automodule:: dinjo.predefined.epidemiology._sir_model | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,23 @@ | ||
dinjo.predefined package | ||
======================== | ||
.. _code-dinjo.predefined: | ||
|
||
Module contents | ||
--------------- | ||
================================== | ||
:mod:`dinjo.predefined` subpackage | ||
================================== | ||
|
||
|
||
Package contents | ||
================ | ||
|
||
.. automodule:: dinjo.predefined | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
|
||
Subpackages | ||
=========== | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
|
||
dinjo.predefined.epidemiology |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,32 @@ | ||
dinjo | ||
===== | ||
.. _code-dinjo: | ||
|
||
==================== | ||
:mod:`dinjo` package | ||
==================== | ||
|
||
Package contents | ||
================ | ||
|
||
.. automodule:: dinjo | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
|
||
Subpackages | ||
----------- | ||
=========== | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
|
||
dinjo.predefined | ||
|
||
|
||
Submodules | ||
========== | ||
|
||
dinjo.model | ||
----------- | ||
|
||
.. automodule:: dinjo.model | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
dinjo.optimizer | ||
--------------- | ||
|
||
.. automodule:: dinjo.optimizer | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
Module contents | ||
=============== | ||
.. toctree:: | ||
:maxdepth: 4 | ||
|
||
.. automodule:: dinjo | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
dinjo.model | ||
dinjo.optimizer |
Oops, something went wrong.