Skip to content

Commit

Permalink
Add a paragraph about limitations to the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
enekomartinmartinez committed Jun 9, 2022
1 parent f0994ed commit 9d6b6fc
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ That reason is this: There is a whole world of computational tools being develop

This approach allows SD modelers to take advantage of the most recent developments in data science, and focus our efforts on improving the part of the stack that is unique to System Dynamics modeling.


Limitations
-----------

Currently PySD does not implement all the functions and features of Vensim and XMILE. This may mean that some models cannot be run with the Python translated version, or can only be partially run. In most cases, functions that are not implemented will be translated as :py:func:`pysd.py_backend.functions.not_implemented_function`. However, the most used functions and features are implemented in PySD and most of the models will run properly.

For more information, see the sections on :ref:`supported Vensim functions <Vensim supported functions>`, :ref:`supported Xmile functions <Xmile supported functions>`, and :ref:`supported Python builder functions <Python supported functions>`. In case you want to add any new functions, please follow the tips in the :doc:`development section <../development/development_index>`. The examples of :doc:`adding functions section <../development/adding_functions>` may help you.

Additional Resources
--------------------

Expand Down
24 changes: 24 additions & 0 deletions pysd/py_backend/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,19 @@ def active_initial(stage, expr, init_val):


def incomplete(*args):
"""
Implements an incomplete functions.
Prompts a RuntimeWarning.
Parameters
----------
*args: arguments
Returns
-------
numpy.nan
"""
warnings.warn(
'Call to undefined function, calling dependencies and returning NaN',
RuntimeWarning, stacklevel=2)
Expand All @@ -277,6 +290,17 @@ def incomplete(*args):


def not_implemented_function(*args):
"""
Implements a not implemented functions.
Raises a NotImplementedError if it is called.
Parameters
----------
*args: arguments
The first argument must be the name of the function as str to
properly print the error message.
"""
raise NotImplementedError(f"Not implemented function '{args[0]}'")


Expand Down

0 comments on commit 9d6b6fc

Please sign in to comment.