{"id":23515109,"url":"https://github.com/htjb/maxsmooth","last_synced_at":"2025-10-08T05:18:21.797Z","repository":{"id":46820706,"uuid":"235148030","full_name":"htjb/maxsmooth","owner":"htjb","description":"Constrained Derivative Function Optimisation","archived":false,"fork":false,"pushed_at":"2021-09-23T14:56:50.000Z","size":9446,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-04T14:52:18.710Z","etag":null,"topics":["astrophysics","maths","optimisation","optimisation-algorithms","physics","science"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/htjb.png","metadata":{"files":{"readme":"README.rst","changelog":null,"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":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-01-20T16:38:48.000Z","updated_at":"2025-01-27T15:16:47.000Z","dependencies_parsed_at":"2022-09-12T02:30:47.494Z","dependency_job_id":null,"html_url":"https://github.com/htjb/maxsmooth","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/htjb/maxsmooth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/htjb%2Fmaxsmooth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/htjb%2Fmaxsmooth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/htjb%2Fmaxsmooth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/htjb%2Fmaxsmooth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/htjb","download_url":"https://codeload.github.com/htjb/maxsmooth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/htjb%2Fmaxsmooth/sbom","scorecard":{"id":471119,"data":{"date":"2025-08-11","repo":{"name":"github.com/htjb/maxsmooth","commit":"6187675a26230557f46428edddf060accc4cfe57"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"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":"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":"Code-Review","score":0,"reason":"Found 0/29 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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/CI.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":"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":"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":"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:21: update your workflow using https://app.stepsecurity.io/secureworkflow/htjb/maxsmooth/CI.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/CI.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/htjb/maxsmooth/CI.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/CI.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/htjb/maxsmooth/CI.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/CI.yml:28","Warn: pipCommand not pinned by hash: .github/workflows/CI.yml:29","Warn: pipCommand not pinned by hash: .github/workflows/CI.yml:30","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   3 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: MIT 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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 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"}},{"name":"Vulnerabilities","score":0,"reason":"11 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2021-870 / GHSA-8rh6-h94m-vj54","Warn: Project is vulnerable to: PYSEC-2018-34 / GHSA-2fc2-6r4j-p65h","Warn: Project is vulnerable to: PYSEC-2021-856 / GHSA-5545-2q6w-2gh6","Warn: Project is vulnerable to: PYSEC-2019-108 / GHSA-9fq2-x9r6-wfmf","Warn: Project is vulnerable to: PYSEC-2018-33 / GHSA-cw6w-4rcx-xphc","Warn: Project is vulnerable to: PYSEC-2021-857 / GHSA-f7c7-j99h-c22f","Warn: Project is vulnerable to: GHSA-fpfv-jqm9-f5jm","Warn: Project is vulnerable to: PYSEC-2017-1 / GHSA-frgw-fgh6-9g52","Warn: Project is vulnerable to: PYSEC-2019-156 / GHSA-xp76-357g-9wqq","Warn: Project is vulnerable to: PYSEC-2023-102","Warn: Project is vulnerable to: PYSEC-2023-114"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T13:54:40.464Z","repository_id":46820706,"created_at":"2025-08-19T13:54:40.464Z","updated_at":"2025-08-19T13:54:40.464Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278805495,"owners_count":26049124,"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-07T02:00:06.786Z","response_time":59,"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":["astrophysics","maths","optimisation","optimisation-algorithms","physics","science"],"created_at":"2024-12-25T14:12:55.933Z","updated_at":"2025-10-08T05:18:21.761Z","avatar_url":"https://github.com/htjb.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"==================================================\nmaxsmooth: Derivative Constrained Function Fitting\n==================================================\n\nIntroduction\n------------\n\n:maxsmooth: Derivative Constrained Function Fitting\n:Author: Harry Thomas Jones Bevins\n:Version: 1.2.1\n:Homepage: https://github.com/htjb/maxsmooth\n:Documentation: https://maxsmooth.readthedocs.io/\n\n.. image:: https://github.com/htjb/maxsmooth/workflows/CI/badge.svg?event=push\n   :target: https://github.com/htjb/maxsmooth/actions\n   :alt: github CI\n.. image:: https://codecov.io/gh/htjb/maxsmooth/branch/master/graph/badge.svg\n   :target: https://codecov.io/gh/htjb/maxsmooth\n   :alt: Test Coverage Status\n.. image:: https://readthedocs.org/projects/maxsmooth/badge/?version=latest\n   :target: https://maxsmooth.readthedocs.io/en/latest/?badge=latest\n   :alt: Documentation Status\n.. image:: https://img.shields.io/badge/license-MIT-blue.svg\n   :target: https://github.com/htjb/maxsmooth/blob/master/LICENSE\n   :alt: License information\n.. image:: https://pypip.in/v/maxsmooth/badge.svg\n   :target: https://pypi.org/project/maxsmooth/#description\n   :alt: Latest PyPI version\n.. image:: https://img.shields.io/badge/ascl-2008.018-blue.svg?colorB=262255\n   :target: http://ascl.net/2008.018\n   :alt: Astrophysics Source Code Library\n.. image:: https://joss.theoj.org/papers/7f53a67e2a3e8f021d4324de96fb59c8/status.svg\n   :target: https://joss.theoj.org/papers/7f53a67e2a3e8f021d4324de96fb59c8\n   :alt: JOSS paper\n.. image:: https://mybinder.org/badge_logo.svg\n   :target: https://mybinder.org/v2/gh/htjb/maxsmooth/master?filepath=example_notebooks%2F\n.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.4059339.svg\n   :target: https://doi.org/10.5281/zenodo.4059339\n\nInstallation\n~~~~~~~~~~~~\nIn the following two sections we highlight the purpose of ``maxsmooth`` and\nshow an example. To install the software follow these instructions:\n\nThe software can be pip installed from the PYPI repository like so,\n\n.. code::\n\n pip install maxsmooth\n\nor alternatively it can be installed from the git repository via,\n\n.. code::\n\n git clone https://github.com/htjb/maxsmooth.git\n cd maxsmooth\n python setup.py install --user\n\nDerivative Constrained Functions and ``maxsmooth``\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n``maxsmooth`` is an open source software, written in Python (supporting version 3 upwards),\nfor fitting derivative constrained\nfunctions (DCFs) such as Maximally Smooth Functions\n(MSFs) to data sets. MSFs are functions for which there are no zero\ncrossings in derivatives of order m \u003e= 2 within the domain of interest.\nMore generally for DCFs the minimum\nconstrained derivative order, m can take on any value or a set of\nspecific high order derivatives can be constrained.\nThey are designed to prevent the loss of\nsignals when fitting out dominant smooth foregrounds or large magnitude signals that\nmask signals of interest. Here \"smooth\" means that the foregrounds follow power\nlaw structures in the band of interest.\nIn some cases DCFs can be used to\nhighlight systematics in the data.\n\n``maxsmooth`` uses quadratic programming implemented with ``CVXOPT`` to fit\ndata subject to a fixed linear constraint, Ga \u003c= 0, where the product\nGa is a matrix of derivatives.\nThe constraint on an MSF are not explicitly\nlinear and each constrained derivative can be positive or negative.\n``maxsmooth`` is, however, designed to test the \u003c= 0 constraint multiplied\nby a positive or negative sign. Where a positive sign in front of the m\\ :sup:`th`\norder derivative forces the derivative\nto be negative for all x. For an N\\ :sup:`th` order polynomial ``maxsmooth`` can test\nevery available sign combination but by default it implements a sign navigating algorithm.\nThis is detailed in the ``maxsmooth`` paper (see citation), is summarized\nbelow and in the software documentation.\n\nThe available sign combinations act as discrete parameter spaces all with\nglobal minima and ``maxsmooth`` is capable of finding the minimum of these global\nminima by implementing a cascading algorithm which is followed by a directional\nexploration. The cascading routine typically finds an approximate to the global\nminimum and then the directional exploration is a complete search\nof the sign combinations in the neighbourhood\nof that minimum. The searched region is limited by factors\nthat encapsulate enough of the neighbourhood to confidently return the global minimum.\n\nThe sign navigating method is reliant on the problem being \"well defined\" but this\nis not always the case and it is in these instances it is possible to run the code testing\nevery available sign combination on the constrained derivatives. For a definition of\na \"well defined\" problem and it's counter part see the ``maxsmooth`` paper and the\ndocumentation.\n\n``maxsmooth`` features a built in library of DCFs or\nallows the user to define their own. The addition of possible inflection points\nand zero crossings in higher order derivatives is also available to the user.\nThe software has been designed with these two\napplications in mind and is a simple interface.\n\nExample Fit\n~~~~~~~~~~~\n\nShown below is an example MSF fit performed with ``maxsmooth`` to data that\nfollows a y = x\\ :sup:`-2.5` power law with a randomly generated Gaussian\nnoise with a standard deviation 0.02. The top panel shows the data and the\nbottom panel shows the residual\nafter subtraction of the MSF fit alongside the actual noise in the data.\nThe software using the default built-in DCF model is shown to be\ncapable of recovering the random noise.\n\n.. image:: https://github.com/htjb/maxsmooth/raw/master/docs/images/README.png\n  :width: 400\n  :align: center\n\nFurther examples can be found in the Documentation (https://maxsmooth.readthedocs.io/)\nand in the github repository in the files 'example_codes/' and\n'example_notebooks/' (notebooks can also be accessed online\n`here \u003chttps://mybinder.org/v2/gh/htjb/maxsmooth/master?filepath=example_notebooks%2F\u003e`__).\n\nLicence and Citation\n~~~~~~~~~~~~~~~~~~~~\n\nThe software is free to use on the MIT open source license. However if you use\nthe software for academic purposes we request that you cite the ``maxsmooth``\npapers. They are detailed below.\n\nMNRAS paper (referred to throughout the documentation as the ``maxsmooth``\npaper),\n\n  H. T. J. Bevins et al., `maxsmooth: Rapid maximally smooth function fitting with\n  applications in Global 21-cm cosmology \u003chttps://academic.oup.com/mnras/advance-article/doi/10.1093/mnras/stab152/6105349\u003e`__,\n  Monthly Notices of the Royal Astronomical Society, 2021;, stab152, https://doi.org/10.1093/mnras/stab152\n\nBelow is the BibTex citation,\n\n.. code:: bibtex\n\n  @article{10.1093/mnras/stab152,\n    author = {Bevins, H T J and Handley, W J and Fialkov, A and Acedo, E de Lera and Greenhill, L J and Price, D C},\n    title = \"{maxsmooth: rapid maximally smooth function fitting with applications in Global 21-cm cosmology}\",\n    journal = {Monthly Notices of the Royal Astronomical Society},\n    year = {2021},\n    month = {01},\n    issn = {0035-8711},\n    doi = {10.1093/mnras/stab152},\n    url = {https://doi.org/10.1093/mnras/stab152},\n    note = {stab152},\n    eprint = {https://academic.oup.com/mnras/advance-article-pdf/doi/10.1093/mnras/stab152/35931358/stab152.pdf},\n  }\n\nJOSS paper,\n\n  Bevins, H. T., (2020). maxsmooth: Derivative Constrained Function Fitting. Journal of Open Source Software, 5(54), 2596, https://doi.org/10.21105/joss.02596\n\nand the BibTex,\n\n.. code:: bibtex\n\n  @article{Bevins2020,\n      doi = {10.21105/joss.02596},\n      url = {https://doi.org/10.21105/joss.02596},\n      year = {2020},\n      publisher = {The Open Journal},\n      volume = {5},\n      number = {54},\n      pages = {2596},\n      author = {Harry T. j. Bevins},\n      title = {maxsmooth: Derivative Constrained Function Fitting},\n      journal = {Journal of Open Source Software}\n  }\n\n\nContributing\n~~~~~~~~~~~~\n\nContributions to ``maxsmooth`` are welcome and can be made via:\n\n- Opening an issue to purpose new features/report bugs.\n- Making a pull request. Please consider opening an issue to discuss\n  any proposals beforehand and ensure that your PR will be accepted.\n\nAn example contribution may be the addition of a basis function into the\nstandard library.\n\nDocumentation\n~~~~~~~~~~~~~\nThe documentation is available at: https://maxsmooth.readthedocs.io/\n\nAlternatively, it can be compiled locally from the git repository and requires\n`sphinx \u003chttps://pypi.org/project/Sphinx/\u003e`__ to be installed.\nYou can do this via:\n\n.. code::\n\n  cd docs/\n  make SOURCEDIR=source html\n\nor\n\n.. code::\n\n  cd docs/\n  make SOURCEDIR=source latexpdf\n\nThe resultant docs can be found in the docs/_build/html/ and docs/_build/latex/\nrespectively.\n\nRequirements\n~~~~~~~~~~~~\n\nTo run the code you will need the following additional packages:\n\n- `matplotlib \u003chttps://pypi.org/project/matplotlib/\u003e`__\n- `numpy \u003chttps://pypi.org/project/numpy/\u003e`__\n- `CVXOPT \u003chttps://pypi.org/project/cvxopt/\u003e`__\n- `scipy \u003chttps://pypi.org/project/scipy/\u003e`__\n- `progressbar \u003chttps://pypi.org/project/progressbar/\u003e`__\n\nWhen installing via pip or from source using the setup.py file\nthe above packages will also be installed if absent.\n\nTo compile the documentation locally you will need:\n\n- `sphinx \u003chttps://pypi.org/project/Sphinx/\u003e`__\n- `numpydoc \u003chttps://pypi.org/project/numpydoc/\u003e`__\n\nTo run the test suit you will need:\n\n- `pytest \u003chttps://pypi.org/project/pytest/\u003e`__\n\nBasin-hopping/Nelder-Mead Code\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIn the ``maxsmooth`` MNRAS paper and JOSS paper we provide a comparison of\n``maxsmooth`` to a Basin-hopping/Nelder-Mead approach for fitting DCFs. For\ncompleteness we provide in this repo the code used to make this comparison\nin the file 'Basin-hopping_Nelder_Mead/'.\n\nThe code times_chis.py is used to call ``maxsmooth`` and the Basin-hopping\nmethods (in the file 'BHNM/'). It will plot the recorded times and objective\nfunction evaluations.\n\nThe Basin-hopping/Nelder-Mead code is designed to fit MSFs and is not\ngeneralised to all types of DCF. It is also not documented, however there are\nminor comments in the script and it should be self explanatory. Questions\non this are welcome and can be posted as an issue or by contacting the author.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhtjb%2Fmaxsmooth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhtjb%2Fmaxsmooth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhtjb%2Fmaxsmooth/lists"}