@@ -775,7 +775,7 @@ const SUPPORTED_ALGORITHMS_CURVE_FIT: [&str; N_ALGO_CURVE_FIT] = [
775
775
] ;
776
776
777
777
macro_const ! {
778
- const FIT_METHOD_MODEL_DOC : & str = r#"model(t, params)
778
+ const FIT_METHOD_MODEL_DOC : & str = r#"model(t, params, *, cast=False )
779
779
Underlying parametric model function
780
780
781
781
Parameters
@@ -786,6 +786,8 @@ macro_const! {
786
786
Parameters of the model, this array can be longer than actual parameter
787
787
list, the beginning part of the array will be used in this case, see
788
788
Examples section in the class documentation.
789
+ cast : bool, optional
790
+ Cast inputs to np.ndarray of the same dtype
789
791
790
792
Returns
791
793
-------
@@ -1024,14 +1026,16 @@ macro_rules! fit_evaluator {
1024
1026
1025
1027
#[ doc = FIT_METHOD_MODEL_DOC !( ) ]
1026
1028
#[ staticmethod]
1029
+ #[ pyo3( signature = ( t, params, * , cast=false ) ) ]
1027
1030
fn model<' py>(
1028
1031
py: Python <' py>,
1029
1032
t: Bound <' py, PyAny >,
1030
1033
params: Bound <' py, PyAny >,
1034
+ cast: bool
1031
1035
) -> Res <Bound <' py, PyUntypedArray >> {
1032
1036
dtype_dispatch!( {
1033
1037
|t, params| Ok ( Self :: model_impl( t, params) . into_pyarray( py) . as_untyped( ) . clone( ) )
1034
- } ( t, !=params) )
1038
+ } ( t, !=params; cast=cast ) )
1035
1039
}
1036
1040
1037
1041
#[ classattr]
@@ -1715,17 +1719,20 @@ impl Periodogram {
1715
1719
}
1716
1720
1717
1721
/// Angular frequencies and periodogram values
1722
+ #[ pyo3( signature = ( t, m, * , cast=false ) ) ]
1718
1723
fn freq_power < ' py > (
1719
1724
& self ,
1720
1725
py : Python < ' py > ,
1721
1726
t : Bound < PyAny > ,
1722
1727
m : Bound < PyAny > ,
1728
+ cast : bool ,
1723
1729
) -> Res < ( Bound < ' py , PyUntypedArray > , Bound < ' py , PyUntypedArray > ) > {
1724
1730
dtype_dispatch ! (
1725
1731
|t, m| Ok ( Self :: freq_power_impl( & self . eval_f32, py, t, m) ) ,
1726
1732
|t, m| Ok ( Self :: freq_power_impl( & self . eval_f64, py, t, m) ) ,
1727
1733
t,
1728
- =m
1734
+ =m;
1735
+ cast=cast
1729
1736
)
1730
1737
}
1731
1738
@@ -1762,7 +1769,7 @@ transform : None, optional
1762
1769
constructors
1763
1770
1764
1771
{common}
1765
- freq_power(t, m)
1772
+ freq_power(t, m, *, cast=False )
1766
1773
Get periodogram
1767
1774
1768
1775
Parameters
@@ -1771,6 +1778,8 @@ freq_power(t, m)
1771
1778
Time array
1772
1779
m : np.ndarray of np.float32 or np.float64
1773
1780
Magnitude (flux) array
1781
+ cast : bool, optional
1782
+ Cast inputs to np.ndarray objects of the same dtype
1774
1783
1775
1784
Returns
1776
1785
-------
0 commit comments