symfit

Symbolic Fitting; fitting as it should be.

https://github.com/tbuli/symfit

Science Score: 33.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    36 of 49 committers (73.5%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.8%) to scientific vocabulary

Keywords

curve-fitting least-squares python scipy sympy

Keywords from Contributors

molecular-dynamics protein-structure
Last synced: 6 months ago · JSON representation

Repository

Symbolic Fitting; fitting as it should be.

Basic Info
Statistics
  • Stars: 243
  • Watchers: 9
  • Forks: 19
  • Open Issues: 84
  • Releases: 24
Topics
curve-fitting least-squares python scipy sympy
Created over 11 years ago · Last pushed about 2 years ago
Metadata Files
Readme Contributing License Authors

README.rst

.. image:: https://zenodo.org/badge/24005390.svg
   :target: https://zenodo.org/badge/latestdoi/24005390
.. image:: https://coveralls.io/repos/github/tBuLi/symfit/badge.svg?branch=master
   :target: https://coveralls.io/github/tBuLi/symfit?branch=master


Please cite this DOI if ``symfit`` benefited your publication. Building this has been a lot of work, and as young researchers your citation means a lot to us.
Martin Roelfs & Peter C Kroon, symfit. doi:10.5281/zenodo.1133336

Documentation
=============
http://symfit.readthedocs.org

Project Goals
=============

The goal of this project is simple: to make fitting in Python pythonic.
What does pythonic fitting look like? Well, there's a simple test. If I can
give you pieces of example code and don't have to use any additional words to
explain what it does, it's pythonic.

.. code-block:: python

  from symfit import parameters, variables, Fit, Model
  import numpy as np
   
  xdata = np.array([1.0, 2.0, 3.0, 4.0, 5.0])
  ydata = np.array([2.3, 3.3, 4.1, 5.5, 6.7])
  yerr = np.array([0.1, 0.1, 0.1, 0.1, 0.1])
  
  a, b = parameters('a, b')
  x, y = variables('x, y')
  model = Model({y: a * x + b})
  
  fit = Fit(model, x=xdata, y=ydata, sigma_y=yerr)
  fit_result = fit.execute()

Cool right? So now that we have done a fit, how do we use the results?

.. code-block:: python

  import matplotlib.pyplot as plt
  
  yfit = model(x=xdata, **fit_result.params)[y]
  plt.plot(xdata, yfit)
  plt.show()

.. figure:: http://symfit.readthedocs.org/en/latest/_images/linear_model_fit.png
  :width: 600px
  :alt: Linear Fit

Need I say more? How about I let another code example do the talking?

.. code-block:: python

  from symfit import parameters, Fit, Equality, GreaterThan
  
  x, y = parameters('x, y')
  model = 2 * x * y + 2 * x - x**2 - 2 * y**2
  constraints = [
      Equality(x**3, y),
      GreaterThan(y, 1),
  ]
  
  fit = Fit(- model, constraints=constraints)
  fit_result = fit.execute()

I know what you are thinking. "What if I need to fit to a system of Ordinary Differential Equations?"

.. code-block:: python

  from symfit import variables, Parameter, ODEModel, Fit, D
  import numpy as np
  
  tdata = np.array([10, 26, 44, 70, 120])
  adata = 10e-4 * np.array([44, 34, 27, 20, 14])
          
  a, b, t = variables('a, b, t')
  k = Parameter('k', 0.1)
  
  model_dict = {
      D(a, t): - k * a**2,
      D(b, t): k * a**2,
  }
  
  ode_model = ODEModel(model_dict, initial={t: 0.0, a: 54 * 10e-4, b: 0.0})
  
  fit = Fit(ode_model, t=tdata, a=adata, b=None)
  fit_result = fit.execute()

For more fitting delight, check the docs at http://symfit.readthedocs.org.

Owner

  • Name: Martin Roelfs
  • Login: tBuLi
  • Kind: user

Physicist by day, python enthusiast by night.

GitHub Events

Total
  • Issues event: 1
  • Watch event: 8
  • Issue comment event: 3
  • Pull request event: 1
  • Fork event: 3
Last Year
  • Issues event: 1
  • Watch event: 8
  • Issue comment event: 3
  • Pull request event: 1
  • Fork event: 3

Committers

Last synced: 10 months ago

