Skip to content

Instantly share code, notes, and snippets.

/home/labuzm/src/KivEnt/modules/docs/source/coloredpolygons.rst:11: WARNING: autodoc: failed to import class u'ColorPolyRenderer' from module u'kivent_polygen.polygen_renderers'; the following exception was raised:
Traceback (most recent call last):
File "/home/labuzm/.virtualenvs/kivent/local/lib/python2.7/site-packages/sphinx/ext/autodoc.py", line 385, in import_object
__import__(self.modname)
File "/home/labuzm/.virtualenvs/kivent/local/lib/python2.7/site-packages/kivent_polygen/__init__.py", line 1, in <module>
from kivent_polygen import polygen_formats
File "vertex_formats.pxd", line 18, in init kivent_polygen.polygen_formats (kivent_polygen/polygen_formats.c:878)
File "/home/labuzm/src/KivEnt/modules/core/kivent_core/__init__.py", line 3, in <module>
from . import rendering
File "/home/labuzm/src/KivEnt/modules/core/kivent_core/rendering/__init__.py", line 1, in <module>
@labuzm
labuzm / flip.py
Created January 3, 2016 17:16
flipping tileset
def image_loader(source, colorkey, **kwargs):
tileset = kwargs['tileset']
#...
def extract_image(rect, flags):
x, y, w, h = rect
y = tileset.height - y - h
# ...
return extract_image
from supplychainpy.model_decision import analytical_hierarchy_process
lorry_cost = {'scania': 55000, 'iveco': 79000, 'volvo': 59000, 'navistar': 66000}
criteria = ('style', 'reliability', 'comfort')
criteria_scores = [ (1 / 1, 2 / 1, 7 / 1, 9 / 1), (1 / 2, 1 / 1, 5 / 1, 5 / 1), (1 / 7, 1 / 5, 1 / 1, 5 / 1),(1 / 9, 1 / 5, 1 / 5, 1 / 1)]
options = ('scania', 'iveco', 'navistar', 'volvo' )
option_scores = {
'style': [(1 / 1, 1 / 3, 5 / 1, 1 / 5), (3 / 1, 1 / 1, 2 / 1, 3 / 1), (1 / 3, 1 / 5, 1 / 1, 1 / 5), (5 / 1, 1 / 3, 5 / 1, 1 / 1)],
'reliability': [(1 / 1, 1 / 3, 3 / 1, 1 / 7), (3 / 1, 1 / 1, 5 / 1, 1 / 5), (1 / 3, 1 / 5, 1 / 1, 1 / 5), (7 / 1, 5 / 1, 5 / 1, 1 / 1)],
'comfort': [(1 / 1, 5 / 1, 5 / 1, 1 / 7), (1 / 5, 1 / 1, 2 / 1, 1 / 7), (1 / 3, 1 / 5, 1 / 1, 1 / 5), (7 / 1, 7 / 1, 5 / 1, 1 / 1)],