Code Monkey home page Code Monkey logo

pabiana's People

Contributors

alexschoeberl avatar

Watchers

 avatar  avatar

Forkers

bigflyingeagle

pabiana's Issues

Switch from modules to classes

Use classes instead of adding functions to an Area instance. Whether the functions have to be added to the instance can be discussed. A simple lookup table might be enough.

class A:
	trig = {}
	trac = []

	def __init__(self):
		self.trig = {}
		for trig in A.trig:
			self.trig[trig] = A.trig[trig].__get__(self, A)

	@staticmethod
	def register(func):
		A.trig[func.__name__] = func
		return func

	@staticmethod
	def note(func):
		A.trac.append(func.__name__)
		return func


class B(A):
	def __init__(self):
		super().__init__()
	
	@A.register
	def method1(self):
		pass

	@A.note
	def method2(self):
		pass

Send trigger as multipart message

At the moment, the trigger name is added to the parameters. Send the trigger name instead as the first part of a multipart message.

Received messages are not passed to functions

If you define an alteration function to listen to messages from an area, the message is not passed on to the function. You can access the message through the area.context variable, but not as a function parameter.

Add subscriptions to context changes

The basic functionality of an area should look like this: If there was a change to any context values, call functions to calculate a new output. Context changes can be performed by other areas or from within the area. Both should result in a similar behavior.

Functions should be able to subscribe to changes in specific context values. These functions get called after every change to a subscribed value.

The basic functionality should closely resemble the behavior of a neural network (e.g. input -> output).

Add testing framework

There should be a framework to easily test a single area or multiple areas locally. It should be possible to manipulate the input of tested areas.

Make use of pathlib

Port the code to make use of Python 3's pathlib throughout the project. This includes files like:

  • setup.py
  • __main__.py

Message from unsubscribed slot results in TypeError

Area1 is subscribed to Area2 without a slot. If Area1 then receives a message from Area2 with a slot a TypeError will be thrown.

File "/pabiana/parsers.py", line 21, in imprint_full
  area.context[source][slot].appendleft(message)
TypeError: sequence index must be integer, not 'str'

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.