Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function (built in to load experiment) to interpret loaded experiment and output a summary. #76

Open
rsbrost opened this issue Feb 27, 2024 · 1 comment

Comments

@rsbrost
Copy link
Contributor

rsbrost commented Feb 27, 2024

No description provided.

@rsbrost
Copy link
Contributor Author

rsbrost commented Jun 25, 2024

For this I think we should try and have it output the code used to set up said experiment. For example, in demo nb 1 it would output something like:

devices = ps.ItemAttribute()

devices.v1 = ps.TestVoltage() # Device 1
devices.v2 = ps.TestVoltage() # Device 2
devices.v3 = ps.TestVoltage() # Device 3

def get_voltage_data(expt):
    runinfo = expt.runinfo
    devices = expt.devices

    d = ps.ItemAttribute()

    d.v1_readout = devices.v1.voltage
    d.v2_readout = devices.v2.voltage
    d.v3_readout = devices.v3.voltage

    d.vsum = d.v1_readout + d.v2_readout + d.v3_readout
    
    return d

runinfo = ps.RunInfo()
runinfo.scan0 = ps.PropertyScan({'v1': ps.drange(0, 0.1, 1)}, prop='voltage', dt=0.01)

runinfo.measure_function = get_voltage_data

expt = ps.Experiment(runinfo, devices, time=True)
expt.start_thread()  # or alternatively expt.run()

I think this could offer a quick overview of how the experiment was designed and be valuable to experimenters wanting to understand old experiments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants