Source file Odr.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
let () = Wrap_utils.init ();;
let __wrap_namespace = Py.import "scipy.odr"

let get_py name = Py.Module.get __wrap_namespace name
module Data = struct
type tag = [`Data]
type t = [`Data | `Object] Obj.t
let of_pyobject x = ((Obj.of_pyobject x) : t)
let to_pyobject x = Obj.to_pyobject x
let create ?y ?we ?wd ?fix ?meta ~x () =
   Py.Module.get_function_with_keywords __wrap_namespace "Data"
     [||]
     (Wrap_utils.keyword_args [("y", Wrap_utils.Option.map y Np.Obj.to_pyobject); ("we", Wrap_utils.Option.map we Np.Obj.to_pyobject); ("wd", Wrap_utils.Option.map wd Np.Obj.to_pyobject); ("fix", fix); ("meta", meta); ("x", Some(x |> Np.Obj.to_pyobject))])
     |> of_pyobject
let set_meta ?kwds self =
   Py.Module.get_function_with_keywords (to_pyobject self) "set_meta"
     [||]
     (match kwds with None -> [] | Some x -> x)

let to_string self = Py.Object.to_string (to_pyobject self)
let show self = to_string self
let pp formatter self = Format.fprintf formatter "%s" (show self)

end
module Model = struct
type tag = [`Model]
type t = [`Model | `Object] Obj.t
let of_pyobject x = ((Obj.of_pyobject x) : t)
let to_pyobject x = Obj.to_pyobject x
let create ?fjacb ?fjacd ?extra_args ?estimate ?implicit ?meta ~fcn () =
   Py.Module.get_function_with_keywords __wrap_namespace "Model"
     [||]
     (Wrap_utils.keyword_args [("fjacb", fjacb); ("fjacd", fjacd); ("extra_args", extra_args); ("estimate", estimate); ("implicit", Wrap_utils.Option.map implicit Py.Bool.of_bool); ("meta", meta); ("fcn", Some(fcn ))])
     |> of_pyobject
let set_meta ?kwds self =
   Py.Module.get_function_with_keywords (to_pyobject self) "set_meta"
     [||]
     (match kwds with None -> [] | Some x -> x)

let to_string self = Py.Object.to_string (to_pyobject self)
let show self = to_string self
let pp formatter self = Format.fprintf formatter "%s" (show self)

end
module ODR = struct
type tag = [`ODR]
type t = [`ODR | `Object] Obj.t
let of_pyobject x = ((Obj.of_pyobject x) : t)
let to_pyobject x = Obj.to_pyobject x
let create ?beta0 ?delta0 ?ifixb ?ifixx ?job ?iprint ?errfile ?rptfile ?ndigit ?taufac ?sstol ?partol ?maxit ?stpb ?stpd ?sclb ?scld ?work ?iwork ~data ~model () =
   Py.Module.get_function_with_keywords __wrap_namespace "ODR"
     [||]
     (Wrap_utils.keyword_args [("beta0", beta0); ("delta0", delta0); ("ifixb", ifixb); ("ifixx", ifixx); ("job", job); ("iprint", iprint); ("errfile", errfile); ("rptfile", rptfile); ("ndigit", ndigit); ("taufac", taufac); ("sstol", sstol); ("partol", partol); ("maxit", maxit); ("stpb", stpb); ("stpd", stpd); ("sclb", sclb); ("scld", scld); ("work", work); ("iwork", iwork); ("data", Some(data )); ("model", Some(model ))])
     |> of_pyobject
let restart ?iter self =
   Py.Module.get_function_with_keywords (to_pyobject self) "restart"
     [||]
     (Wrap_utils.keyword_args [("iter", Wrap_utils.Option.map iter Py.Int.of_int)])

let run self =
   Py.Module.get_function_with_keywords (to_pyobject self) "run"
     [||]
     []

let set_iprint ?init ?so_init ?iter ?so_iter ?iter_step ?final ?so_final self =
   Py.Module.get_function_with_keywords (to_pyobject self) "set_iprint"
     [||]
     (Wrap_utils.keyword_args [("init", init); ("so_init", so_init); ("iter", iter); ("so_iter", so_iter); ("iter_step", iter_step); ("final", final); ("so_final", so_final)])

                  let set_job ?fit_type ?deriv ?var_calc ?del_init ?restart self =
                     Py.Module.get_function_with_keywords (to_pyobject self) "set_job"
                       [||]
                       (Wrap_utils.keyword_args [("fit_type", Wrap_utils.Option.map fit_type (function
| `One -> Py.Int.of_int 1
| `PyObject x -> Wrap_utils.id x
)); ("deriv", Wrap_utils.Option.map deriv (function
| `One -> Py.Int.of_int 1
| `Two -> Py.Int.of_int 2
| `PyObject x -> Wrap_utils.id x
)); ("var_calc", Wrap_utils.Option.map var_calc (function
| `One -> Py.Int.of_int 1
| `PyObject x -> Wrap_utils.id x
)); ("del_init", del_init); ("restart", restart)])


