embodiscope 0.0.1a0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
embodiscope/__init__.py
ADDED
embodiscope/metrics.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"""Aggregate binary episode outcomes without external dependencies."""
|
|
2
|
+
|
|
3
|
+
from collections.abc import Iterable
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@dataclass(frozen=True)
|
|
8
|
+
class SuccessSummary:
|
|
9
|
+
"""Episode counts and success rate; the rate is None for zero episodes."""
|
|
10
|
+
|
|
11
|
+
episodes: int
|
|
12
|
+
successes: int
|
|
13
|
+
|
|
14
|
+
@property
|
|
15
|
+
def failures(self) -> int:
|
|
16
|
+
return self.episodes - self.successes
|
|
17
|
+
|
|
18
|
+
@property
|
|
19
|
+
def success_rate(self) -> float | None:
|
|
20
|
+
return self.successes / self.episodes if self.episodes else None
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def summarize_successes(outcomes: Iterable[bool]) -> SuccessSummary:
|
|
24
|
+
"""Count episodes and successes in one pass.
|
|
25
|
+
|
|
26
|
+
Accepts actual booleans only, so strings such as "false" cannot silently
|
|
27
|
+
count as successful episodes. An empty iterable yields a None success rate.
|
|
28
|
+
"""
|
|
29
|
+
episodes = successes = 0
|
|
30
|
+
for outcome in outcomes:
|
|
31
|
+
if type(outcome) is not bool:
|
|
32
|
+
raise TypeError("Each episode outcome must be a bool (True or False).")
|
|
33
|
+
episodes += 1
|
|
34
|
+
successes += int(outcome)
|
|
35
|
+
return SuccessSummary(episodes=episodes, successes=successes)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: embodiscope
|
|
3
|
+
Version: 0.0.1a0
|
|
4
|
+
Summary: Small utilities for embodied policy evaluation — early development release
|
|
5
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
6
|
+
Classifier: Intended Audience :: Developers
|
|
7
|
+
Classifier: Intended Audience :: Science/Research
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
10
|
+
Requires-Python: >=3.10
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
|
|
13
|
+
# EmbodiScope
|
|
14
|
+
|
|
15
|
+
Small, dependency-free utilities for embodied policy evaluation.
|
|
16
|
+
|
|
17
|
+
## Status
|
|
18
|
+
|
|
19
|
+
This is an early development release with a deliberately small API. The project
|
|
20
|
+
name and API are provisional. This release provides episode success statistics;
|
|
21
|
+
it does not include model inference, benchmark runners, or simulator integrations.
|
|
22
|
+
|
|
23
|
+
## Install
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
pip install --pre embodiscope
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Summarize episode outcomes
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
from embodiscope import summarize_successes
|
|
33
|
+
|
|
34
|
+
summary = summarize_successes([True, False, True, True])
|
|
35
|
+
print(summary.episodes) # 4
|
|
36
|
+
print(summary.successes) # 3
|
|
37
|
+
print(summary.failures) # 1
|
|
38
|
+
print(summary.success_rate) # 0.75
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The function consumes any iterable of booleans in one pass. Non-boolean values
|
|
42
|
+
raise `TypeError`, avoiding accidental truthiness of strings such as `"false"`.
|
|
43
|
+
For zero episodes, `success_rate` is `None`, distinguishing missing observations
|
|
44
|
+
from a measured zero success rate.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
embodiscope/__init__.py,sha256=rVcB4xuuGCpo48SrBisw_NWHbFzjdqquj8Jh8bHc3TM,204
|
|
2
|
+
embodiscope/metrics.py,sha256=-ksL90xseSfzuhLCIfELTYoILIXS0I52ha5VTEAYDZ4,1120
|
|
3
|
+
embodiscope-0.0.1a0.dist-info/METADATA,sha256=qQ2dMMBBTSUYIm35LwlsSVw_-FFYZ0RtBzHyDxcaRi0,1416
|
|
4
|
+
embodiscope-0.0.1a0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
5
|
+
embodiscope-0.0.1a0.dist-info/RECORD,,
|