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

report a small part of a history of a calibration suite #979

Open
igres26 opened this issue Sep 6, 2024 · 1 comment
Open

report a small part of a history of a calibration suite #979

igres26 opened this issue Sep 6, 2024 · 1 comment
Assignees

Comments

@igres26
Copy link
Contributor

igres26 commented Sep 6, 2024

Right now an Executor records all routines executed in its history. Then report can generate a qibocal report of everything done.

It would be useful to be able to only report small parts of this history ideally via slicing, so that if we run optimization loops we can get a snapshot of the evolution across epochs and not have a kilometric report with each an every one of the function evaluations.

It would also be interesting in some cases to not save all the data, as that would blow up storage space.

Would that be easy to implement and open to the user?

@alecandido
Copy link
Member

alecandido commented Sep 6, 2024

Thanks @igres26 to open this.

I didn't have yet enough time to commit much to the user interface, but all of this will be pretty simple to make available with scripts.

However, though pretty much convoluted, this is already partially available from the June/July refactor which led to scripts.
As you noted, the Executor is recording all the routines in a History object, and the report() function accepts a History as an input. This last piece was the main update: I'm trying to register fewer things deep inside objects, and pass simpler objects around (as input and output of functions).

So, in this case you could consider report() as a function that takes a History and returns the actual report (i.e. History -> HTML, though the HTML is being dumped to a path, so the function actually returns nothing).
The History object itself is pretty simple, and mainly a wrapper around a dictionary:

_tasks: dict[Id, list[Completed]] = field(default_factory=lambda: defaultdict(list))

So, if you want to do something like that right now, what you can do is:

# execute your routines

history = executor.history.copy()
# remove outputs you're not interested in
del history._task["routine-1-id"]
del history._task["routine-7-id"]
del history._task["routine-42-id"]

# plot just what you want
report(path, history)

Yes, it's not elegant at all, and it should be improved. Possibly even passing to report() a list of routines' IDs to include/exclude. That's why I'm suggesting to keep this issue open.
However, this is what you could try to use even right now.

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

No branches or pull requests

3 participants