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

allowed places for using add_metric #133

Open
jusschwitalla opened this issue Aug 16, 2024 · 0 comments
Open

allowed places for using add_metric #133

jusschwitalla opened this issue Aug 16, 2024 · 0 comments

Comments

@jusschwitalla
Copy link
Contributor

One has to be very careful at where to place self.metrics.add_metric calls.

The problem we had and which took us a while to understand was that:
We have devices which have a method submit. This submit method is called from within the postprocess method of our solvers. When we added a self.metrics.add_metric call to the device.submit method the corresponding entry in the results.json appears not as part of the current backlog item but as part of the next backlog item - if there is one.

This is because at the time the device submit method is called the postprocessing of the device has already been finished (the device is actually a device factory).

It might be helpful to throw an error (or warning?) if add_metric is called for a module which already has been postprocessed (this is probably possible only on the last repetition of the last backlog item - or one allows add_metric calls only inbetween calling preprocess and ending postprocess - but that might be too strict).

In any case should the user manual contain a paragraph about how to write metrics.

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

1 participant