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

Implementing new monitoring feature #30

Merged
merged 2 commits into from
Aug 30, 2023

Conversation

edan-bainglass
Copy link
Collaborator

@edan-bainglass edan-bainglass commented Aug 25, 2023

One thing I'm concerned about is if I've migrated ALL features of the monitor calcjob. In particular, did the previous implementation capture job termination due to error/cancellation? Because I don't believe this is implemented here.

Update

Recent tests raised exit code 502 (cancelled but retrieved) due to a bad battery. This confirms that the above concern HAS BEEN IMPLEMENTED in the new feature. Note that this is not implemented per monitor, but rather appears to be a global feature. Confirming with Sabastiaan...

Okay, so it's an internal feature that existed in AiiDA in general. 501 and 502 are set by us, but AiiDA's internal mechanism reacts to them. Or something like that. Still looking into it.

Copy link
Collaborator

@ramirezfranciscof ramirezfranciscof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall seems all good! I just have a question regarding one line that could be problematic.

return None

self.current_capacity = self.capacities[-1]
self.threshold = self.threshold * self.capacities[0]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the CapacityAnalyzer get instantiated every time it has to perform the analysis or the instance gets re-used? Because if CapacityAnalyzer.analyze gets ran more than once per object it will start accumulating products with self.capacities[0], right? I would say even if now we just re-create it each time, it would be better to implement this differently to avoid side-effects.

Copy link
Collaborator

@ramirezfranciscof ramirezfranciscof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@edan-bainglass edan-bainglass merged commit 9cd28d2 into EmpaEconversion:main Aug 30, 2023
3 checks passed
@edan-bainglass edan-bainglass deleted the monitoring branch August 30, 2023 07:37
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

Successfully merging this pull request may close these issues.

2 participants