let data_opt self =
  match Py.Object.get_attr_string (to_pyobject self) "data" with
  | None -> failwith "attribute data not found"
  | Some x -> if Py.is_none x then None else Some (Wrap_utils.id x)

let data self = match data_opt self with
  | None -> raise Not_found
  | Some x -> x

let model_opt self =
  match Py.Object.get_attr_string (to_pyobject self) "model" with
  | None -> failwith "attribute model not found"
  | Some x -> if Py.is_none x then None else Some (Wrap_utils.id x)

let model self = match model_opt self with
  | None -> raise Not_found
  | Some x -> x

let output_opt self =
  match Py.Object.get_attr_string (to_pyobject self) "output" with
  | None -> failwith "attribute output not found"
  | Some x -> if Py.is_none x then None else Some (Wrap_utils.id x)

let output self = match output_opt self with
  | None -> raise Not_found
  | Some x -> x
let to_string self = Py.Object.to_string (to_pyobject self)
let show self = to_string self
let pp formatter self = Format.fprintf formatter "%s" (show self)

end
module OdrError = struct
type tag = [`OdrError]
type t = [`BaseException | `Object | `OdrError] Obj.t
let of_pyobject x = ((Obj.of_pyobject x) : t)
let to_pyobject x = Obj.to_pyobject x
let as_exception x = (x :> [`BaseException] Obj.t)
let with_traceback ~tb self =
   Py.Module.get_function_with_keywords (to_pyobject self) "with_traceback"
     [||]
     (Wrap_utils.keyword_args [("tb", Some(tb ))])

let to_string self = Py.Object.to_string (to_pyobject self)
let show self = to_string self
let pp formatter self = Format.fprintf formatter "%s" (show self)

end
module OdrStop = struct
type tag = [`OdrStop]
type t = [`BaseException | `Object | `OdrStop] Obj.t
let of_pyobject x = ((Obj.of_pyobject x) : t)
let to_pyobject x = Obj.to_pyobject x
let as_exception x = (x :> [`BaseException] Obj.t)
let with_traceback ~tb self =
   Py.Module.get_function_with_keywords (to_pyobject self) "with_traceback"
     [||]
     (Wrap_utils.keyword_args [("tb", Some(tb ))])

let to_string self = Py.Object.to_string (to_pyobject self)
let show self = to_string self
let pp formatter self = Format.fprintf formatter "%s" (show self)

