spirali / haydi Goto Github PK
View Code? Open in Web Editor NEWPython framework for generating discrete structures
License: MIT License
Python framework for generating discrete structures
License: MIT License
A problem still prevails in tests: after py.test -v
... SNIP
test_parallel.py::test_too_many_splits PASSEDTraceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/queues.py", line 268, in _feed
test_parallel.py::test_parallel_take send(obj)
IOError: [Errno 32] Broken pipe
PASSED
... SNIP
Does using xrange
in this peace of code for i in xrange(self.actions_size):
any sense? Why not to use actions directly: for action in self.actions
? Because it stop works when the actions are not numbers.
It could be useful to have a possibility to filter values directly on domains.
states = qit.Range(N)
actions = qit.Range(M)
delta = qit.Mapping(states * actions, states)
final_states = qit.Mapping(states, qit.Range(2)).filter(
lambda mapping: any(map(lambda (k, v): v == 1, mapping.iteritems())))
# now I can use it as follows and dont care about filtering values
fa = states * final_states * delta
fa.iterate() ...
Is there any reason why haydi's basic types like set/map are not iterable?
Having a possibility to use names for product elements.
a = qit.Range(3)
b = qit.Range(10)
c = ("a", a) * ("b", b)
# possible access
c.a
c["a"]
Maybe all of the domains could be named. e.g.
a = qit.Range(3, "a")
b = qit.Range(10, "b")
c = a * b;
# `c` elements can be accessed in the same way.
If the names were propagated everywhere, the functions like is_witness_pair
from the example could look nicer:
def is_witness_pair (conf_depth_pair):
c1 = conf_depth_pair.dpda1.stack_size
c2 = conf_depth_pair.dpda2.stack_size
such code is much readable.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.