{"id":37734263,"url":"https://github.com/keurfonluu/stochopy","last_synced_at":"2026-01-16T13:56:16.834Z","repository":{"id":20151848,"uuid":"89025328","full_name":"keurfonluu/stochopy","owner":"keurfonluu","description":"Python library for stochastic numerical optimization","archived":false,"fork":false,"pushed_at":"2023-06-07T05:56:43.000Z","size":2435,"stargazers_count":101,"open_issues_count":1,"forks_count":16,"subscribers_count":5,"default_branch":"master","last_synced_at":"2026-01-11T20:25:55.871Z","etag":null,"topics":["cmaes","differential-evolution","evolutionary-algorithm","mcmc","parallel","pso","stochastic-optimization"],"latest_commit_sha":null,"homepage":"https://github.com/keurfonluu/stochopy","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keurfonluu.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.rst","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-04-21T21:32:49.000Z","updated_at":"2025-12-23T02:51:21.000Z","dependencies_parsed_at":"2025-04-12T02:44:42.992Z","dependency_job_id":"9f852e76-c0cb-4755-82b2-cff9c805a14c","html_url":"https://github.com/keurfonluu/stochopy","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/keurfonluu/stochopy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keurfonluu%2Fstochopy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keurfonluu%2Fstochopy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keurfonluu%2Fstochopy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keurfonluu%2Fstochopy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keurfonluu","download_url":"https://codeload.github.com/keurfonluu/stochopy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keurfonluu%2Fstochopy/sbom","scorecard":{"id":556666,"data":{"date":"2025-08-11","repo":{"name":"github.com/keurfonluu/stochopy","commit":"4a26d91c520ffd3c9ff524b757209ede32b9a793"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/7 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/doc.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/keurfonluu/stochopy/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/keurfonluu/stochopy/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/keurfonluu/stochopy/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/doc.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/keurfonluu/stochopy/doc.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/doc.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/keurfonluu/stochopy/doc.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/doc.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/keurfonluu/stochopy/doc.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:29","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:30","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:31","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:34","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:35","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:40","Warn: pipCommand not pinned by hash: .github/workflows/doc.yml:21","Warn: pipCommand not pinned by hash: .github/workflows/doc.yml:24","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of   8 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2024-48 / GHSA-fj7x-q9j7-g6q6"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 28 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T12:33:21.082Z","repository_id":20151848,"created_at":"2025-08-20T12:33:21.083Z","updated_at":"2025-08-20T12:33:21.083Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479039,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cmaes","differential-evolution","evolutionary-algorithm","mcmc","parallel","pso","stochastic-optimization"],"created_at":"2026-01-16T13:56:16.323Z","updated_at":"2026-01-16T13:56:16.829Z","avatar_url":"https://github.com/keurfonluu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"stochopy\n========\n\n|License| |Stars| |Pyversions| |Version| |Downloads| |Code style: black| |Codacy Badge| |Codecov| |Build| |Docs| |DOI|\n\n**stochopy** provides functions for sampling or optimizing objective functions with or without constraints. Its API is directly inspired by **scipy**'s own optimization submodule which should make the switch from one module to another straightforward.\n\n.. figure:: https://raw.githubusercontent.com/keurfonluu/stochopy/master/.github/sample.gif\n   :alt: sample-pso\n   :width: 100%\n   :align: center\n\n   Optimization of 2D multimodal function Styblinski-Tang using PSO.\n\nFeatures\n--------\n\nSampling algorithms:\n\n-  Hamiltonian (Hybrid) Monte-Carlo (HMC),\n-  Markov-Chain Monte-Carlo (McMC).\n\nStochastic optimizers:\n\n-  Competitive Particle Swarm Optimization (CPSO),\n-  Covariance Matrix Adaptation - Evolution Strategy (CMA-ES),\n-  Differential Evolution (DE),\n-  Neighborhood Algorithm (NA),\n-  Particle Swarm Optimization (PSO),\n-  VD-CMA.\n\nParallel backends:\n\n- `joblib \u003chttps://github.com/joblib/joblib\u003e`__ (``threading`` and ``loky``),\n- `mpi4py \u003chttps://github.com/mpi4py/mpi4py\u003e`__ (``mpi``).\n\nInstallation\n------------\n\nThe recommended way to install **stochopy** and all its dependencies is through the Python Package Index:\n\n.. code::\n\n   pip install stochopy --user\n\nOtherwise, clone and extract the package, then run from the package location:\n\n.. code::\n\n   pip install . --user\n\nTo test the integrity of the installed package, check out this repository and run:\n\n.. code::\n\n   pytest\n\nDocumentation\n-------------\n\nRefer to the online `documentation \u003chttps://keurfonluu.github.io/stochopy/\u003e`__ for detailed description of the API and examples.\n\nAlternatively, the documentation can be built using `Sphinx \u003chttps://www.sphinx-doc.org/en/master/\u003e`__:\n\n.. code:: bash\n\n   pip install -r doc/requirements.txt\n   sphinx-build -b html doc/source doc/build\n\nUsage\n-----\n\nGiven an optimization problem defined by an objective function and a feasible space:\n\n.. code-block:: python\n\n   import numpy as np\n\n   def rosenbrock(x):\n      x = np.asarray(x)\n      sum1 = ((x[1:] - x[:-1] ** 2) ** 2).sum()\n      sum2 = np.square(1.0 - x[:-1]).sum()\n      return 100.0 * sum1 + sum2\n\n   bounds = [[-5.12, 5.12], [-5.12, 5.12]]  # The number of variables to optimize is len(bounds)\n\nThe optimal solution can be found following:\n\n.. code-block:: python\n\n   from stochopy.optimize import minimize\n\n   x = minimize(rosenbrock, bounds, method=\"cmaes\", options={\"maxiter\": 100, \"popsize\": 10, \"seed\": 0})\n\n``minimize`` returns a dictionary that contains the results of the optimization:\n\n.. code-block::\n\n        fun: 3.862267657514075e-09\n    message: 'best solution value is lower than ftol'\n       nfev: 490\n        nit: 49\n     status: 1\n    success: True\n          x: array([0.99997096, 0.99993643])\n\nContributing\n------------\n\nPlease refer to the `Contributing\nGuidelines \u003chttps://github.com/keurfonluu/stochopy/blob/master/CONTRIBUTING.rst\u003e`__ to see how you can help. This project is released with a `Code of Conduct \u003chttps://github.com/keurfonluu/stochopy/blob/master/CODE_OF_CONDUCT.rst\u003e`__ which you agree to abide by when contributing.\n\nRelated projects\n----------------\n\n- `stochopy-viewer \u003chttps://github.com/keurfonluu/stochopy-viewer\u003e`__: Graphical User Interface (GUI) for **stochopy**.\n\n.. |License| image:: https://img.shields.io/github/license/keurfonluu/stochopy\n   :target: https://github.com/keurfonluu/stochopy/blob/master/LICENSE\n\n.. |Stars| image:: https://img.shields.io/github/stars/keurfonluu/stochopy?logo=github\n   :target: https://github.com/keurfonluu/stochopy\n\n.. |Pyversions| image:: https://img.shields.io/pypi/pyversions/stochopy.svg?style=flat\n   :target: https://pypi.org/pypi/stochopy/\n\n.. |Version| image:: https://img.shields.io/pypi/v/stochopy.svg?style=flat\n   :target: https://pypi.org/project/stochopy\n\n.. |Downloads| image:: https://pepy.tech/badge/stochopy\n   :target: https://pepy.tech/project/stochopy\n\n.. |Code style: black| image:: https://img.shields.io/badge/code%20style-black-000000.svg?style=flat\n   :target: https://github.com/psf/black\n\n.. |Codacy Badge| image:: https://img.shields.io/codacy/grade/29b21d65d07e40219dcc9ad1c978cbeb.svg?style=flat\n   :target: https://www.codacy.com/manual/keurfonluu/stochopy/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=keurfonluu/stochopy\u0026amp;utm_campaign=Badge_Grade\n\n.. |Codecov| image:: https://img.shields.io/codecov/c/github/keurfonluu/stochopy.svg?style=flat\n   :target: https://codecov.io/gh/keurfonluu/stochopy\n\n.. |DOI| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.4058008.svg?style=flat\n   :target: https://doi.org/10.5281/zenodo.4058008\n\n.. |Build| image:: https://img.shields.io/github/actions/workflow/status/keurfonluu/stochopy/ci.yml\n   :target: https://github.com/keurfonluu/stochopy\n\n.. |Docs| image:: https://img.shields.io/github/actions/workflow/status/keurfonluu/stochopy/doc.yml?label=docs\n   :target: https://keurfonluu.github.io/stochopy/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeurfonluu%2Fstochopy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeurfonluu%2Fstochopy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeurfonluu%2Fstochopy/lists"}