Skip to main content

Make slider from lmfit model function and params

Project description

lmfit-slider

Requirements

  • matplotlib
  • numpy

Installation

pip install lmfit-slider

Usage

import lmfit
import numpy as np

from lmfit_slider import slider


def fcn(params, x, A):
    return A*np.sin(params['k']*x)


params = lmfit.Parameters()
params.add('k', value=1, min=-10, max=10)

data_x = np.linspace(0, 2*np.pi, 6)
data = 1.5*np.sin(4*data_x)

model_x = np.linspace(min(data_x), max(data_x), 5000)

new_params = slider(
    fcn,
    params,
    data_x=data_x,
    data=data,
    args=(model_x, 1.5),
)

new_params.pretty_print()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lmfit-slider-0.0.1.tar.gz (3.9 kB view details)

Uploaded Source

File details

Details for the file lmfit-slider-0.0.1.tar.gz.

File metadata

  • Download URL: lmfit-slider-0.0.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for lmfit-slider-0.0.1.tar.gz
Algorithm Hash digest
SHA256 116b3aa46f77a55f2c41c206cd4908c490162c8eb527fd73a2acf3a0fbda7167
MD5 d175c13a3727cff9cd1cde1d511332d9
BLAKE2b-256 f04fe4a24b8936ed97a32c32a442bb8852e580ab515de86027b0b2fe5f1be44d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page