{"id":32175546,"url":"https://github.com/mcuntz/partialwrap","last_synced_at":"2025-10-21T19:41:26.282Z","repository":{"id":57450893,"uuid":"272194643","full_name":"mcuntz/partialwrap","owner":"mcuntz","description":"A small Python library providing wrappers for external executables and Python functions so that they can easily be partialized with Python's functools.partial.","archived":false,"fork":false,"pushed_at":"2024-11-02T22:55:56.000Z","size":3341,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-14T08:50:03.198Z","etag":null,"topics":["executable","external","partial","python"],"latest_commit_sha":null,"homepage":"https://mcuntz.github.io/partialwrap/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mcuntz.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.rst"}},"created_at":"2020-06-14T12:09:35.000Z","updated_at":"2025-06-07T03:30:14.000Z","dependencies_parsed_at":"2022-09-10T04:05:20.689Z","dependency_job_id":"6b740a9d-27c4-42c8-a010-bf32404a4d3f","html_url":"https://github.com/mcuntz/partialwrap","commit_stats":{"total_commits":45,"total_committers":2,"mean_commits":22.5,"dds":"0.022222222222222254","last_synced_commit":"fafdd9a227875e74ebf4b478252b8c3767c089b6"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/mcuntz/partialwrap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcuntz%2Fpartialwrap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcuntz%2Fpartialwrap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcuntz%2Fpartialwrap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcuntz%2Fpartialwrap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mcuntz","download_url":"https://codeload.github.com/mcuntz/partialwrap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcuntz%2Fpartialwrap/sbom","scorecard":{"id":632667,"data":{"date":"2025-08-11","repo":{"name":"github.com/mcuntz/partialwrap","commit":"35c9b29aaaffe0588e1c2bee6cc01d2661a1ded2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'contents' permission set to 'read': .github/workflows/master.yml:84","Warn: no topLevel permission defined: .github/workflows/master.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":"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":"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":"Code-Review","score":0,"reason":"Found 0/30 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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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/master.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/mcuntz/partialwrap/master.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/master.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/mcuntz/partialwrap/master.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/master.yml:49: update your workflow using https://app.stepsecurity.io/secureworkflow/mcuntz/partialwrap/master.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/master.yml:54: update your workflow using https://app.stepsecurity.io/secureworkflow/mcuntz/partialwrap/master.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/master.yml:74: update your workflow using https://app.stepsecurity.io/secureworkflow/mcuntz/partialwrap/master.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/master.yml:88: update your workflow using https://app.stepsecurity.io/secureworkflow/mcuntz/partialwrap/master.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/master.yml:96: update your workflow using https://app.stepsecurity.io/secureworkflow/mcuntz/partialwrap/master.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/master.yml:105: update your workflow using https://app.stepsecurity.io/secureworkflow/mcuntz/partialwrap/master.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/master.yml:36","Warn: pipCommand not pinned by hash: .github/workflows/master.yml:37","Warn: pipCommand not pinned by hash: .github/workflows/master.yml:60","Warn: pipCommand not pinned by hash: .github/workflows/master.yml:61","Warn: pipCommand not pinned by hash: .github/workflows/master.yml:62","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of   5 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":"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":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/master.yml:79"],"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":"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":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}}]},"last_synced_at":"2025-08-21T08:20:37.172Z","repository_id":57450893,"created_at":"2025-08-21T08:20:37.172Z","updated_at":"2025-08-21T08:20:37.172Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280325250,"owners_count":26311415,"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","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["executable","external","partial","python"],"created_at":"2025-10-21T19:41:21.296Z","updated_at":"2025-10-21T19:41:26.277Z","avatar_url":"https://github.com/mcuntz.png","language":"Python","readme":"partialwrap – Wrappers of external executables and Python functions for functools.partial\n=========================================================================================\n\nA a small Python library providing wrappers for external executables\nto be used easily with Python’s functools.partial.\n\n|DOI| |PyPI version| |Conda version| |License| |Build Status| |Coverage Status|\n\n\nAbout partialwrap\n-----------------\n\n**partialwrap** is a Python library providing easy wrapper functions\nto use with Python’s `functools.partial`_. Partial's ingenious\nmechanism allows to use even very complex functions with many\narguments and keyword arguments with routines that need functions in\nthe simple form ``func(x)``. This includes Python's `map` function,\nthe minimizers in `scipy.optimize`_, and plenty of third-party modules\nsuch as `emcee`_ or `pyeee`_. **partialwrap** allows to use any\nexternal executable as well as any Python function with arbitrary\narguments and keywords to be used with `functools.partial`_. It also\nallows to use the executables or functions with easy parallelization\nof code with, for example, the parallel `map` function of the\n`multiprocessing`_ module or via the Message Passing Interface\n(`MPI`_).\n\n\nDocumentation\n-------------\n\nThe complete documentation for **partialwrap** is available at Github\npages:\n\n   https://mcuntz.github.io/partialwrap/\n\n\nQuick usage guide\n-----------------\n\n**partialwrap** provides two wrapper functions to work with external\nexecutables: ``partialwrap.exe_wrapper`` and\n``partialwrap.exe_mask_wrapper``.\n\n**partialwrap** writes the input arguments to the wrapper functions\ninto files that can be read by the external executable. The executable\nshould write its result to a file that will then be read by\n**partialwrap** in return. This means **partialwrap** needs to have a\nfunction ``parameterwriter`` that writes the parameter file\n``parameterfile`` needed by the executable ``exe``.  It then also\nneeds to have a function ``outputreader`` for reading the output file\n``outputfile`` of the external executable, perhaps calculating an\nobjective function value.\n\nTake the `Rastrigin function`_, which is a popular function for\nperformance testing of optimization algorithms:\n``y = a*n + sum_i^n(x_i^2 - a*cos(b*x_i))``. It has a global minimum\nof ``0`` at all ``x_i = 0``. ``a`` influences mainly the depth of the\n(local and global) minima, whereas ``b`` influences mainly the size of\nthe minima. A common form uses ``a = 10`` and ``b = 2*pi``. The\nparameters ``x_i`` should then be in the interval [-5.12, 5.12].\n\nConsider for simplicity an external Python program\n(e.g. ``rastrigin1.py``) that calculates the Rastrigin function with\n``a = 10`` and ``b = 2*pi``, reading in an arbitrary number of\nparameters ``x_i`` from a ``parameterfile = params.txt`` and writing\nits output into ``outputfile = out.txt``:\n\n.. code:: python\n\n   # File: rastrigin1.py\n   import numpy as np\n   from partialwrap import standard_parameter_reader\n\n   # Rastrigin function a=10, b=2*pi\n   def rastrigin1(x):\n       return 10. * len(x) + np.sum(x**2 - 10. * np.cos(2. * np.pi * x))\n\n   # read parameters\n   x = standard_parameter_reader('params.txt')\n\n   # calc function\n   y = rastrigin1(x)\n\n   # write output file\n   with open('out.txt', 'w') as ff:\n       print(y, file=ff)\n\nThis program can be called on the command line (if `params.txt` is\npresent) with:\n\n.. code:: bash\n\n   python rastrigin1.py\n\nThe external program calculating the Rastrigin function could, of\ncourse, also be written in any compiled language such as C or\nFortran. See the `userguide`_ for details. The external program, here\nthe Python version, can be used with Python's `functools.partial`_ and\nthe wrapper function ``partialwrap.exe_wrapper``:\n\n.. code:: python\n\n   import scipy.optimize as opt\n   from functools import partial\n   from partialwrap import exe_wrapper\n   from partialwrap import standard_parameter_writer, standard_output_reader\n\n   rastrigin_exe   = ['python3', 'rastrigin1.py']\n   parameterfile   = 'params.txt'\n   parameterwriter = standard_parameter_writer\n   outputfile      = 'out.txt'\n   outputreader    = standard_output_reader\n   rastrigin_wrap  = partial(exe_wrapper, rastrigin_exe,\n                             parameterfile, parameterwriter,\n                             outputfile, outputreader, {})\n\n   x0  = [0.1, 0.2, 0.3]\n   res = opt.minimize(rastrigin_wrap, x0, method='BFGS')\n\nThe `scipy.optimize`_ function ``minimize()`` passes its sampled\nparameters to ``exe_wrapper``, which writes it to the file\n``parameterfile = 'params.txt'``. It then calls ``rastrigin_exe =\n'python3 rastrigin1.py'`` and reads its ``outputfile = 'out.txt'``.\n``partialwrap.standard_parameter_reader`` and\n``partialwrap.standard_parameter_writer`` are convenience functions\nthat read and write one parameter per line in a file without a\nheader. The empty dictionary at the end is explained in the\n`userguide`_.\n\nMore elaborate input/output of the external program can simply be done\nby replacing ``standard_parameter_reader`` and\n``standard_parameter_writer`` with appropriate functions, while the\nrest stays pretty much the same.\n\n\nInstallation\n------------\n\nThe easiest way to install is via `pip`:\n\n.. code-block:: bash\n\n   pip install partialwrap\n\nor via `conda`:\n\n.. code-block:: bash\n\n   conda install -c conda-forge partialwrap\n\n\nRequirements\n------------\n\n-  `NumPy \u003chttps://www.numpy.org\u003e`__\n\n\nLicense\n-------\n\n**partialwrap** is distributed under the MIT License. See the\n`LICENSE`_ file for details.\n\nCopyright (c) 2016-2023 Matthias Cuntz\n\nThe project structure is based on a `template`_ provided by `Sebastian Müller`_.\n\n\n.. |DOI| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3893705.svg\n   :target: https://doi.org/10.5281/zenodo.3893705\n.. |PyPI version| image:: https://badge.fury.io/py/partialwrap.svg\n   :target: https://badge.fury.io/py/partialwrap\n.. |Conda version| image:: https://anaconda.org/conda-forge/partialwrap/badges/version.svg\n   :target: https://anaconda.org/conda-forge/partialwrap\n.. |License| image:: http://img.shields.io/badge/license-MIT-blue.svg?style=flat\n   :target: https://github.com/mcuntz/partialwrap/blob/master/LICENSE\n.. |Build Status| image:: https://github.com/mcuntz/partialwrap/actions/workflows/master.yml/badge.svg\n   :target: https://github.com/mcuntz/partialwrap/actions/workflows/master.yml\n.. |Coverage Status| image:: https://coveralls.io/repos/github/mcuntz/partialwrap/badge.svg?branch=master\n   :target: https://coveralls.io/github/mcuntz/partialwrap?branch=master\n\n.. _LICENSE: https://github.com/mcuntz/partialwrap/LICENSE\n.. _MPI: https://bitbucket.org/mpi4py/mpi4py\n.. _Rastrigin function: https://en.wikipedia.org/wiki/Rastrigin_function\n.. _Sebastian Müller: https://github.com/MuellerSeb\n.. _emcee: https://github.com/dfm/emcee\n.. _functools: https://docs.python.org/3/library/functools.html\n.. _functools.partial: https://docs.python.org/3/library/functools.html#functools.partial\n.. _multiprocessing: https://docs.python.org/3/library/multiprocessing.html\n.. _partial: https://docs.python.org/3/library/functools.html#functools.partial\n.. _pyeee: https://github.com/mcuntz/pyeee\n.. _scipy.optimize: https://docs.scipy.org/doc/scipy/reference/tutorial/optimize.html\n.. _template: https://github.com/MuellerSeb/template\n.. _userguide: https://mcuntz.github.io/partialwrap/html/userguide.html\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcuntz%2Fpartialwrap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcuntz%2Fpartialwrap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcuntz%2Fpartialwrap/lists"}