This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

CVExp is short for “controlled vocabulary expressions.” CVExp is a Python module that allows abstract syntax trees (“expressions”) to be constructed just as easily as writing normal Python code. The names of functions in the abstract syntax trees are based on a controlled vocabulary, using URIs as names just like the W3C RDF does.

The intent of CVExp is that it should make it easier for developers to integrate 3rd party libraries into Python without having to specify entirely new APIs. Libraries and languages of particular concern are computer algebra systems, linear programming and optimization (such as lp_solve, GLPK, and CVXOPT), and Prolog.

Here is an example usage to solve a mixed-integer linear programming problem using GLPK as the backend. In order for this to work, you obviously must install prerequisite Python packages (i.e. python-glpk or whatever) because these are not included with CVExp:

from cvexp.builders import var
from cvexp.builders import integer
from cvexp.builders import minimize
from cvexp.translate_glpk import solve

# You could also use lp_solve by doing this:
# from cvexp.translate_lpsolve55 import solve
# ...or you could use CVXOPT like this:
# from cvexp.translate_cvxopt import solve

X = var('X') # the 'X' name is optional
Y = var('Y') # ...and so is 'Y'

# Purely linear programming:
sol = solve((
             Y + 0.1 == X,
             Y >= 9.8 - X,
             minimize(Y),
           ), out_filename='problem.out') # out_filename is optional
print 'X =', sol[X] # >>> 4.95
print 'Y =', sol[Y] # >>> 4.85

# Mixed integer-linear programming:
sol = solve((
             Y + 0.1 == X,
             Y >= 9.8 - X,
             integer(Y),
             minimize(Y),
           ), out_filename='problem.out') # out_filename is optional
print 'X =', sol[X] # >>> 5.1
print 'Y =', sol[Y] # >>> 5

If using CVXOPT, quadratic programming problems can also be solved. For example:

from cvexp.builders import var
from cvexp.builders import integer
from cvexp.builders import minimize
from cvexp.translate_cvxopt import solve

X = var()
Y = var()

sol = solve((
            minimize((X - 5) ** 2 + (Y - 3) ** 2),
           ))
print 'X =', sol[X] # >>> 5.0
print 'Y =', sol[Y] # >>> 3.0
Release History

Release History

0.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting