{"id":21032005,"url":"https://github.com/advestis/adadjust","last_synced_at":"2025-12-29T21:09:40.142Z","repository":{"id":42527122,"uuid":"435816858","full_name":"Advestis/adadjust","owner":"Advestis","description":"Package allowing to fit any mathematical function to (for now 1-D only) data.","archived":false,"fork":false,"pushed_at":"2022-07-18T15:04:42.000Z","size":371,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-20T15:32:22.759Z","etag":null,"topics":["data-analysis","fit","python"],"latest_commit_sha":null,"homepage":"https://advestis.github.io/adadjust/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Advestis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-07T09:24:33.000Z","updated_at":"2022-04-01T08:32:07.000Z","dependencies_parsed_at":"2022-09-26T16:20:47.448Z","dependency_job_id":null,"html_url":"https://github.com/Advestis/adadjust","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Advestis%2Fadadjust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Advestis%2Fadadjust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Advestis%2Fadadjust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Advestis%2Fadadjust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Advestis","download_url":"https://codeload.github.com/Advestis/adadjust/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243474106,"owners_count":20296696,"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":["data-analysis","fit","python"],"created_at":"2024-11-19T12:39:46.633Z","updated_at":"2025-12-29T21:09:35.092Z","avatar_url":"https://github.com/Advestis.png","language":"Python","readme":"[![doc](https://img.shields.io/badge/-Documentation-blue)](https://advestis.github.io/adadjust)\n[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\n#### Status\n[![pytests](https://github.com/Advestis/adadjust/actions/workflows/pull-request.yml/badge.svg)](https://github.com/Advestis/adadjust/actions/workflows/pull-request.yml)\n[![push-pypi](https://github.com/Advestis/adadjust/actions/workflows/push-pypi.yml/badge.svg)](https://github.com/Advestis/adadjust/actions/workflows/push-pypi.yml)\n[![push-doc](https://github.com/Advestis/adadjust/actions/workflows/push-doc.yml/badge.svg)](https://github.com/Advestis/adadjust/actions/workflows/push-doc.yml)\n\n![maintained](https://img.shields.io/badge/Maintained%3F-yes-green.svg)\n![issues](https://img.shields.io/github/issues/Advestis/adadjust.svg)\n![pr](https://img.shields.io/github/issues-pr/Advestis/adadjust.svg)\n\n\n#### Compatibilities\n![ubuntu](https://img.shields.io/badge/Ubuntu-supported--tested-success)\n![unix](https://img.shields.io/badge/Other%20Unix-supported--untested-yellow)\n\n![python](https://img.shields.io/pypi/pyversions/adadjust)\n\n\n##### Contact\n[![linkedin](https://img.shields.io/badge/LinkedIn-Advestis-blue)](https://www.linkedin.com/company/advestis/)\n[![website](https://img.shields.io/badge/website-Advestis.com-blue)](https://www.advestis.com/)\n[![mail](https://img.shields.io/badge/mail-maintainers-blue)](mailto:pythondev@advestis.com)\n\n# AdAdjust\n\nPackage allowing to fit any mathematical function to (for now 1-D only) data.\n\n\n## Installation\n\n```bash\npip install adadjust\n```\n\n## Usage\n\n```python\nfrom adadjust import Function\nimport numpy as np\nimport matplotlib.pyplot as plt\nplt.rcParams.update({\"text.usetex\": True})  # Needs texlive installed\n\nnsamples = 1000\na = 0.3\nb = -10\nxstart = 0\nxend = 1\nnoise = 0.01\nx = np.linspace(xstart, xend, nsamples)\ny = a * x ** 2 + b + np.random.normal(0, noise, nsamples)\n\n\ndef linfunc(xx, p):\n    return xx * p[0] + p[1]\n\n\ndef square(xx, p):\n    return xx ** 2 * p[0] + p[1]\n\n\nfunc = Function(linfunc, \"$a \\\\times p[0] + p[1]$\")\nfunc2 = Function(square, \"$a^2 \\\\times p[0] + p[1]$\")\n\nparams = func.fit(x, y, np.array([0, 0]))[0]\nrr = func.compute_rsquared(x, y, params)\n\nparams2 = func2.fit(x, y, np.array([0, 0]))[0]\nrr2 = func2.compute_rsquared(x, y, params2)\n\ntable = Function.make_table(\n    [func, func2], [params, params2], [rr, rr2], caption=\"Linear and Square fit\", path_output=\"table.pdf\"\n)\ntable.compile()\nFunction.plot(x, [func, func2], [params, params2], y=y, rsquared=[rr, rr2])\nplt.gcf().savefig(\"plot.pdf\")\n```\n\n**NOTE** : to have pretty gaphs, put the line `plt.rcParams.update({\"text.usetex\": True})` just after you imported adadjust.\nThis requiers that you have TexLive full installed on your computer.\n\nThe result will be :\n\n![Alt text](tests/data/plot.png)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadvestis%2Fadadjust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadvestis%2Fadadjust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadvestis%2Fadadjust/lists"}