GithubHelp home page GithubHelp logo

czha168 / lusmu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from akaihola/lusmu

0.0 2.0 0.0 266 KB

Lazy evaluation graph library. See the branch https://github.com/akaihola/lusmu/tree/fix-terminology for a version matching the PyCon Finland 2014 talk and related blog posts.

License: Other

Python 100.00%

lusmu's Introduction

Authors: Antti Kaihola
Organization: Eniram Ltd
Copyright: 2013 Eniram Ltd. See the LICENSE file at the top-level directory of this distribution and at https://github.com/akaihola/lusmu/blob/master/LICENSE

Documentation | Source code | PyPI | Download | License

Lusmu โ€“ a dataflow/reactive programming library for Python

Lusmu is a Python library for reactive programming (a form of dataflow programming). Operations on data are done using a directed graph which consists of input nodes and calculation nodes.

Lusmu uses the invalidate/lazy-revalidate evaluation model: reading the value of a node triggers its calculation action and reads the values of its inputs. Thus, only required calculations are executed.

A minimal example

from lusmu.core import Input, Node, update_inputs

root = Input()
square = Node(action=lambda x: x ** 2,
              inputs=Node.inputs(root))

update_inputs([(root, 5)])
print square.value

The output:

25

See mouse.py and triangle.py for more comples examples.

lusmu's People

Contributors

akaihola avatar miohtama avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.