Skip to content

Instantly share code, notes, and snippets.

View lukasberbuer's full-sized avatar

Lukas Berbuer lukasberbuer

View GitHub Profile
@lukasberbuer
lukasberbuer / acqcmd.py
Last active November 27, 2024 12:26
Control the Vallen Systeme AMSY-6 acquisition with the AcqCmdAPI
r"""
Python example to control the Vallen Systeme AMSY-6 acquisition with the AcqCmdAPI (C:\Vallen\API\acqcmd.exe)
Usage: acqcmd <CMD> <PARAMS>
The following commands are available:
GetStatus : Return acquisition status
StatusTest : Report status continuously; <Ctrl+C> to halt
GetFile : Return current acquisition file
LoadFile <filename> : Load given acquisition file
@lukasberbuer
lukasberbuer / live_feature_extraction.py
Created April 24, 2024 07:53
Live feature extraction from tradb while the acquisition is running. Results can be displayed in VisualAE.
from pathlib import Path
from time import sleep
from typing import Iterator
import numpy as np
from vallenae.io import TraDatabase, TraRecord, TrfDatabase, FeatureRecord
TRADB_FILE = r"C:\AE-Data\test.tradb" # change the path to the active tradb file
TRFDB_FILE = Path(TRADB_FILE).with_suffix(".trfdb")
@lukasberbuer
lukasberbuer / live_poll_tradb.py
Created April 24, 2024 07:52
Stream live raw data from tradb file while the acquisition is running
from vallenae.io import TraDatabase, TraRecord
TRADB_FILE = r"C:\AE-Data\test.tradb" # change the path to the active tradb file
if __name__ == "__main__":
with TraDatabase(TRADB_FILE) as tradb:
for record in tradb.listen(
existing=True, # return all existing records in tradb
wait=False, # if True, keeps listing even though acquisition is closed
git tag -l --format='%(refname:short) %(creatordate:short)'

Problem using inspect in frozen application pyinstaller/pyinstaller#4718

Inspect can not retrieve the source code with e.g. inspect.getsource(datetime.date), even though the source files are included in datas:

    datas=[
        *collect_data_files("datetime", include_py_files=True),
    ],