key-data / models /tests /inspect_champion.py
tostido's picture
Update tests to target gen42 and remove gen52
4bfd01e
"""Inspect champion model capabilities."""
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
try:
import champion_gen42 as champ
print('=== MODULE ATTRIBUTES ===')
print(f'_QUINE_HASH: {getattr(champ, "_QUINE_HASH", "N/A")}')
print(f'_GENERATION: {getattr(champ, "_GENERATION", "N/A")}')
print(f'_FITNESS: {getattr(champ, "_FITNESS", "N/A")}')
traits = getattr(champ, '_TRAITS', {})
print(f'_TRAITS keys: {list(traits.keys())[:10]}')
print('\n=== MODULE EXPORTS ===')
exports = [x for x in dir(champ) if not x.startswith('_')]
for e in exports:
obj = getattr(champ, e)
print(f' {e}: {type(obj).__name__}')
print('\n=== CAPSULEAGENT CLASS ===')
if hasattr(champ, 'CapsuleAgent'):
CapsuleAgent = champ.CapsuleAgent
methods = [m for m in dir(CapsuleAgent) if not m.startswith('_') and callable(getattr(CapsuleAgent, m, None))]
print(f'Methods: {methods}')
print('\n=== TRYING TO INSTANTIATE ===')
if hasattr(champ, 'CapsuleAgent'):
agent = champ.CapsuleAgent(observe=False, observe_visual=False)
print(f'Agent created: {type(agent).__name__}')
# Check what methods the instance has
instance_methods = [m for m in dir(agent) if not m.startswith('_') and callable(getattr(agent, m, None))]
print(f'Instance methods: {instance_methods}')
# Check specific capabilities
print('\n=== CAPABILITIES ===')
print(f'has forward: {hasattr(agent, "forward")}')
print(f'has imagine: {hasattr(agent, "imagine") or (hasattr(agent, "brain") and hasattr(agent.brain, "imagine"))}')
print(f'has export_pt: {hasattr(agent, "export_pt")}')
print(f'has export_onnx: {hasattr(agent, "export_onnx")}')
print(f'has replicate_quine: {hasattr(agent, "replicate_quine")}')
print(f'has get_quine_brain: {hasattr(agent, "get_quine_brain")}')
print(f'has verify_quine_integrity: {hasattr(agent, "verify_quine_integrity")}')
# Check brain
if hasattr(agent, 'brain'):
print(f'\n=== BRAIN ===')
print(f'Brain type: {type(agent.brain).__name__}')
brain_methods = [m for m in dir(agent.brain) if not m.startswith('_') and callable(getattr(agent.brain, m, None))]
print(f'Brain methods: {brain_methods[:15]}...')
except Exception as e:
import traceback
print(f'Error: {e}')
traceback.print_exc()