kopia lustrzana https://github.com/corrscope/corrscope
Rename WaveConfig to _WaveConfig, don't expose via YAML
rodzic
7f0e1ccaba
commit
201b05cc30
|
@ -11,7 +11,7 @@ from ovgenpy import outputs
|
||||||
from ovgenpy.config import register_config, yaml
|
from ovgenpy.config import register_config, yaml
|
||||||
from ovgenpy.renderer import MatplotlibRenderer, RendererConfig
|
from ovgenpy.renderer import MatplotlibRenderer, RendererConfig
|
||||||
from ovgenpy.triggers import ITriggerConfig, CorrelationTriggerConfig
|
from ovgenpy.triggers import ITriggerConfig, CorrelationTriggerConfig
|
||||||
from ovgenpy.wave import WaveConfig, Wave
|
from ovgenpy.wave import _WaveConfig, Wave
|
||||||
|
|
||||||
|
|
||||||
RENDER_PROFILING = True
|
RENDER_PROFILING = True
|
||||||
|
@ -98,7 +98,7 @@ class Ovgen:
|
||||||
|
|
||||||
waves = sorted(wave_dir.glob('*.wav'))
|
waves = sorted(wave_dir.glob('*.wav'))
|
||||||
for idx, path in enumerate(waves):
|
for idx, path in enumerate(waves):
|
||||||
wcfg = WaveConfig(
|
wcfg = _WaveConfig(
|
||||||
amplification=self.cfg.amplification
|
amplification=self.cfg.amplification
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1,27 +1,22 @@
|
||||||
from typing import TYPE_CHECKING, Optional
|
from typing import Optional
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
from dataclasses import dataclass
|
||||||
from scipy.io import wavfile
|
from scipy.io import wavfile
|
||||||
|
|
||||||
from ovgenpy.config import register_config
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
# Internal class, not exposed via YAML (TODO replace with ChannelConfig?)
|
||||||
from ovgenpy.triggers import Trigger
|
@dataclass
|
||||||
|
class _WaveConfig:
|
||||||
|
|
||||||
@register_config
|
|
||||||
class WaveConfig:
|
|
||||||
amplification: float = 1
|
amplification: float = 1
|
||||||
|
|
||||||
def dummy_wave_config() -> WaveConfig:
|
|
||||||
return WaveConfig(amplification=1)
|
|
||||||
|
|
||||||
FLOAT = np.single
|
FLOAT = np.single
|
||||||
|
|
||||||
|
|
||||||
class Wave:
|
class Wave:
|
||||||
def __init__(self, wcfg: Optional[WaveConfig], wave_path: str):
|
def __init__(self, wcfg: Optional[_WaveConfig], wave_path: str):
|
||||||
self.cfg = wcfg or WaveConfig()
|
self.cfg = wcfg or _WaveConfig()
|
||||||
self.smp_s, self.data = wavfile.read(wave_path, mmap=True) # type: int, np.ndarray
|
self.smp_s, self.data = wavfile.read(wave_path, mmap=True) # type: int, np.ndarray
|
||||||
dtype = self.data.dtype
|
dtype = self.data.dtype
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue