Skip to content

Instantly share code, notes, and snippets.

constraint = LinearConstraint(np.ones(n_suppliers),lb=requiredOrder,ub=1000)
bnds = [(0,None) for i in range(n_suppliers)]
minimizer_kwargs = {"method": "SLSQP",
"bounds":bnds,
"constraints": constraint,
}
res=basinhopping(func,
[200,200,200],
stepsize=500,
@joshua-taylor
joshua-taylor / blender_example.py
Last active January 7, 2023 11:02
How to get started with data viz and Blender
import bpy
#Add a light:
bpy.ops.object.light_add(type='AREA', align='WORLD', location=(2.8, -8, 14),)
data = [1,5,2,6]
barDist = 1.2
#Add a some cubes to create a bar chart from the data:
for row,bar in enumerate(data):