print(experiment.samples) fails for qcvv experiments if any sample hasn't been both run and compiled, because repr(sample) will try to access missing attributes. this is pretty annoying when working in a python shell, which tries to print the repr if i just enter e.g. experiment.samples[0]
i think the easy (and imo best?) fix would be to have the missing attributes default to None instead of making them fields with init=False.
How can we reproduce the issue?
exp = supermarq.qcvv.IRB()
exp.prepare_experiment(2, [2])
print(exp.samples) # AttributeError: 'Sample' object has no attribute 'probabilities'
exp.run_with_simulator()
print(exp.samples) # AttributeError: 'Sample' object has no attribute 'compiled_circuit'
What should happen?
i should be able to print the samples, even if they're not ready yet
What is happening?
print(experiment.samples)
fails for qcvv experiments if any sample hasn't been both run and compiled, becauserepr(sample)
will try to access missing attributes. this is pretty annoying when working in a python shell, which tries to print the repr if i just enter e.g.experiment.samples[0]
i think the easy (and imo best?) fix would be to have the missing attributes default to None instead of making them
field
s withinit=False
.How can we reproduce the issue?
What should happen?
i should be able to print the samples, even if they're not ready yet
Environment
Any additional context?
No response