refactor a_float_mean
[liba.git] / python / liba.pyi
blob37d7754b11b989337770954ddfa314b705a5efcc
1 from typing import TypeVar, Iterable, Sequence, SupportsIndex, overload
3 _T = TypeVar("_T", int, float)
5 class memoryview(Iterable[_T]):  # built in cython
6     def __len__(self) -> int: ...
7     def is_c_contig(self) -> bool: ...
8     def is_f_contig(self) -> bool: ...
9     def copy(self) -> memoryview[_T]: ...
10     def copy_fortran(self) -> memoryview[_T]: ...
11     @overload
12     def __getitem__(self, key: SupportsIndex, /) -> _T: ...
13     @overload
14     def __getitem__(self, key: slice, /) -> array[_T]: ...
15     @overload
16     def __setitem__(self, key: SupportsIndex, value: _T, /) -> None: ...
17     @overload
18     def __setitem__(self, key: slice, value: array[_T], /) -> None: ...
19     def __delitem__(self, key: SupportsIndex | slice, /) -> None: ...
20     @property
21     def T(self) -> memoryview[_T]: ...
22     @property
23     def base(self) -> array[_T]: ...
24     @property
25     def itemsize(self) -> int: ...
26     @property
27     def nbytes(self) -> int: ...
28     @property
29     def ndim(self) -> int: ...
30     @property
31     def shape(self) -> tuple[int]: ...
32     @property
33     def size(self) -> int: ...
34     @property
35     def strides(self) -> tuple[int]: ...
36     @property
37     def suboffsets(self) -> tuple[int]: ...
39 class array(Sequence[_T]):  # built in cython
40     def __len__(self) -> int: ...
41     def is_c_contig(self) -> bool: ...
42     def is_f_contig(self) -> bool: ...
43     def copy(self) -> memoryview[_T]: ...
44     def copy_fortran(self) -> memoryview[_T]: ...
45     @overload
46     def __getitem__(self, key: SupportsIndex, /) -> _T: ...
47     @overload
48     def __getitem__(self, key: slice, /) -> array[_T]: ...
49     @overload
50     def __setitem__(self, key: SupportsIndex, value: _T, /) -> None: ...
51     @overload
52     def __setitem__(self, key: slice, value: array[_T], /) -> None: ...
53     def __delitem__(self, key: SupportsIndex | slice, /) -> None: ...
54     @property
55     def memview(self) -> memoryview[_T]: ...
56     @property
57     def T(self) -> memoryview[_T]: ...
58     @property
59     def base(self) -> array[_T]: ...
60     @property
61     def itemsize(self) -> int: ...
62     @property
63     def nbytes(self) -> int: ...
64     @property
65     def ndim(self) -> int: ...
66     @property
67     def shape(self) -> tuple[int]: ...
68     @property
69     def size(self) -> int: ...
70     @property
71     def strides(self) -> tuple[int]: ...
72     @property
73     def suboffsets(self) -> tuple[int]: ...
75 def isqrt(x: int) -> int: ...
76 @overload
77 def new_u32(x: Iterable[int]) -> array[int]: ...
78 @overload
79 def new_u32(x: int) -> array[int]: ...
80 @overload
81 def new_u64(x: Iterable[int]) -> array[int]: ...
82 @overload
83 def new_u64(x: int) -> array[int]: ...
84 @overload
85 def new_f32(x: Iterable[float]) -> array[float]: ...
86 @overload
87 def new_f32(x: int) -> array[float]: ...
88 @overload
89 def new_f64(x: Iterable[float]) -> array[float]: ...
90 @overload
91 def new_f64(x: int) -> array[float]: ...
92 @overload
93 def new_num(x: Iterable[float]) -> array[float]: ...
94 @overload
95 def new_num(x: int) -> array[float]: ...
96 @overload
97 def sqrt_u32(x: Iterable[int]) -> array[int]: ...
98 @overload
99 def sqrt_u32(x: int) -> int: ...
100 @overload
101 def sqrt_u64(x: Iterable[int]) -> array[int]: ...
102 @overload
103 def sqrt_u64(x: int) -> int: ...
104 @overload
105 def rsqrt_f32(x: Iterable[float]) -> array[float]: ...
106 @overload
107 def rsqrt_f32(x: float) -> float: ...
108 @overload
109 def rsqrt_f64(x: Iterable[float]) -> array[float]: ...
110 @overload
111 def rsqrt_f64(x: float) -> float: ...
112 def hash_bkdr(str: bytes | str, val: int = 0) -> int: ...
113 def hash_sdbm(str: bytes | str, val: int = 0) -> int: ...
115 class crc8:
116     def __init__(self, poly: int, reversed=False) -> None: ...
117     def gen(self, poly: int, reversed=False) -> crc8: ...
118     def __call__(self, block: bytes, value=0) -> int: ...
119     def pack(self, block: bytes, value=0) -> bytes: ...
120     @property
121     def table(self) -> array[int]: ...
123 class crc16:
124     def __init__(self, poly: int, reversed=False) -> None: ...
125     def gen(self, poly: int, reversed=False) -> crc16: ...
126     def __call__(self, block: bytes, value=0) -> int: ...
127     def pack(self, block: bytes, value=0) -> bytes: ...
128     @property
129     def table(self) -> array[int]: ...
131 class crc32:
132     def __init__(self, poly: int, reversed=False) -> None: ...
133     def gen(self, poly: int, reversed=False) -> crc32: ...
134     def __call__(self, block: bytes, value=0) -> int: ...
135     def pack(self, block: bytes, value=0) -> bytes: ...
136     @property
137     def table(self) -> array[int]: ...
139 class crc64:
140     def __init__(self, poly: int, reversed=False) -> None: ...
141     def gen(self, poly: int, reversed=False) -> crc64: ...
142     def __call__(self, block: bytes, value=0) -> int: ...
143     def pack(self, block: bytes, value=0) -> bytes: ...
144     @property
145     def table(self) -> array[int]: ...
147 class hpf:
148     def __init__(self, fc: float, ts: float) -> None: ...
149     def gen(self, fc: float, ts: float) -> hpf: ...
150     def __call__(self, x: float) -> float: ...
151     def zero(self) -> hpf: ...
152     @property
153     def alpha(self) -> float: ...
154     @alpha.setter
155     def alpha(self, x: float) -> None: ...
156     @property
157     def output(self) -> float: ...
158     @property
159     def input(self) -> float: ...
161 class lpf:
162     def __init__(self, fc: float, ts: float) -> None: ...
163     def gen(self, fc: float, ts: float) -> lpf: ...
164     def __call__(self, x: float) -> float: ...
165     def zero(self) -> lpf: ...
166     @property
167     def alpha(self) -> float: ...
168     @alpha.setter
169     def alpha(self, x: float) -> None: ...
170     @property
171     def output(self) -> float: ...
173 class mf:
174     NUL: int
175     GAUSS: int
176     GAUSS2: int
177     GBELL: int
178     SIG: int
179     DSIG: int
180     PSIG: int
181     TRAP: int
182     TRI: int
183     LINS: int
184     LINZ: int
185     S: int
186     Z: int
187     PI: int
188     @overload
189     @staticmethod
190     def mf(e: int | float, x: Iterable[float], a: Iterable[float]) -> array[float]: ...
191     @overload
192     @staticmethod
193     def mf(e: int | float, x: float, a: Iterable[float]) -> float: ...
194     @overload
195     @staticmethod
196     def gauss(x: Iterable[float], sigma: float, c: float) -> array[float]: ...
197     @overload
198     @staticmethod
199     def gauss(x: float, sigma: float, c: float) -> float: ...
200     @overload
201     @staticmethod
202     def gauss2(
203         x: Iterable[float], sigma1: float, c1: float, sigma2: float, c2: float
204     ) -> array[float]: ...
205     @overload
206     @staticmethod
207     def gauss2(x: float, sigma1: float, c1: float, sigma2: float, c2: float) -> float: ...
208     @overload
209     @staticmethod
210     def gbell(x: Iterable[float], a: float, b: float, c: float) -> array[float]: ...
211     @overload
212     @staticmethod
213     def gbell(x: float, a: float, b: float, c: float) -> float: ...
214     @overload
215     @staticmethod
216     def sig(x: Iterable[float], a: float, c: float) -> array[float]: ...
217     @overload
218     @staticmethod
219     def sig(x: float, a: float, c: float) -> float: ...
220     @overload
221     @staticmethod
222     def dsig(x: Iterable[float], a1: float, c1: float, a2: float, c2: float) -> array[float]: ...
223     @overload
224     @staticmethod
225     def dsig(x: float, a1: float, c1: float, a2: float, c2: float) -> float: ...
226     @overload
227     @staticmethod
228     def psig(x: Iterable[float], a1: float, c1: float, a2: float, c2: float) -> array[float]: ...
229     @overload
230     @staticmethod
231     def psig(x: float, a1: float, c1: float, a2: float, c2: float) -> float: ...
232     @overload
233     @staticmethod
234     def trap(x: Iterable[float], a: float, b: float, c: float, d: float) -> array[float]: ...
235     @overload
236     @staticmethod
237     def trap(x: float, a: float, b: float, c: float, d: float) -> float: ...
238     @overload
239     @staticmethod
240     def tri(x: Iterable[float], a: float, b: float, c: float) -> array[float]: ...
241     @overload
242     @staticmethod
243     def tri(x: float, a: float, b: float, c: float) -> float: ...
244     @overload
245     @staticmethod
246     def lins(x: Iterable[float], a: float, b: float) -> array[float]: ...
247     @overload
248     @staticmethod
249     def lins(x: float, a: float, b: float) -> float: ...
250     @overload
251     @staticmethod
252     def linz(x: Iterable[float], a: float, b: float) -> array[float]: ...
253     @overload
254     @staticmethod
255     def linz(x: float, a: float, b: float) -> float: ...
256     @overload
257     @staticmethod
258     def s(x: Iterable[float], a: float, b: float) -> array[float]: ...
259     @overload
260     @staticmethod
261     def s(x: float, a: float, b: float) -> float: ...
262     @overload
263     @staticmethod
264     def z(x: Iterable[float], a: float, b: float) -> array[float]: ...
265     @overload
266     @staticmethod
267     def z(x: float, a: float, b: float) -> float: ...
268     @overload
269     @staticmethod
270     def pi(x: Iterable[float], a: float, b: float, c: float, d: float) -> array[float]: ...
271     @overload
272     @staticmethod
273     def pi(x: float, a: float, b: float, c: float, d: float) -> float: ...
275 class pid:
276     def __init__(self) -> None: ...
277     def set_kpid(self, kp: float, ki: float, kd: float) -> pid: ...
278     def run(self, set: float, fdb: float) -> float: ...
279     def pos(self, set: float, fdb: float) -> float: ...
280     def inc(self, set: float, fdb: float) -> float: ...
281     def zero(self) -> pid: ...
282     @property
283     def kp(self) -> float: ...
284     @kp.setter
285     def kp(self, kp: float) -> None: ...
286     @property
287     def ki(self) -> float: ...
288     @ki.setter
289     def ki(self, ki: float) -> None: ...
290     @property
291     def kd(self) -> float: ...
292     @kd.setter
293     def kd(self, kd: float) -> None: ...
294     @property
295     def summax(self) -> float: ...
296     @summax.setter
297     def summax(self, summax: float) -> None: ...
298     @property
299     def summin(self) -> float: ...
300     @summin.setter
301     def summin(self, summin: float) -> None: ...
302     @property
303     def sum(self) -> float: ...
304     @property
305     def outmax(self) -> float: ...
306     @outmax.setter
307     def outmax(self, outmax: float) -> None: ...
308     @property
309     def outmin(self) -> float: ...
310     @outmin.setter
311     def outmin(self, outmin: float) -> None: ...
312     @property
313     def out(self) -> float: ...
314     @property
315     def fdb(self) -> float: ...
316     @property
317     def err(self) -> float: ...
319 class pid_fuzzy:
320     CAP: int
321     CAP_ALGEBRA: int
322     CAP_BOUNDED: int
323     CUP: int
324     CUP_ALGEBRA: int
325     CUP_BOUNDED: int
326     EQU: int
327     def __init__(self) -> None: ...
328     def set_opr(self, opr: int) -> pid_fuzzy: ...
329     def set_nfuzz(self, num: int) -> pid_fuzzy: ...
330     def set_rule(
331         self,
332         me: Iterable[Iterable[float]],
333         mec: Iterable[Iterable[float]],
334         mkp: Iterable[Iterable[float]],
335         mki: Iterable[Iterable[float]],
336         mkd: Iterable[Iterable[float]],
337     ) -> pid_fuzzy: ...
338     def set_kpid(self, kp: float, ki: float, kd: float) -> pid_fuzzy: ...
339     def run(self, set: float, fdb: float) -> float: ...
340     def pos(self, set: float, fdb: float) -> float: ...
341     def inc(self, set: float, fdb: float) -> float: ...
342     def zero(self) -> pid_fuzzy: ...
343     @property
344     def me(self) -> array[float]: ...
345     @property
346     def mec(self) -> array[float]: ...
347     @property
348     def mkp(self) -> array[float]: ...
349     @property
350     def mki(self) -> array[float]: ...
351     @property
352     def mkd(self) -> array[float]: ...
353     @property
354     def kp(self) -> float: ...
355     @kp.setter
356     def kp(self, kp: float) -> None: ...
357     @property
358     def ki(self) -> float: ...
359     @ki.setter
360     def ki(self, ki: float) -> None: ...
361     @property
362     def kd(self) -> float: ...
363     @kd.setter
364     def kd(self, kd: float) -> None: ...
365     @property
366     def summax(self) -> float: ...
367     @summax.setter
368     def summax(self, summax: float) -> None: ...
369     @property
370     def summin(self) -> float: ...
371     @summin.setter
372     def summin(self, summin: float) -> None: ...
373     @property
374     def sum(self) -> float: ...
375     @property
376     def outmax(self) -> float: ...
377     @outmax.setter
378     def outmax(self, outmax: float) -> None: ...
379     @property
380     def outmin(self) -> float: ...
381     @outmin.setter
382     def outmin(self, outmin: float) -> None: ...
383     @property
384     def out(self) -> float: ...
385     @property
386     def fdb(self) -> float: ...
387     @property
388     def err(self) -> float: ...
389     @property
390     def nrule(self) -> int: ...
391     @property
392     def nfuzz(self) -> int: ...
393     @nfuzz.setter
394     def nfuzz(self, nfuzz: int) -> None: ...
396 class pid_neuro:
397     def __init__(self) -> None: ...
398     def set_kpid(self, k: float, kp: float, ki: float, kd: float) -> pid_neuro: ...
399     def set_wpid(self, wp: float, wi: float, wd: float) -> pid_neuro: ...
400     def run(self, set: float, fdb: float) -> float: ...
401     def inc(self, set: float, fdb: float) -> float: ...
402     def zero(self) -> pid_neuro: ...
403     @property
404     def k(self) -> float: ...
405     @k.setter
406     def k(self, k: float) -> None: ...
407     @property
408     def kp(self) -> float: ...
409     @kp.setter
410     def kp(self, kp: float) -> None: ...
411     @property
412     def ki(self) -> float: ...
413     @ki.setter
414     def ki(self, ki: float) -> None: ...
415     @property
416     def kd(self) -> float: ...
417     @kd.setter
418     def kd(self, kd: float) -> None: ...
419     @property
420     def wp(self) -> float: ...
421     @wp.setter
422     def wp(self, wp: float) -> None: ...
423     @property
424     def wi(self) -> float: ...
425     @wi.setter
426     def wi(self, wi: float) -> None: ...
427     @property
428     def wd(self) -> float: ...
429     @wd.setter
430     def wd(self, wd: float) -> None: ...
431     @property
432     def outmax(self) -> float: ...
433     @outmax.setter
434     def outmax(self, outmax: float) -> None: ...
435     @property
436     def outmin(self) -> float: ...
437     @outmin.setter
438     def outmin(self, outmin: float) -> None: ...
439     @property
440     def out(self) -> float: ...
441     @property
442     def fdb(self) -> float: ...
443     @property
444     def err(self) -> float: ...
445     @property
446     def ec(self) -> float: ...
448 @overload
449 def poly_eval(x: Iterable[float], a: Iterable[float]) -> array[float]: ...
450 @overload
451 def poly_eval(x: float, a: Iterable[float]) -> float: ...
452 @overload
453 def poly_evar(x: Iterable[float], a: Iterable[float]) -> array[float]: ...
454 @overload
455 def poly_evar(x: float, a: Iterable[float]) -> float: ...
457 class tf:
458     def __init__(self, num: Iterable[float], den: Iterable[float]) -> None: ...
459     def __call__(self, x: float) -> float: ...
460     @property
461     def input(self) -> array[float]: ...
462     @property
463     def num(self) -> array[float]: ...
464     @num.setter
465     def num(self, num: Iterable[float]) -> None: ...
466     @property
467     def output(self) -> array[float]: ...
468     @property
469     def den(self) -> array[float]: ...
470     @den.setter
471     def den(self, den: Iterable[float]) -> None: ...
472     def zero(self) -> tf: ...
474 class trajbell:
475     def gen(
476         self,
477         jm: float,
478         am: float,
479         vm: float,
480         p0: float,
481         p1: float,
482         v0: float = 0,
483         v1: float = 0,
484     ) -> float: ...
485     @overload
486     def pos(self, x: Iterable[float]) -> array[float]: ...
487     @overload
488     def pos(self, x: float) -> float: ...
489     @overload
490     def vel(self, x: Iterable[float]) -> array[float]: ...
491     @overload
492     def vel(self, x: float) -> float: ...
493     @overload
494     def acc(self, x: Iterable[float]) -> array[float]: ...
495     @overload
496     def acc(self, x: float) -> float: ...
497     @overload
498     def jer(self, x: Iterable[float]) -> array[float]: ...
499     @overload
500     def jer(self, x: float) -> float: ...
501     @property
502     def t(self) -> float: ...
503     @property
504     def tv(self) -> float: ...
505     @property
506     def ta(self) -> float: ...
507     @property
508     def td(self) -> float: ...
509     @property
510     def taj(self) -> float: ...
511     @property
512     def tdj(self) -> float: ...
513     @property
514     def p0(self) -> float: ...
515     @property
516     def p1(self) -> float: ...
517     @property
518     def v0(self) -> float: ...
519     @property
520     def v1(self) -> float: ...
521     @property
522     def vm(self) -> float: ...
523     @property
524     def jm(self) -> float: ...
525     @property
526     def am(self) -> float: ...
527     @property
528     def dm(self) -> float: ...
530 class trajpoly3:
531     def __init__(
532         self,
533         ts: float,
534         p0: float,
535         p1: float,
536         v0: float = 0,
537         v1: float = 0,
538     ) -> None: ...
539     def gen(
540         self,
541         ts: float,
542         p0: float,
543         p1: float,
544         v0: float = 0,
545         v1: float = 0,
546     ) -> trajpoly3: ...
547     @overload
548     def pos(self, x: Iterable[float]) -> array[float]: ...
549     @overload
550     def pos(self, x: float) -> float: ...
551     @overload
552     def vel(self, x: Iterable[float]) -> array[float]: ...
553     @overload
554     def vel(self, x: float) -> float: ...
555     @overload
556     def acc(self, x: Iterable[float]) -> array[float]: ...
557     @overload
558     def acc(self, x: float) -> float: ...
559     @property
560     def p(self) -> array[float]: ...
561     @property
562     def v(self) -> array[float]: ...
563     @property
564     def a(self) -> array[float]: ...
566 class trajpoly5:
567     def __init__(
568         self,
569         ts: float,
570         p0: float,
571         p1: float,
572         v0: float = 0,
573         v1: float = 0,
574         a0: float = 0,
575         a1: float = 0,
576     ) -> None: ...
577     def gen(
578         self,
579         ts: float,
580         p0: float,
581         p1: float,
582         v0: float = 0,
583         v1: float = 0,
584         a0: float = 0,
585         a1: float = 0,
586     ) -> trajpoly5: ...
587     @overload
588     def pos(self, x: Iterable[float]) -> array[float]: ...
589     @overload
590     def pos(self, x: float) -> float: ...
591     @overload
592     def vel(self, x: Iterable[float]) -> array[float]: ...
593     @overload
594     def vel(self, x: float) -> float: ...
595     @overload
596     def acc(self, x: Iterable[float]) -> array[float]: ...
597     @overload
598     def acc(self, x: float) -> float: ...
599     @property
600     def p(self) -> array[float]: ...
601     @property
602     def v(self) -> array[float]: ...
603     @property
604     def a(self) -> array[float]: ...
606 class trajpoly7:
607     def __init__(
608         self,
609         ts: float,
610         p0: float,
611         p1: float,
612         v0: float = 0,
613         v1: float = 0,
614         a0: float = 0,
615         a1: float = 0,
616         j0: float = 0,
617         j1: float = 0,
618     ) -> None: ...
619     def gen(
620         self,
621         ts: float,
622         p0: float,
623         p1: float,
624         v0: float = 0,
625         v1: float = 0,
626         a0: float = 0,
627         a1: float = 0,
628         j0: float = 0,
629         j1: float = 0,
630     ) -> trajpoly7: ...
631     @overload
632     def pos(self, x: Iterable[float]) -> array[float]: ...
633     @overload
634     def pos(self, x: float) -> float: ...
635     @overload
636     def vel(self, x: Iterable[float]) -> array[float]: ...
637     @overload
638     def vel(self, x: float) -> float: ...
639     @overload
640     def acc(self, x: Iterable[float]) -> array[float]: ...
641     @overload
642     def acc(self, x: float) -> float: ...
643     @overload
644     def jer(self, x: Iterable[float]) -> array[float]: ...
645     @overload
646     def jer(self, x: float) -> float: ...
647     @property
648     def p(self) -> array[float]: ...
649     @property
650     def v(self) -> array[float]: ...
651     @property
652     def a(self) -> array[float]: ...
653     @property
654     def j(self) -> array[float]: ...
656 class trajtrap:
657     def gen(
658         self,
659         vm: float,
660         ac: float,
661         de: float,
662         p0: float,
663         p1: float,
664         v0: float = 0,
665         v1: float = 0,
666     ) -> float: ...
667     @overload
668     def pos(self, x: Iterable[float]) -> array[float]: ...
669     @overload
670     def pos(self, x: float) -> float: ...
671     @overload
672     def vel(self, x: Iterable[float]) -> array[float]: ...
673     @overload
674     def vel(self, x: float) -> float: ...
675     @overload
676     def acc(self, x: Iterable[float]) -> array[float]: ...
677     @overload
678     def acc(self, x: float) -> float: ...
679     @property
680     def t(self) -> float: ...
681     @property
682     def p0(self) -> float: ...
683     @property
684     def p1(self) -> float: ...
685     @property
686     def v0(self) -> float: ...
687     @property
688     def v1(self) -> float: ...
689     @property
690     def vc(self) -> float: ...
691     @property
692     def ta(self) -> float: ...
693     @property
694     def td(self) -> float: ...
695     @property
696     def pa(self) -> float: ...
697     @property
698     def pd(self) -> float: ...
699     @property
700     def ac(self) -> float: ...
701     @property
702     def de(self) -> float: ...
704 class version:
705     @staticmethod
706     def check(major: int = 0, minor: int = 0, patch: int = 0) -> int: ...
707     def __init__(self, major: int = 0, minor: int = 0, third: int = 0, extra: int = 0) -> None: ...
708     def __lt__(self, that: version) -> bool: ...
709     def __gt__(self, that: version) -> bool: ...
710     def __le__(self, that: version) -> bool: ...
711     def __ge__(self, that: version) -> bool: ...
712     def __eq__(self, that: version) -> bool: ...
713     def __ne__(self, that: version) -> bool: ...
714     def parse(self, ver: bytes | str) -> version: ...
715     def cmp(self, that: version) -> int: ...
716     @property
717     def major(self) -> int: ...
718     @major.setter
719     def major(self, major: int) -> None: ...
720     @property
721     def minor(self) -> int: ...
722     @minor.setter
723     def minor(self, minor: int) -> None: ...
724     @property
725     def third(self) -> int: ...
726     @third.setter
727     def third(self, third: int) -> None: ...
728     @property
729     def extra(self) -> int: ...
730     @extra.setter
731     def extra(self, extra: int) -> None: ...
732     @property
733     def alpha(self) -> bytes: ...
734     @alpha.setter
735     def alpha(self, alpha: bytes | str) -> None: ...
736     MAJOR: int
737     MINOR: int
738     PATCH: int
739     TWEAK: int
741 VERSION: str