{"action":"created","issue":{"url":"https://api.github.com/repos/openpathsampling/openpathsampling/issues/570","repository_url":"https://api.github.com/repos/openpathsampling/openpathsampling","labels_url":"https://api.github.com/repos/openpathsampling/openpathsampling/issues/570/labels{/name}","comments_url":"https://api.github.com/repos/openpathsampling/openpathsampling/issues/570/comments","events_url":"https://api.github.com/repos/openpathsampling/openpathsampling/issues/570/events","html_url":"https://github.com/openpathsampling/openpathsampling/pull/570","id":172107143,"number":570,"title":"[WIP] Handling of `NaN` and other errors in engine","user":{"login":"jhprinz","id":5091934,"avatar_url":"https://avatars.githubusercontent.com/u/5091934?v=3","gravatar_id":"","url":"https://api.github.com/users/jhprinz","html_url":"https://github.com/jhprinz","followers_url":"https://api.github.com/users/jhprinz/followers","following_url":"https://api.github.com/users/jhprinz/following{/other_user}","gists_url":"https://api.github.com/users/jhprinz/gists{/gist_id}","starred_url":"https://api.github.com/users/jhprinz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhprinz/subscriptions","organizations_url":"https://api.github.com/users/jhprinz/orgs","repos_url":"https://api.github.com/users/jhprinz/repos","events_url":"https://api.github.com/users/jhprinz/events{/privacy}","received_events_url":"https://api.github.com/users/jhprinz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":37,"created_at":"2016-08-19T11:01:37Z","updated_at":"2016-08-23T18:47:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/openpathsampling/openpathsampling/pulls/570","html_url":"https://github.com/openpathsampling/openpathsampling/pull/570","diff_url":"https://github.com/openpathsampling/openpathsampling/pull/570.diff","patch_url":"https://github.com/openpathsampling/openpathsampling/pull/570.patch"},"body":"An engine might produce `NaN` or other errors that might be catchable and being fixed by a suitable retry. This PR adds _mutable_ not stored settings on how to deal with it\r\n```\r\n    Attributes\r\n    ----------\r\n    on_nan : str\r\n        set the behaviour of the engine when `NaN` is detected. Possible is\r\n        1.  `fail` will raise an exception\r\n        2.  `ignore` will completely ignore it and continue\r\n        3.  `retry` will rerun the trajectory (default)\r\n    retries_when_nan : int, default: 2\r\n        the number of retries (if chosen) before an exception is raised\r\n    on_error : str\r\n        set the behaviour of the engine when an exception happens. Possible is\r\n        1.  `fail` will raise an exception\r\n        2.  `ignore` will completely ignore it and continue\r\n        3.  `retry` will rerun the trajectory (default)\r\n    retries_when_error : int, default: 2\r\n        the number of retries (if chosen) before an exception is raised\r\n    on_max_length : str\r\n        set the behaviour if the trajectory length is n_frames_max. Possible is\r\n        1.  `fail` will raise an exception\r\n        2.  `ignore` will completely ignore the limit and continue\r\n        3.  `stop` will stop and return the max length trajectory (default)\r\n        4.  `retry` will rerun the trajectory\r\n    retries_when_max_length : int, default: 0\r\n        the number of retries (if chosen) before an exception is raised\r\n    on_retry : str or callable\r\n        the behaviour when a try is started. Since you have already generated\r\n        some trajectory you might not restart completely. Possibilities are\r\n        1.  `full` will restart completely and use the initial frames (default)\r\n        2.  `50%` will cut the existing in half but keeping at least the initial\r\n        3.  `remove_interval` will remove as many frames as the `interval`\r\n        4.  a callable will be used as a function to generate the new from the\r\n            old trajectories, e.g. `lambda t: t[:10]` would restart with the\r\n            first 10 frames\r\n```\r\n\r\nWhen the engine fails or is stopped by the user, it will always shut down gracefully and return an exception giving the reason. All exceptions along the way are also capture and printed in the log file.\r\n"},"comment":{"url":"https://api.github.com/repos/openpathsampling/openpathsampling/issues/comments/241836034","html_url":"https://github.com/openpathsampling/openpathsampling/pull/570#issuecomment-241836034","issue_url":"https://api.github.com/repos/openpathsampling/openpathsampling/issues/570","id":241836034,"user":{"login":"jhprinz","id":5091934,"avatar_url":"https://avatars.githubusercontent.com/u/5091934?v=3","gravatar_id":"","url":"https://api.github.com/users/jhprinz","html_url":"https://github.com/jhprinz","followers_url":"https://api.github.com/users/jhprinz/followers","following_url":"https://api.github.com/users/jhprinz/following{/other_user}","gists_url":"https://api.github.com/users/jhprinz/gists{/gist_id}","starred_url":"https://api.github.com/users/jhprinz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhprinz/subscriptions","organizations_url":"https://api.github.com/users/jhprinz/orgs","repos_url":"https://api.github.com/users/jhprinz/repos","events_url":"https://api.github.com/users/jhprinz/events{/privacy}","received_events_url":"https://api.github.com/users/jhprinz/received_events","type":"User","site_admin":false},"created_at":"2016-08-23T18:47:18Z","updated_at":"2016-08-23T18:47:18Z","body":"> I think the way it should work is this: DynamicsEngine has a minimal set of initialization parameters (which are then attributes). Each subclass should have a different set that makes sense for that subclass. integrator makes sense for both ToyEngine and OpenMMEngine, but maybe there would be some other engine where it was redundant. topology makes sense for OpenMMEngine, but does not make sense for ToyEngine (which should have a potential_energy_surface instead). It's okay to add extra parameters to the initialization of subclasses, since we don't expect them to be perfectly interchangeable.\r\n\r\nAlright. What I thought and wanted. So we clean this up shortly after this. DynamicsEngine now only has stuff about the number of steps, maximum frames and all the error handling which makes sense for all of them. These are options. All the really specific stuff are parameters on the constructor.\r\n\r\nWill need a few more minutes. Need to change to named tuple . "}}
{"actor":{"display_login":"jhprinz"}}