{ "info": { "author": "Sertalp B. Cay (SAS Institute)", "author_email": "Sertalp.Cay@sas.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: Mathematics" ], "description": "\n# SAS Optimization Interface for Python\n\n**sasoptpy** is a Python package providing a modeling interface for [SAS Viya](https://www.sas.com/en_us/software/viya.html) and SAS/OR Optimization solvers.\nIt provides a quick way for users to deploy optimization models and solve them using CAS Actions.\n\n**sasoptpy** can handle linear, mixed integer linear and nonlinear optimization problems.\nUsers can benefit from native Python structures like dictionaries, tuples, and list to define an optimization problem.\n**sasoptpy** uses [Pandas](http://pandas.pydata.org/) structures extensively.\n\nUnder the hood, **sasoptpy** uses\n[swat package](https://sassoftware.github.io/python-swat/) to communicate\nSAS Viya, and uses\n[saspy package](https://sassoftware.github.io/saspy/) to communicate SAS 9.4\ninstallations.\n\n**sasoptpy** is an interface to SAS Optimization solvers. Check\n[SAS/OR](http://go.documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.3&docsetId=casmopt&docsetTarget=titlepage.htm&locale=en)\nand \n[PROC OPTMODEL](http://go.documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.3&docsetId=casmopt&docsetTarget=casmopt_optmodel_toc.htm&locale=en)\nfor more details about optimization tools provided by SAS and an interface to\nmodel optimization problems inside SAS.\n\n## Requirements\n\nTo use **sasoptpy**, you need to have:\n* Python 3.5+\n* [numpy](https://pypi.python.org/pypi/numpy)\n* [saspy](https://github.com/sassoftware/saspy) (Optional)\n* [swat](https://github.com/sassoftware/python-swat)\n* [pandas](https://pypi.python.org/pypi/pandas)\n\n### Installation\n\n**sasoptpy** can be installed from [project releases](https://github.com/sassoftware/sasoptpy/releases) page.\nDownload the release and install it using `pip`:\n\n pip install vX.X.X.tar.gz\n\nwhere `vX.X.X` is the release you want to install.\n\nAlternatively, use:\n\n``` shell\n pip install https://github.com/sassoftware/sasoptpy/archive/vX.X.X.tar.gz\n```\n\n## Getting Started\n\n* The source code is currently hosted on GitHub at https://github.com/sassoftware/sasoptpy\n* Online documentation is at https://sassoftware.github.io/sasoptpy/\n* For the latest release go to https://github.com/sassoftware/sasoptpy/releases/latest\n\n### Examples\n\n![sasoptpy demo gif](img/sasoptpy-demo.gif)\n\n```python\nfrom swat import CAS\nimport sasoptpy as so\n\n# Create a CAS Session\ns = CAS(hostname='host', port=12345)\n# Create an empty optimization model\nm = so.Model('demo', session=s)\n# Add variables\nx = m.add_variable(vartype=so.CONT, name='x')\ny = m.add_variable(vartype=so.INT, name='y')\n# Set objective function\nm.set_objective(2*x+y, sense=so.MAX, name='obj')\n# Add constraints\nm.add_constraint(x+2*y <= 4.5, name='c1')\nm.add_constraint(3*x+y <= 5.5, name='c2')\n# Solve the optimization problem\nresult = m.solve()\n# Print and list variable values\nprint(so.get_solution_table(x, y))\nprint('Optimal objective value:', m.get_objective_value())\n```\n\n**Output**\n\n```shell\nNOTE: Initialized model demo.\nNOTE: Added action set 'optimization'.\nNOTE: Converting model demo to OPTMODEL.\nNOTE: Submitting OPTMODEL codes to CAS server.\nNOTE: Problem generation will use 32 threads.\nNOTE: The problem has 2 variables (2 free, 0 fixed).\nNOTE: The problem has 0 binary and 1 integer variables.\nNOTE: The problem has 2 linear constraints (2 LE, 0 EQ, 0 GE, 0 range).\nNOTE: The problem has 4 linear constraint coefficients.\nNOTE: The problem has 0 nonlinear constraints (0 LE, 0 EQ, 0 GE, 0 range).\nNOTE: The OPTMODEL presolver is disabled for linear problems.\nNOTE: The initial MILP heuristics are applied.\nNOTE: The MILP presolver value AUTOMATIC is applied.\nNOTE: The MILP presolver removed 0 variables and 1 constraints.\nNOTE: The MILP presolver removed 2 constraint coefficients.\nNOTE: The MILP presolver modified 0 constraint coefficients.\nNOTE: The presolved problem has 2 variables, 1 constraints, and 2 constraint coefficients.\nNOTE: The MILP solver is called.\nNOTE: The parallel Branch and Cut algorithm is used.\nNOTE: The Branch and Cut algorithm is using up to 32 threads.\n Node Active Sols BestInteger BestBound Gap Time\n 0 1 2 3.3333333 4.2000000 20.63% 0\n 0 1 3 4.0000000 4.0000000 0.00% 0\n 0 0 3 4.0000000 4.0000000 0.00% 0\nNOTE: Optimal.\nNOTE: Objective = 4.\nNOTE: The CAS table 'solutionSummary' in caslib 'CASUSERHDFS(casuser)' has 18 rows and 4 columns.\nNOTE: The CAS table 'problemSummary' in caslib 'CASUSERHDFS(casuser)' has 20 rows and 4 columns.\nNOTE: The CAS table 'primal' in caslib 'CASUSERHDFS(casuser)' has 2 rows and 6 columns.\nNOTE: The CAS table 'dual' in caslib 'CASUSERHDFS(casuser)' has 2 rows and 4 columns.\n x y\n1 \n 1.5 1.0\nOptimal objective value: 4.0\n```\n\n## Resources\n\n- [SAS Viya](http://www.sas.com/en_us/software/viya.html)\n\nCopyright SAS Institute\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/sassoftware/sasoptpy", "keywords": "", "license": "Apache v2.0", "maintainer": "", "maintainer_email": "", "name": "sasoptpy", "package_url": "https://pypi.org/project/sasoptpy/", "platform": "", "project_url": "https://pypi.org/project/sasoptpy/", "project_urls": { "Homepage": "https://github.com/sassoftware/sasoptpy" }, "release_url": "https://pypi.org/project/sasoptpy/0.2.1/", "requires_dist": [ "pandas (>=0.23.3)", "swat (>=1.4.0)", "numpy (>=1.14.5)", "flask (>=1.0.2)", "flask-restful (>=0.3.6)", "itsdangerous (>=0.24)", "gevent (>=1.4.0)" ], "requires_python": "", "summary": "sasoptpy: SAS Optimization Interface for Python", "version": "0.2.1" }, "last_serial": 4870952, "releases": { "0.2.1": [ { "comment_text": "", "digests": { "md5": "ba1660ee68fa450b9c305db45eba278c", "sha256": "f08295f2c73739780ff795164b4d20b463122f6534c8907a6e34075cd414f322" }, "downloads": -1, "filename": "sasoptpy-0.2.1a-py3-none-any.whl", "has_sig": false, "md5_digest": "ba1660ee68fa450b9c305db45eba278c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 64779, "upload_time": "2019-02-26T18:22:59", "url": "https://files.pythonhosted.org/packages/a7/1a/bb35cfbb12b8d77199568c892a1f94418e57e7dc73444b148b27f398cd8a/sasoptpy-0.2.1a-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a8271cdc776340864f2a8f572f51f466", "sha256": "2457e9685f04e5d97ef6acc239db53dc23412a73725b38ea2c6665f97552e68f" }, "downloads": -1, "filename": "sasoptpy-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a8271cdc776340864f2a8f572f51f466", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 64744, "upload_time": "2019-02-26T17:01:07", "url": "https://files.pythonhosted.org/packages/9e/fd/9e3a7ce28cf032793ba6fce4860e3138f4b46e14600df7b9ef8691f7b411/sasoptpy-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "833ddb751851e21782c72137afb9b86f", "sha256": "c121f1cffc7043af7bfbfca785b9ccc5b03a76b7bf1009f627647b7a6abb71f1" }, "downloads": -1, "filename": "sasoptpy-0.2.1.tar.gz", "has_sig": false, "md5_digest": "833ddb751851e21782c72137afb9b86f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 56389, "upload_time": "2019-02-26T17:01:10", "url": "https://files.pythonhosted.org/packages/65/88/89ee1f25bdd0670560b81824fddcc8d65b67b01c7a91b6aa02d781ee7528/sasoptpy-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ba1660ee68fa450b9c305db45eba278c", "sha256": "f08295f2c73739780ff795164b4d20b463122f6534c8907a6e34075cd414f322" }, "downloads": -1, "filename": "sasoptpy-0.2.1a-py3-none-any.whl", "has_sig": false, "md5_digest": "ba1660ee68fa450b9c305db45eba278c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 64779, "upload_time": "2019-02-26T18:22:59", "url": "https://files.pythonhosted.org/packages/a7/1a/bb35cfbb12b8d77199568c892a1f94418e57e7dc73444b148b27f398cd8a/sasoptpy-0.2.1a-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a8271cdc776340864f2a8f572f51f466", "sha256": "2457e9685f04e5d97ef6acc239db53dc23412a73725b38ea2c6665f97552e68f" }, "downloads": -1, "filename": "sasoptpy-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a8271cdc776340864f2a8f572f51f466", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 64744, "upload_time": "2019-02-26T17:01:07", "url": "https://files.pythonhosted.org/packages/9e/fd/9e3a7ce28cf032793ba6fce4860e3138f4b46e14600df7b9ef8691f7b411/sasoptpy-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "833ddb751851e21782c72137afb9b86f", "sha256": "c121f1cffc7043af7bfbfca785b9ccc5b03a76b7bf1009f627647b7a6abb71f1" }, "downloads": -1, "filename": "sasoptpy-0.2.1.tar.gz", "has_sig": false, "md5_digest": "833ddb751851e21782c72137afb9b86f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 56389, "upload_time": "2019-02-26T17:01:10", "url": "https://files.pythonhosted.org/packages/65/88/89ee1f25bdd0670560b81824fddcc8d65b67b01c7a91b6aa02d781ee7528/sasoptpy-0.2.1.tar.gz" } ] }