Spaces:
Sleeping
Sleeping
Create world_step.py
Browse files- world_step.py +16 -0
world_step.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# world_step.py
|
| 2 |
+
|
| 3 |
+
from web_ingest import ingest_all
|
| 4 |
+
from signal_encoder import encode_signal
|
| 5 |
+
from analytics_engine import extract_features
|
| 6 |
+
|
| 7 |
+
def world_update():
|
| 8 |
+
raw = ingest_all()
|
| 9 |
+
encoded = {k: encode_signal(v) for k, v in raw.items()}
|
| 10 |
+
features = {k: extract_features(v) for k, v in encoded.items()}
|
| 11 |
+
|
| 12 |
+
return {
|
| 13 |
+
"raw_sources": raw,
|
| 14 |
+
"encoded_signals": encoded,
|
| 15 |
+
"features": features
|
| 16 |
+
}
|