end
module OdrWarning = struct
type tag = [`OdrWarning]
type t = [`BaseException | `Object | `OdrWarning] Obj.t
let of_pyobject x = ((Obj.of_pyobject x) : t)
let to_pyobject x = Obj.to_pyobject x
let as_exception x = (x :> [`BaseException] Obj.t)
let with_traceback ~tb self =
   Py.Module.get_function_with_keywords (to_pyobject self) "with_traceback"
     [||]
     (Wrap_utils.keyword_args [("tb", Some(tb ))])

let to_string self = Py.Object.to_string (to_pyobject self)
let show self = to_string self
let pp formatter self = Format.fprintf formatter "%s" (show self)

end
module Output = struct
type tag = [`Output]
type t = [`Object | `Output] Obj.t
let of_pyobject x = ((Obj.of_pyobject x) : t)
let to_pyobject x = Obj.to_pyobject x
let create output =
   Py.Module.get_function_with_keywords __wrap_namespace "Output"
     [||]
     (Wrap_utils.keyword_args [("output", Some(output ))])
     |> of_pyobject
let pprint self =
   Py.Module.get_function_with_keywords (to_pyobject self) "pprint"
     [||]
     []


let beta_opt self =
  match Py.Object.get_attr_string (to_pyobject self) "beta" with
  | None -> failwith "attribute beta not found"
  | Some x -> if Py.is_none x then None else Some ((fun py -> (Np.Obj.of_pyobject py : [`ArrayLike|`Ndarray|`Object] Np.Obj.t)) x)

let beta self = match beta_opt self with
  | None -> raise Not_found
  | Some x -> x

let sd_beta_opt self =
  match Py.Object.get_attr_string (to_pyobject self) "sd_beta" with
  | None -> failwith "attribute sd_beta not found"
  | Some x -> if Py.is_none x then None else Some ((fun py -> (Np.Obj.of_pyobject py : [`ArrayLike|`Ndarray|`Object] Np.Obj.t)) x)

let sd_beta self = match sd_beta_opt self with
  | None -> raise Not_found
  | Some x -> x

let cov_beta_opt self =
  match Py.Object.get_attr_string (to_pyobject self) "cov_beta" with
  | None -> failwith "attribute cov_beta not found"
  | Some x -> if Py.is_none x then None else Some ((fun py -> (Np.Obj.of_pyobject py : [`ArrayLike|`Ndarray|`Object] Np.Obj.t)) x)

let cov_beta self = match cov_beta_opt self with
  | None -> raise Not_found
  | Some x -> x

let delta_opt self =
  match Py.Object.get_attr_string (to_pyobject self) "delta" with
  | None -> failwith "attribute delta not found"
  | Some x -> if Py.is_none x then None else Some ((fun py -> (Np.Obj.of_pyobject py : [`ArrayLike|`Ndarray|`Object] Np.Obj.t)) x)

let delta self = match delta_opt self with
  | None -> raise Not_found
  | Some x -> x

let eps_opt self =
  match Py.Object.get_attr_string (to_pyobject self) "eps" with
  | None -> failwith "attribute eps not found"
  | Some x -> if Py.is_none x then None else Some ((fun py -> (Np.Obj.of_pyobject py : [`ArrayLike|`Ndarray|`Object] Np.Obj.t)) x)

let eps self = match eps_opt self with
  | None -> raise Not_found
  | Some x -> x

let xplus_opt self =
  match Py.Object.get_attr_string (to_pyobject self) "xplus" with
  | None -> failwith "attribute xplus not found"
  | Some x -> if Py.is_none x then None else Some ((fun py -> (Np.Obj.of_pyobject py : [`ArrayLike|`Ndarray|`Object] Np.Obj.t)) x)

let xplus self = match xplus_opt self with
  | None -> raise Not_found
  | Some x -> x

let y_opt self =
  match Py.Object.get_attr_string (to_pyobject self) "y" with
  | None -> failwith "attribute y not found"
  | Some x -> if Py.is_none x then None else Some ((fun py -> (Np.Obj.of_pyobject py : [`ArrayLike|`Ndarray|`Object] Np.Obj.t)) x)

let y self = match y_opt self with
  | None -> raise Not_found
  | Some x -> x

let res_var_opt self =
  match Py.Object.get_attr_string (to_pyobject self) "res_var" with
  | None -> failwith "attribute res_var not found"
  | Some x -> if Py.is_none x then None else Some (Py.Float.to_float x)

let res_var self = match res_var_opt self with
  | None -> raise Not_found
  | Some x -> x

let sum_square_opt self =
  match Py.Object.get_attr_string (to_pyobject self) "sum_square" with
  | None -> failwith "attribute sum_square not found"
  | Some x -> if Py.is_none x then None else Some (Py.Float.to_float x)

let sum_square self = match sum_square_opt self with
  | None -> raise Not_found
  | Some x -> x

let sum_square_delta_opt self =
  match Py.Object.get_attr_string (to_pyobject self) "sum_square_delta" with
  | None -> failwith "attribute sum_square_delta not found"
  | Some x -> if Py.is_none x then None else Some (Py.Float.to_float x)

let sum_square_delta self = match sum_square_delta_opt self with
  | None -> raise Not_found
  | Some x -> x

let sum_square_eps_opt self =
  match Py.Object.get_attr_string (to_pyobject self) "sum_square_eps" with
  | None -> failwith "attribute sum_square_eps not found"
  | Some x -> if Py.is_none x then None else Some (Py.Float.to_float x)

let sum_square_eps self = match sum_square_eps_opt self with
  | None -> raise Not_found
  | Some x -> x

let inv_condnum_opt self =
  match Py.Object.get_attr_string (to_pyobject self) "inv_condnum" with
  | None -> failwith "attribute inv_condnum not found"
  | Some x -> if Py.is_none x then None else Some (Py.Float.to_float x)

let inv_condnum self = match inv_condnum_opt self with
  | None -> raise Not_found
  | Some x -> x

let rel_error_opt self =
  match Py.Object.get_attr_string (to_pyobject self) "rel_error" with
  | None -> failwith "attribute rel_error not found"
  | Some x -> if Py.is_none x then None else Some (Py.Float.to_float x)

let rel_error self = match rel_error_opt self with
  | None -> raise Not_found
  | Some x -> x

let work_opt self =
  match Py.Object.get_attr_string (to_pyobject self) "work" with
  | None -> failwith "attribute work not found"
  | Some x -> if Py.is_none x then None else Some ((fun py -> (Np.Obj.of_pyobject py : [`ArrayLike|`Ndarray|`Object] Np.Obj.t)) x)

let work self = match work_opt self with
  | None -> raise Not_found
  | Some x -> x

let work_ind_opt self =
  match Py.Object.get_attr_string (to_pyobject self) "work_ind" with
  | None -> failwith "attribute work_ind not found"
  | Some x -> if Py.is_none x then None else Some (Wrap_utils.id x)

let work_ind self = match work_ind_opt self with
  | None -> raise Not_found
  | Some x -> x

let info_opt self =
  match Py.Object.get_attr_string (to_pyobject self) "info" with
  | None -> failwith "attribute info not found"
  | Some x -> if Py.is_none x then None else Some (Py.Int.to_int x)

let info self = match info_opt self with
  | None -> raise Not_found
  | Some x -> x

let stopreason_opt self =
  match Py.Object.get_attr_string (to_pyobject self) "stopreason" with
  | None -> failwith "attribute stopreason not found"
  | Some x -> if Py.is_none x then None else Some ((Py.List.to_list_map Py.String.to_string) x)

let stopreason self = match stopreason_opt self with
  | None -> raise Not_found
  | Some x -> x
let to_string self = Py.Object.to_string (to_pyobject self)
let show self = to_string self
let pp formatter self = Format.fprintf formatter "%s" (show self)

end
module RealData = struct
type tag = [`RealData]
type t = [`Object | `RealData] Obj.t
let of_pyobject x = ((Obj.of_pyobject x) : t)
let to_pyobject x = Obj.to_pyobject x
let create ?y ?sx ?sy ?covx ?covy ?fix ?meta ~x () =
   Py.Module.get_function_with_keywords __wrap_namespace "RealData"
     [||]
     (Wrap_utils.keyword_args [("y", Wrap_utils.Option.map y Np.Obj.to_pyobject); ("sx", Wrap_utils.Option.map sx Np.Obj.to_pyobject); ("sy", Wrap_utils.Option.map sy Np.Obj.to_pyobject); ("covx", Wrap_utils.Option.map covx Np.Obj.to_pyobject); ("covy", Wrap_utils.Option.map covy Np.Obj.to_pyobject); ("fix", Wrap_utils.Option.map fix Np.Obj.to_pyobject); ("meta", meta); ("x", Some(x |> Np.Obj.to_pyobject))])
     |> of_pyobject
let set_meta ?kwds self =
   Py.Module.get_function_with_keywords (to_pyobject self) "set_meta"
     [||]
     (match kwds with None -> [] | Some x -> x)

let to_string self = Py.Object.to_string (to_pyobject self)
let show self = to_string self
let pp formatter self = Format.fprintf formatter "%s" (show self)

end
module Add_newdocs = struct
let () = Wrap_utils.init ();;
let __wrap_namespace = Py.import "scipy.odr.add_newdocs"

let get_py name = Py.Module.get __wrap_namespace name
                  let add_newdoc ?warn_on_python ~place ~obj ~doc () =
                     Py.Module.get_function_with_keywords __wrap_namespace "add_newdoc"
                       [||]
                       (Wrap_utils.keyword_args [("warn_on_python", Wrap_utils.Option.map warn_on_python Py.Bool.of_bool); ("place", Some(place |> Py.String.of_string)); ("obj", Some(obj |> Py.String.of_string)); ("doc", Some(doc |> (function
| `S x -> Py.String.of_string x
| `PyObject x -> Wrap_utils.id x
)))])


end
module Models = struct
let () = Wrap_utils.init ();;
let __wrap_namespace = Py.import "scipy.odr.models"

let get_py name = Py.Module.get __wrap_namespace name
                  let polynomial order =
                     Py.Module.get_function_with_keywords __wrap_namespace "polynomial"
                       [||]
                       (Wrap_utils.keyword_args [("order", Some(order |> (function
| `Sequence x -> Wrap_utils.id x
| `I x -> Py.Int.of_int x
)))])


end
module Odrpack = struct
let () = Wrap_utils.init ();;
let __wrap_namespace = Py.import "scipy.odr.odrpack"

let get_py name = Py.Module.get __wrap_namespace name
let odr ?we ?wd ?fjacb ?fjacd ?extra_args ?ifixx ?ifixb ?job ?iprint ?errfile ?rptfile ?ndigit ?taufac ?sstol ?partol ?maxit ?stpb ?stpd ?sclb ?scld ?work ?iwork ?full_output ~fcn ~beta0 ~y ~x () =
   Py.Module.get_function_with_keywords __wrap_namespace "odr"
     [||]
     (Wrap_utils.keyword_args [("we", we); ("wd", wd); ("fjacb", fjacb); ("fjacd", fjacd); ("extra_args", extra_args); ("ifixx", ifixx); ("ifixb", ifixb); ("job", job); ("iprint", iprint); ("errfile", errfile); ("rptfile", rptfile); ("ndigit", ndigit); ("taufac", taufac); ("sstol", sstol); ("partol", partol); ("maxit", maxit); ("stpb", stpb); ("stpd", stpd); ("sclb", sclb); ("scld", scld); ("work", work); ("iwork", iwork); ("full_output", full_output); ("fcn", Some(fcn )); ("beta0", Some(beta0 )); ("y", Some(y )); ("x", Some(x ))])

let warn ?category ?stacklevel ?source ~message () =
   Py.Module.get_function_with_keywords __wrap_namespace "warn"
     [||]
     (Wrap_utils.keyword_args [("category", category); ("stacklevel", stacklevel); ("source", source); ("message", Some(message ))])


end
let odr ?we ?wd ?fjacb ?fjacd ?extra_args ?ifixx ?ifixb ?job ?iprint ?errfile ?rptfile ?ndigit ?taufac ?sstol ?partol ?maxit ?stpb ?stpd ?sclb ?scld ?work ?iwork ?full_output ~fcn ~beta0 ~y ~x () =
   Py.Module.get_function_with_keywords __wrap_namespace "odr"
     [||]
     (Wrap_utils.keyword_args [("we", we); ("wd", wd); ("fjacb", fjacb); ("fjacd", fjacd); ("extra_args", extra_args); ("ifixx", ifixx); ("ifixb", ifixb); ("job", job); ("iprint", iprint); ("errfile", errfile); ("rptfile", rptfile); ("ndigit", ndigit); ("taufac", taufac); ("sstol", sstol); ("partol", partol); ("maxit", maxit); ("stpb", stpb); ("stpd", stpd); ("sclb", sclb); ("scld", scld); ("work", work); ("iwork", iwork); ("full_output", full_output); ("fcn", Some(fcn )); ("beta0", Some(beta0 )); ("y", Some(y )); ("x", Some(x ))])

                  let polynomial order =
                     Py.Module.get_function_with_keywords __wrap_namespace "polynomial"
                       [||]
                       (Wrap_utils.keyword_args [("order", Some(order |> (function
| `Sequence x -> Wrap_utils.id x
| `I x -> Py.Int.of_int x
)))])