معرفی شرکت ها


cornflow-1.0.5


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

Cornflow is an open source multi-solver optimization server with a REST API built using flask.
ویژگی مقدار
سیستم عامل -
نام فایل cornflow-1.0.5
نام cornflow
نسخه کتابخانه 1.0.5
نگهدارنده []
ایمیل نگهدارنده []
نویسنده baobab soluciones
ایمیل نویسنده cornflow@baobabsoluciones.es
آدرس صفحه اصلی https://github.com/baobabsoluciones/cornflow
آدرس اینترنتی https://pypi.org/project/cornflow/
مجوز -
Cornflow ========= .. image:: https://github.com/baobabsoluciones/cornflow/workflows/build/badge.svg?style=svg :target: https://github.com/baobabsoluciones/cornflow/actions .. image:: https://github.com/baobabsoluciones/cornflow/workflows/docs/badge.svg?style=svg :target: https://github.com/baobabsoluciones/cornflow/actions .. image:: https://github.com/baobabsoluciones/cornflow/workflows/integration/badge.svg?style=svg :target: https://github.com/baobabsoluciones/cornflow/actions .. image:: https://img.shields.io/pypi/v/cornflow-client.svg?style=svg :target: https://pypi.python.org/pypi/cornflow-client .. image:: https://img.shields.io/pypi/pyversions/cornflow-client.svg?style=svg :target: https://pypi.python.org/pypi/cornflow-client .. image:: https://img.shields.io/badge/License-Apache2.0-blue Cornflow is an open source multi-solver optimization server with a REST API built using `flask <https://flask.palletsprojects.com>`_, `airflow <https://airflow.apache.org/>`_ and `pulp <https://coin-or.github.io/pulp/>`_. While most deployment servers are based on the solving technique (MIP, CP, NLP, etc.), Cornflow focuses on the optimization problems themselves. However, it does not impose any constraint on the type of problem and solution method to use. With Cornflow you can deploy a Traveling Salesman Problem solver next to a Knapsack solver or a Nurse Rostering Problem solver. As long as you describe the input and output data, you can upload any solution method for any problem and then use it with any data you want. Cornflow helps you formalize your problem by proposing development guidelines. It also provides a range of functionalities around your deployed solution method, namely: * storage of users, instances, solutions and solution logs. * deployment and maintenance of models, solvers and algorithms. * scheduling of executions in remote machines. * management of said executions: start, monitor, interrupt. * centralizing of commercial licenses. * scenario storage and comparison. * user management, roles and groups. .. contents:: **Table of Contents** Installation instructions ------------------------------- Cornflow is tested with Ubuntu 20.04, python >= 3.5 and git. Download the Cornflow project and install requirements:: git clone git@github.com:baobabsoluciones/cornflow.git cd cornflow-server python3 -m venv venv venv/bin/pip3 install -r requirements-dev.txt activate the virtual environment and run Cornflow:: source venv/bin/activate export FLASK_APP=cornflow.app flask run **Cornflow needs a running installation of Airflow to operate and more configuration**. Check `the installation docs <https://baobabsoluciones.github.io/cornflow/main/install.html>`_ for more details on installing airflow, configuring the application and initializing the database. Using cornflow to solve a PuLP model --------------------------------------- We're going to test the cornflow server by using the `cornflow-client` and the `pulp` python package:: pip install cornflow-client pulp Initialize the api client:: from cornflow_client import CornFlow email = 'some_email@gmail.com' pwd = 'Some_password1' username = 'some_name' client = CornFlow(url="http://127.0.0.1:5000") Create a user:: config = dict(username=username, email=email, pwd=pwd) client.sign_up(**config) Log in:: client.login(username=username, pwd=pwd) Prepare an instance:: import pulp prob = pulp.LpProblem("test_export_dict_MIP", pulp.LpMinimize) x = pulp.LpVariable("x", 0, 4) y = pulp.LpVariable("y", -1, 1) z = pulp.LpVariable("z", 0, None, pulp.LpInteger) prob += x + 4 * y + 9 * z, "obj" prob += x + y <= 5, "c1" prob += x + z >= 10, "c2" prob += -y + z == 7.5, "c3" data = prob.to_dict() insName = 'test_export_dict_MIP' description = 'very small example' Send instance:: instance = client.create_instance(data, name=insName, description=description, schema="solve_model_dag",) Solve an instance:: config = dict( solver = "PULP_CBC_CMD", timeLimit = 10 ) execution = client.create_execution( instance['id'], config, name='execution1', description='execution of a very small instance', schema="solve_model_dag", ) Check the status of an execution:: status = client.get_status(execution["id"]) print(status['state']) # 1 means "finished correctly" Retrieve a solution:: results = client.get_solution(execution['id']) print(results['data']) # returns a json with the solved pulp object _vars, prob = pulp.LpProblem.from_dict(results['data']) Retrieve the log of the solver:: log = client.get_log(execution['id']) print(log['log']) # json format of the solver log Using cornflow to deploy a solution method --------------------------------------------- To deploy a cornflow solution method, the following tasks need to be accomplished: #. Create I/O schemas for the new problem (e.g., “TSP format”). #. Create a solve function (e.g., a 2-opt heuristic). #. Do a PR to a compatible repo linked to a server instance (e.g., like `this one <https://github.com/baobabsoluciones/cornflow>`_). For more details on each part, check the `deployment guide <https://baobabsoluciones.github.io/cornflow/guides/deploy_solver.html>`_. Using cornflow to solve a problem ------------------------------------------- For this example we only need the cornflow_client package. We will test the graph-coloring demo defined `here <https://github.com/baobabsoluciones/cornflow-dags-public/tree/main/DAG/graph_coloring>`_. We will use the test server to solve it. Initialize the api client:: from cornflow_client import CornFlow email = 'readme@gmail.com' pwd = 'some_password' username = 'some_name' client = CornFlow(url="https://devsm.cornflow.baobabsoluciones.app/") client.login(username=username, pwd=pwd) solve a graph coloring problem and get the solution:: data = dict(pairs=[dict(n1=0, n2=1), dict(n1=1, n2=2), dict(n1=1, n2=3)]) instance = client.create_instance(data, name='gc_4_1', description='very small gc problem', schema="graph_coloring") config = dict() execution = client.create_execution( instance['id'], config, name='gc_4_1_exec', description='execution of very small gc problem', schema="graph_coloring", ) status = client.get_status(execution["id"]) print(status['state']) solution = client.get_solution(execution["id"]) print(solution['data']['assignment']) Running tests and coverage ------------------------------ Then you have to run the following commands:: export FLASK_ENV=testing Finally you can run all the tests with the following command:: python -m unittest discover -s cornflow.tests If you want to only run the unit tests (without a local airflow webserver):: python -m unittest discover -s cornflow.tests.unit If you want to only run the integration test with a local airflow webserver:: python -m unittest discover -s cornflow.tests.integration After if you want to check the coverage report you need to run:: coverage run --source=./cornflow/ -m unittest discover -s=./cornflow/tests/ coverage report -m or to get the html reports:: coverage html


