1
Fork 0

style: ruff format & check

This commit is contained in:
Tibo De Peuter 2026-04-15 18:48:05 +02:00
parent 07ae66b8ff
commit 6ed4ad8060
Signed by: tdpeuter
SSH key fingerprint: SHA256:u/h/LVoqKF1Iz02uOyxe6hcjmoZASCGV2HM0TG9ZMoU
7 changed files with 16 additions and 19 deletions

View file

@ -3,7 +3,7 @@ from dataclasses import dataclass, field
from experiment_logger.config_logger import LoggingConfig
from brittle_star_project.configs.config_experiment import ExperimentConfig
from brittle_star_project.configs.config_ppo import PPOConfig
from brittle_star_project.configs.config_architecture import ArchitectureConfig, CentralizedConfig
from brittle_star_project.configs.config_architecture import ArchitectureConfig
from brittle_star_project.environment.env_config import MorphologyConfig, ArenaConfig, EnvConfig

View file

@ -5,23 +5,28 @@ a constant size regardless of how many segments are amputated. This wrapper pads
the observation dictionary values with zeros using spatial insertion so that the
flattened observation maintains the correct physical mapping to the neural network.
"""
from __future__ import annotations
from typing import Any
import jax.numpy as jnp
# Observation keys whose size scales with the number of joints (2 per segment).
_JOINT_SCALED_KEYS = frozenset({
"joint_position",
"joint_velocity",
"joint_actuator_force",
"actuator_force",
})
_JOINT_SCALED_KEYS = frozenset(
{
"joint_position",
"joint_velocity",
"joint_actuator_force",
"actuator_force",
}
)
# Observation keys whose size scales with the number of segments (1 per segment).
_SEGMENT_SCALED_KEYS = frozenset({
"segment_contact",
})
_SEGMENT_SCALED_KEYS = frozenset(
{
"segment_contact",
}
)
def compute_padding_masks(

View file

@ -528,10 +528,7 @@ class PPOTrainer:
)
if getattr(self.cfg.experiment, "debug_sanity", False):
self.logger.info(
"\n[SANITY CHECK] Successfully completed 1 epoch of data collection and gradient updates."
)
self.logger.info("[SANITY CHECK] Gradients flowed without NaN. Exiting gracefully.")
self.logger.info("\n[SANITY CHECK] Successfully completed 1 epoch")
break
if self.logging_cfg.save_model:

View file

@ -1,7 +1,6 @@
"""Configuration utilities for loading YAML configs and merging with CLI args."""
import os
import sys
from typing import Dict, Any, Type, TypeVar
import yaml
from dataclasses import fields, is_dataclass

View file

@ -6,9 +6,7 @@ This logger ensures all experimental data is preserved by writing to:
3. stdout (for real-time monitoring)
"""
import datetime
import logging
import subprocess
import yaml
import sys
import time

View file

@ -1,4 +1,3 @@
import pytest
from hydra import compose, initialize
from omegaconf import OmegaConf
from brittle_star_project.configs.main_config import BrittleStarConfig

View file

@ -1,4 +1,3 @@
import jax
import pytest
import os
import mujoco