Code Monkey home page Code Monkey logo

kamaelia_'s Introduction

kamaelia_'s People

Contributors

sparkslabs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

kamaelia_'s Issues

Upgrade repository

The repository seems like a fine piece of work but sadly isn't ready for py3.

So it either needs some fixes or a rewrite. I have done a component registry using distutils ( http://stackoverflow.com/questions/13545289/how-do-i-add-a-setuptools-entry-point-as-an-example-in-my-main-project ) which works quite nicely.

One drawback is: for every component in every package there must be an according entry in the latter's setup.py so distutils can find the module for inspection. You can then query distutils for classes and probably any python object - though i've only tried with classes yet.

Too many packages in one repository

'git ls-tree -r --name-only | wc' results in 4,8k files totalling ~130 MB of diskspace which is a bit much to work on.
Especially since Axon and Kamaelia only amount to 25 MB in around 622 files, which seems way more manageable.

Furthermore, it is quite unhandy to carry around so many different applications (read: packages!) in a single repository. This is imho:

  • bad for the applications, since they cannot be easily used/maintained
  • results in developer frustration

I see some advantages but they are imo negligible, so i would advise to split up somehow. git allows submodules, which i think would be the best method to handle at least core packages. Dunno about the apps, though.

Kamaelia lacks sugar

Currently kamaelia components follow a regular pattern which looks like this:

class PathologicalExample(Axon.Component.component):
    logfile = "test.log"
    ...
    def main(self):
        try:
            while True:
                for message in self.Inbox():
                    self.process(message)
                if self.dataReady("control"):
                    raise GotShutdownMessage()
                if not self.anyReady():
                    self.pause()
                yield 1

        except GotShutdownMessage:
            self.send(self.recv("control"), "signal")
            yield 1
            return

        self.send(Axon.Ipc.producerFinished(), "signal")
        yield 1

In that example, the only part that is specific to the component is self.process. While PureTransformer exists, as an approach it's incomplete, and doesn't support threaded components. Having a better "Sugar" component to allow these sorts of components to be OK, as well as components that look like this:

class SerialSender(Axon.ThreadedComponent.threadedcomponent):
    """ Derived from kamaelia.git/Sketches/MPS/ArduinoRelated/ArdCube.py#SerialIO"""
    serialport = '/dev/ttyUSB0'
    baudrate = 9600
    def main(self):  # FIXME: Shutdown for this component does not play nicely with others
        ser = serial.Serial(self.serialport, self.baudrate)
        while True:
            for msg in self.Inbox("inbox"):
                ser.write(str(msg))
            time.sleep(0.01)

-- ie to enable this sort of component to play nicely - would be very nice/useful. Additionally, this could act as bridging code to the kamaelia rewrite Guild that should be starting at some point.

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.