{"id":15097656,"url":"https://github.com/ulf1/scipy-quadopt","last_synced_at":"2026-02-17T08:31:17.645Z","repository":{"id":45970656,"uuid":"355471428","full_name":"ulf1/scipy-quadopt","owner":"ulf1","description":"Wrapper and utility functions to apply scipy's SLSQP algorithm to quadratic optimization problems with resource constraints and upper boundaries","archived":false,"fork":false,"pushed_at":"2023-07-10T15:41:26.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-01T17:44:28.368Z","etag":null,"topics":["quadratic-programming","resource-constraints","scipy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ulf1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["ulf1"]}},"created_at":"2021-04-07T08:36:28.000Z","updated_at":"2023-07-18T09:14:40.000Z","dependencies_parsed_at":"2024-11-14T15:41:56.753Z","dependency_job_id":"043be7f7-62e2-40a1-adc9-b7ebf8d7ad21","html_url":"https://github.com/ulf1/scipy-quadopt","commit_stats":{"total_commits":23,"total_committers":1,"mean_commits":23.0,"dds":0.0,"last_synced_commit":"f773bd447c103ea9c96bcd77e94f8ee494e6aee2"},"previous_names":["ulf1/scipy-quadopt"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulf1%2Fscipy-quadopt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulf1%2Fscipy-quadopt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulf1%2Fscipy-quadopt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulf1%2Fscipy-quadopt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ulf1","download_url":"https://codeload.github.com/ulf1/scipy-quadopt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245853849,"owners_count":20683260,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["quadratic-programming","resource-constraints","scipy"],"created_at":"2024-09-25T16:24:35.202Z","updated_at":"2025-10-15T09:52:44.398Z","avatar_url":"https://github.com/ulf1.png","language":"Python","funding_links":["https://github.com/sponsors/ulf1"],"categories":[],"sub_categories":[],"readme":"[![PyPI version](https://badge.fury.io/py/scipy-quadopt.svg)](https://badge.fury.io/py/scipy-quadopt)\n[![PyPi downloads](https://img.shields.io/pypi/dm/scipy-quadopt)](https://img.shields.io/pypi/dm/scipy-quadopt)\n[![DOI](https://zenodo.org/badge/355471428.svg)](https://zenodo.org/badge/latestdoi/355471428)\n\n# scipy-quadopt: Quadratic optimization with constraints and upper boundaries\nWrapper and utility functions to apply scipy's SLSQP algorithm to quadratic optimization problems with resource constraints and upper boundaries.\n\n## Usage\n\n```py\nimport numpy as np\nimport scipy_quadopt as sqp\n\n# goodness scores\ngood = np.array([.51, .53, .55, .57])\n\n# similarity matrices\nsimi_1 = np.array([\n    [1, .9, .8, .7],\n    [.9, 1, .6, .5],\n    [.8, .6, 1, .4],\n    [.7, .5, .4, 1],\n])\n\nsimi_2 = np.array([\n    [1, .7, .8, .3],\n    [.7, 1, .4, .2],\n    [.8, .4, 1, .6],\n    [.3, .2, .6, 1],\n])\n\n# preference parameters\nlam = 0.4\nbeta_1 = 0.25\nbeta_2 = 0.75\n\n# compute weights\nsimi = sqp.aggregate_matrices(simi_1, beta_1, simi_2, beta_2)\nweights, _ = sqp.get_weights(good, simi, lam)\n```\n\n## Appendix\n\n### Installation\nThe `scipy-quadopt` [git repo](http://github.com/ulf1/scipy-quadopt) is available as [PyPi package](https://pypi.org/project/scipy-quadopt)\n\n```\npip install scipy-quadopt\npip install git+ssh://git@github.com/ulf1/scipy-quadopt.git\n```\n\n### Install a virtual environment\n\n```\npython3 -m venv .venv\nsource .venv/bin/activate\npip install --upgrade pip\npip install -r requirements.txt --no-cache-dir\npip install -r requirements-dev.txt --no-cache-dir\n```\n\n(If your git repo is stored in a folder with whitespaces, then don't use the subfolder `.venv`. Use an absolute path without whitespaces.)\n\n### Python commands\n\n* Jupyter for the examples: `jupyter lab`\n* Check syntax: `flake8 --ignore=F401 --exclude=$(grep -v '^#' .gitignore | xargs | sed -e 's/ /,/g')`\n* Run Unit Tests: `PYTHONPATH=. pytest`\n\nPublish\n\n```sh\npython setup.py sdist \ntwine upload -r pypi dist/*\n```\n\n### Clean up \n\n```\nfind . -type f -name \"*.pyc\" | xargs rm\nfind . -type d -name \"__pycache__\" | xargs rm -r\nrm -r .pytest_cache\nrm -r .venv\n```\n\n\n### Support\nPlease [open an issue](https://github.com/ulf1/scipy-quadopt/issues/new) for support.\n\n\n### Contributing\nPlease contribute using [Github Flow](https://guides.github.com/introduction/flow/). Create a branch, add commits, and [open a pull request](https://github.com/ulf1/scipy-quadopt/compare/).\n\n\n### Acknowledgements\nThe \"Evidence\" project was funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) - [433249742](https://gepris.dfg.de/gepris/projekt/433249742) (GU 798/27-1; GE 1119/11-1).\n\n### Maintenance\n- till 31.Aug.2023 (v0.1.2) the code repository was maintained within the DFG project [433249742](https://gepris.dfg.de/gepris/projekt/433249742)\n- since 01.Sep.2023 (v0.2.0) the code repository is maintained by Ulf Hamster.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulf1%2Fscipy-quadopt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fulf1%2Fscipy-quadopt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulf1%2Fscipy-quadopt/lists"}