نیازمندی

مقدار نام
==1.9.2 alembic
<=6.2.0 apispec
<=8.1.3 click
<=1.0.13 cornflow-client
<=39.0.2 cryptography
>=0.0.86 disposable-email-domains
==2.3.2 Flask
<=0.11.4 flask-apispec
<=1.0.1 Flask-Bcrypt
<=1.13 Flask-Compress
<=3.0.10 flask-cors
<=0.3 flask-inflate
<=4.0.4 Flask-Migrate
<=0.3.9 Flask-RESTful
==2.5.1 Flask-SQLAlchemy
<=22.10.2 gevent
<=2.0.2 greenlet
<=20.1.0 gunicorn
<=1.32 jsonpatch
<=2.9.1 ldap3
<=3.19.0 marshmallow
<=2.7.0 PuLP
<=2.95 psycopg2
<=2.6.0 PyJWT
>=0.86.2 pytups
<=2.29.0 requests
==1.3.21 SQLAlchemy
<=8.2.0 webargs
<=2.3.3 Werkzeug


زبان مورد نیاز

مقدار نام
>=3.8 Python


نحوه نصب


نصب پکیج whl cornflow-1.0.5:

    pip install cornflow-1.0.5.whl


نصب پکیج tar.gz cornflow-1.0.5:

    pip install cornflow-1.0.5.tar.gz