Compare commits
No commits in common. "9e8dc06c26084a4e246cd19dc42a792c3d7fba74" and "13d4db25fa2ee3cb58af71debea2c38eaa91f533" have entirely different histories.
9e8dc06c26
...
13d4db25fa
@ -116,7 +116,7 @@ class PyRelacs(QMainWindow):
|
|||||||
beat_squared = beat**2
|
beat_squared = beat**2
|
||||||
|
|
||||||
f, powerspec = welch(beat, fs=40_000.0)
|
f, powerspec = welch(beat, fs=40_000.0)
|
||||||
# powerspec = decibel(powerspec)
|
powerspec = decibel(powerspec)
|
||||||
|
|
||||||
f_sq, powerspec_sq = welch(beat_squared, fs=40_000.0)
|
f_sq, powerspec_sq = welch(beat_squared, fs=40_000.0)
|
||||||
powerspec_sq = decibel(powerspec_sq)
|
powerspec_sq = decibel(powerspec_sq)
|
||||||
@ -124,12 +124,12 @@ class PyRelacs(QMainWindow):
|
|||||||
pen = pg.mkPen(colors[i])
|
pen = pg.mkPen(colors[i])
|
||||||
self.beat_plot.plot(
|
self.beat_plot.plot(
|
||||||
np.arange(0, len(beat)) / 40_000.0,
|
np.arange(0, len(beat)) / 40_000.0,
|
||||||
beat,
|
beat_squared,
|
||||||
pen=pen,
|
pen=pen,
|
||||||
# name=stim.name,
|
# name=stim.name,
|
||||||
)
|
)
|
||||||
self.power_plot.plot(f, powerspec, pen=pen)
|
self.power_plot.plot(f_sq, powerspec_sq, pen=pen)
|
||||||
# self.power_plot.plot(f[peaks], powerspec_sq[peaks], pen=None, symbol="x")
|
self.power_plot.plot(f[peaks], powerspec_sq[peaks], pen=None, symbol="x")
|
||||||
|
|
||||||
def connect_dac(self):
|
def connect_dac(self):
|
||||||
devices = uldaq.get_daq_device_inventory(uldaq.InterfaceType.USB)
|
devices = uldaq.get_daq_device_inventory(uldaq.InterfaceType.USB)
|
||||||
|
@ -2,7 +2,6 @@ import sys
|
|||||||
import importlib.util
|
import importlib.util
|
||||||
import ast
|
import ast
|
||||||
import pathlib
|
import pathlib
|
||||||
from typing import Tuple
|
|
||||||
|
|
||||||
from IPython import embed
|
from IPython import embed
|
||||||
import nixio as nix
|
import nixio as nix
|
||||||
@ -12,19 +11,12 @@ log = config_logging()
|
|||||||
|
|
||||||
|
|
||||||
class Repro:
|
class Repro:
|
||||||
"""
|
|
||||||
Repro Class that searches in the repro folder for classes instances and executes the
|
|
||||||
the run function in the searched class
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def run_repro(
|
def run_repro(
|
||||||
self, nix_file: nix.File, name: str, file: pathlib.Path, *args, **kwargs
|
self, nix_file: nix.File, name: str, file: pathlib.Path, *args, **kwargs
|
||||||
) -> None:
|
) -> None:
|
||||||
|
|
||||||
spec = importlib.util.spec_from_file_location("rep", file)
|
spec = importlib.util.spec_from_file_location("rep", file)
|
||||||
if not spec:
|
if not spec:
|
||||||
log.error("Could not load the file")
|
log.error("Could not load the file")
|
||||||
@ -41,17 +33,7 @@ class Repro:
|
|||||||
else:
|
else:
|
||||||
raise AttributeError(f"{file.name} has no {name} class")
|
raise AttributeError(f"{file.name} has no {name} class")
|
||||||
|
|
||||||
def names_of_repros(self) -> Tuple[list, list]:
|
def names_of_repros(self):
|
||||||
"""
|
|
||||||
Searches for class names in the repro folder in all python files
|
|
||||||
|
|
||||||
Returns
|
|
||||||
-------
|
|
||||||
Tuple[list, list]
|
|
||||||
list of class names
|
|
||||||
list of file names from the class names
|
|
||||||
"""
|
|
||||||
|
|
||||||
file_path_cur = pathlib.Path(__file__).parent
|
file_path_cur = pathlib.Path(__file__).parent
|
||||||
python_files = list(file_path_cur.glob("**/*.py"))
|
python_files = list(file_path_cur.glob("**/*.py"))
|
||||||
exclude_files = ["repros.py", "__init__.py"]
|
exclude_files = ["repros.py", "__init__.py"]
|
||||||
|
Loading…
Reference in New Issue
Block a user