Skip to content

Commit

Permalink
Check documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
don4get committed Jun 28, 2020
1 parent 0b1356b commit d740cf8
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 30 deletions.
37 changes: 18 additions & 19 deletions docs/source/evaluation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,28 @@
Evaluation
==========

TL;DR: The evaluation system uses
The evaluation system uses
:func:`~nodedge.node.Node.eval` and
:func:`~nodedge.node.Node.evalChildren`. ``eval`` is supposed to be overridden by your own
implementation. The evaluation logic uses Flags for marking the `Nodes` to be `Dirty` and/or `Invalid`.
implementation. The evaluation logic uses Flags for marking the `Nodes` as `Dirty` and/or `Invalid`.

Evaluation Functions
--------------------

There are 2 main methods used for evaluation:
There are 2 main methods used for the evaluation:

- :func:`~nodedge.node.Node.eval`
- :func:`~nodedge.node.Node.evalChildren`

These functions are mutually exclusive. That means that ``evalChildren`` does **not** eval current `Node`,
These functions are mutually exclusive. That means that ``evalChildren`` does **not** eval the current `Node`,
but only children of the current `Node`.

By default the implementation of :func:`~nodedge.node.Node.eval` is "empty" and return 0. However
it seems logical, that eval (if successfull) resets the `Node` not to be `Dirty` nor `Invalid`.
This method is supposed to be overridden by your own implementation. As an example, you can check out
the repository's ``examples/example_calculator`` to have an inspiration how to setup the
`Node` evaluation on your own.
By default the implementation of :func:`~nodedge.node.Node.eval` is "empty" and return 0. However, if successful, eval resets the `Node` not to be `Dirty` nor `Invalid`.
This method is supposed to be overridden by your own implementation. If you look for examples, please check
out ``examples/example_calculator`` to get inspiration on how to setup your own
`Node` evaluation.

The evaluation takes advantage of `Node` flags described below.
The evaluation takes advantage of the `Node` flags described below.

:class:`~nodedge.node.Node` Flags
-----------------------------------------
Expand All @@ -35,10 +34,10 @@ Each :class:`~nodedge.node.Node` has 2 flags:
- ``Dirty``
- ``Invalid``

The `Invalid` flag has always higher priority. That means when the `Node` is `Invalid` it
doesn't matter if it is `Dirty` or not.
The `Invalid` flag has always higher priority over `Dirty`. This means that if the `Node` is `Invalid` it
does not matter whether it is `Dirty` or not.

To mark a node `Dirty` or `Invalid` there are respective methods :func:`~nodedge.node.Node.markDirty`
To mark a node as `Dirty` or `Invalid` there are respective methods :func:`~nodedge.node.Node.markDirty`
and :func:`~nodedge.node.Node.markInvalid`. Both methods take `bool` parameter for the new state.
You can mark `Node` dirty by setting the parameter to ``True``. Also you can un-mark the state by passing
``False`` value.
Expand All @@ -49,15 +48,15 @@ For both flags there are 3 methods available:
- :func:`~nodedge.node.Node.markChildrenInvalid` - to mark only the direct (first level) children of the `Node`
- :func:`~nodedge.node.Node.markDescendantsInvalid` - to mark it self and all descendant children of the `Node`

The same goes for the `Dirty` flag of course:
The same applies to the `Dirty` flag:

- :func:`~nodedge.node.Node.markDirty` - to mark only the `Node`
- :func:`~nodedge.node.Node.markChildrenDirty` - to mark only the direct (first level) children of the `Node`
- :func:`~nodedge.node.Node.markDescendantsDirty` - to mark it self and all descendant children of the `Node`

Descendants or Children are always connected to Output(s) of current `Node`.
Descendants or Children are always connected to the Output(s) of the current `Node`.

When a node is marked `Dirty` or `Invalid` event methods
:func:`~nodedge.node.Node.onMarkedInvalid`
:func:`~nodedge.node.Node.onMarkedDirty` are being called. By default, these methods do nothing.
But still they are implemented in case you would like to override them and use in you own evaluation system.
When a node is marked as `Dirty` or `Invalid` one of the two event methods,
:func:`~nodedge.node.Node.onMarkedInvalid` or
:func:`~nodedge.node.Node.onMarkedDirty`, is called. By default, these methods do nothing.
However, they are implemented for you to override and use them in your own evaluation system.
4 changes: 2 additions & 2 deletions docs/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Examples

The source code for the examples below are available in the `examples/`
subdirectory of the source code distribution.
The can also be accessed online via the
[nodedge GitHub repository](https://github.com/nodedge/nodedge/tree/master/examples).
They can also be accessed online via the
`nodedge GitHub repository <https://github.com/nodedge/nodedge/tree/master/examples>`_.


Python scripts
Expand Down
3 changes: 2 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ Nodedge is a free and open-source software for graphical programming. Try it out
:maxdepth: 2

intro
conventions
.. conventions

apidoc/nodedge
examples
evaluation
Expand Down
20 changes: 12 additions & 8 deletions docs/source/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@ Introduction
************

Welcome to the Nodedge User's Manual. This manual contains information
on using Nodedge software, including documentation for all
development modules in the package and examples illustrating their use.
on how to use the Nodedge software and includes the documentation for all
the modules of the package and examples illustrating their use.

Overview
========
..
Overview
========
Some differences from Simulink
==============================
Some differences from Simulink
==============================

Installation
============

`nodedge` package can be installed using pip or the
The `nodedge` package can be installed using pip or the
standard distutils/setuptools mechanisms.

To install using pip::
Expand All @@ -34,7 +35,10 @@ To install in your default python interpreter, use::
Getting started
===============

There are two different ways to use the package. For the default interface, simply import the control package as follows::
.. There are two different ways to use the package. For the default interface,
To use nodedge simply import the package as follows::

>>> import nodedge


0 comments on commit d740cf8

Please sign in to comment.