All Time
  • Total Commits: 905
  • Total Committers: 49
  • Avg Commits per committer: 18.469
  • Development Distribution Score (DDS): 0.674
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Martin Roelfs u****5@k****e 295
Peter P****6 141
Martin Roelfs m****s@r****l 88
tBuLi m****s@t****l 52
Peter p****n 40
Antony t****p@w****e 36
Sam Brockie s****9@c****k 18
Martin Roelfs t****i@r****l 16
Martin Roelfs t****i@r****l 16
Peter Kroon p****n@r****l 15
Martin Roelfs t****i@r****l 15
Martin Roelfs M****s 13
Martin Roelfs t****i@r****l 11
Jochem Smit j****t@g****m 11
Martin Roelfs t****i@r****l 10
Martin Roelfs t****i@r****l 10
= = 9
Martin Roelfs t****i@r****l 9
Martin Roelfs t****i@r****l 8
Martin Roelfs t****i@r****l 8
Martin Roelfs t****i@r****l 8
Martin Roelfs t****i@r****l 7
Martin Roelfs t****i@r****l 6
Martin Roelfs t****i@M****l 6
Martin Roelfs t****i@r****l 6
Martin Roelfs t****i@r****l 6
Martin Roelfs t****i@r****l 6
Martin Roelfs t****i@r****l 4
tbuli t****i@M****l 3
Martin Roelfs t****i@r****l 3
and 19 more...

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 62
  • Total pull requests: 47
  • Average time to close issues: 3 months
  • Average time to close pull requests: 4 months
  • Total issue authors: 29
  • Total pull request authors: 10
  • Average comments per issue: 3.79
  • Average comments per pull request: 4.04
  • Merged pull requests: 28
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 3
  • Average time to close issues: N/A
  • Average time to close pull requests: 3 months
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 1.0
  • Average comments per pull request: 0.67
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • Jhsmit (7)
  • pckroon (6)
  • stephanlachnit (5)
  • lhdp0110 (5)
  • tBuLi (5)
  • JohnGoertz (4)
  • antonykamp (3)
  • nfhktwrbq (3)
  • patquem (2)
  • kvr2007 (2)
  • brocksam (2)
  • tokamage (1)
  • bartrex13 (1)
  • bhclowers (1)
  • MrAnimaniac (1)
Pull Request Authors
  • Jhsmit (18)
  • pckroon (12)
  • tBuLi (4)
  • antonykamp (4)
  • brocksam (2)
  • paulftw (2)
  • stephanlachnit (2)
  • osvalB (1)
  • ford--prefect (1)
  • elgalu (1)
Top Labels
Issue Labels
feature request (3) enhancement (2) easy first issue (1) bug (1)
Pull Request Labels
hacktoberfest-accepted (8) WIP (2)

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 2,205 last-month
  • Total dependent packages: 6
    (may contain duplicates)
  • Total dependent repositories: 12
    (may contain duplicates)
  • Total versions: 35
  • Total maintainers: 1
pypi.org: symfit

Symbolic Fitting; fitting as it should be.

  • Versions: 29
  • Dependent Packages: 4
  • Dependent Repositories: 11
  • Downloads: 2,205 Last month
Rankings
Dependent packages count: 2.4%
Dependent repos count: 4.4%
Stargazers count: 4.6%
Average: 5.2%
Downloads: 5.8%
Forks count: 8.9%
Maintainers (1)
Last synced: 6 months ago
conda-forge.org: symfit
  • Versions: 6
  • Dependent Packages: 2
  • Dependent Repositories: 1
Rankings
Dependent packages count: 19.6%
Dependent repos count: 24.2%
Stargazers count: 25.9%
Average: 27.5%
Forks count: 40.1%
Last synced: 6 months ago

Dependencies

requirements.txt pypi
  • numpy >=1.12
  • scipy >=1.0
  • setuptools *
  • sympy >=1.2
  • toposort *
requirements_docs.txt pypi
  • IPython *
  • ipykernel *
  • nbsphinx *
  • sphinx *
.github/workflows/deploy_pypi.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • pypa/gh-action-pypi-publish master composite
.github/workflows/deploy_pypi_test.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • pypa/gh-action-pypi-publish master composite
.github/workflows/generate_docs.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/test.yaml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/test_and_coveralls.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite