
Security News
Python Adopts Standard Lock File Format for Reproducible Installs
Python has adopted a standardized lock file format to improve reproducibility, security, and tool interoperability across the packaging ecosystem.
Flipy is a Python linear programming interface library, originally developed by FreeWheel. It currently supports Gurobi and CBC as the backend solver.
To use Gurobi, make sure you have a Gurobi license file, and gurobipy is installed in your Python environment. You can find details from Gurobi’s documentation.
Flipy requires Python 3.6 or newer.
The latest offical version of Flipy can be installed with pip
:
pip install flipy
The latest development version can be get with Git:
git clone https://github.com/freewheel/flipy.git
cd flipy
python setup.py install
Here is a simple example for Flipy:
import flipy
# 1 <= x <= 3.5
x = flipy.LpVariable('x', low_bound=1, up_bound=3.5)
# 2 <= y <= 4
y = flipy.LpVariable('y', low_bound=2, up_bound=4)
# 5x + y <= 12
lhs = flipy.LpExpression('lhs', {x: 2.5, y: 1})
rhs = flipy.LpExpression('rhs', constant=12)
constraint = flipy.LpConstraint(lhs, 'leq', rhs)
# maximize: 3x + 2y
objective = flipy.LpObjective('test_obj', {x: 3, y: 2}, sense=flipy.Maximize)
problem = flipy.LpProblem('test', objective, [constraint])
solver = flipy.CBCSolver()
status = solver.solve(problem)
After solving, a status is returned to indicate whether the solver has found a optimal solution for the problem:
print(status)
# <SolutionStatus.Optimal: 1>
The objective value can be retrieved with objective.evaluate()
:
print(objective.evaluate())
# 17.6
The value of variables can be retrieved with .evaluate()
as well:
print(x.evaluate())
# 3.2
print(y.evaluate())
# 4.0
FAQs
FreeWheel Linear Programming Interface for Python
We found that flipy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Python has adopted a standardized lock file format to improve reproducibility, security, and tool interoperability across the packaging ecosystem.
Security News
OpenGrep has restored fingerprint and metavariable support in JSON and SARIF outputs, making static analysis more effective for CI/CD security automation.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.