<s> import numpy as np <EOL> from lmfit import Parameters , minimize , report_fit <EOL> def get_data ( ) : <EOL> x = np . arange ( <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT> ) <EOL> y1 = <NUM_LIT> * np . exp ( <NUM_LIT> * x ) + np . random . normal ( scale = <NUM_LIT> , size = len ( x ) ) <EOL> y2 = <NUM_LIT> + x + <NUM_LIT:1> / <NUM_LIT> * x ** <NUM_LIT:2> + <NUM_LIT:1> / <NUM_LIT> * x ** <NUM_LIT:3> <EOL> y2 = y2 + np . random . normal ( scale = <NUM_LIT> , size = len ( x ) ) <EOL> return x , y1 , y2 <EOL> def residual ( params , x , data ) : <EOL> a = params [ '<STR_LIT:a>' ] . value <EOL> b = params [ '<STR_LIT:b>' ] . value <EOL> model = a * np . exp ( b * x ) <EOL> return ( data - model ) <EOL> def test_copy_params ( ) : <EOL> x , y1 , y2 = get_data ( ) <EOL> params = Parameters ( ) <EOL> params . add ( '<STR_LIT:a>' , value = <NUM_LIT> ) <EOL> params . add ( '<STR_LIT:b>' , value = <NUM_LIT> ) <EOL> out1 = minimize ( residual , params , args = ( x , y1 ) ) <EOL> out2 = minimize ( residual , params , args = ( x , y2 ) ) <EOL> adiff = out1 . params [ '<STR_LIT:a>' ] . value - out2 . params [ '<STR_LIT:a>' ] . value <EOL> bdiff = out1 . params [ '<STR_LIT:b>' ] . value - out2 . params [ '<STR_LIT:b>' ] . value <EOL> assert ( abs ( adiff ) > <NUM_LIT> ) <EOL> assert ( abs ( bdiff ) > <NUM_LIT> ) </s>
