def test_non_debug_mode_does_not_define_debug_channels(): config = { **CROSS_ADAPTIVE_DEFAULT_CONFIG, "debug": False, } env = CrossAdaptiveEnv(config) debug_channels = list( map(lambda param: f"{param.name}{DEBUG_SUFFIX}", env.effect.parameters)) action = env.action_space.sample() env.step(action) source = env.render() for ch in debug_channels: assert f'chn_k "{ch}"' not in source.csd
def test_debug_mode_renders_channels_to_debug_wave_file(): config = { **CROSS_ADAPTIVE_DEFAULT_CONFIG, "debug": True, } env = CrossAdaptiveEnv(config) debug_channels = list( map(lambda param: f"{param.name}{DEBUG_SUFFIX}", env.effect.parameters)) action = env.action_space.sample() env.step(action) source = env.render() assert "fout" in source.csd for ch in debug_channels: assert f"upsamp(k_{ch})" in source.csd
def test_debug_mode_sets_debug_channels(): config = { **CROSS_ADAPTIVE_DEFAULT_CONFIG, "debug": True, } env = CrossAdaptiveEnv(config) debug_channels = list( map(lambda param: f"{param.name}{DEBUG_SUFFIX}", env.effect.parameters)) action = env.action_space.sample() env.step(action) source = env.render() debug_values = source.player.get_channels(debug_channels) for v in debug_values: assert env.action_space.low[0] < v < env.action_space.high[1]