{"action":"created","issue":{"url":"https://api.github.com/repos/openpathsampling/openpathsampling/issues/620","repository_url":"https://api.github.com/repos/openpathsampling/openpathsampling","labels_url":"https://api.github.com/repos/openpathsampling/openpathsampling/issues/620/labels{/name}","comments_url":"https://api.github.com/repos/openpathsampling/openpathsampling/issues/620/comments","events_url":"https://api.github.com/repos/openpathsampling/openpathsampling/issues/620/events","html_url":"https://github.com/openpathsampling/openpathsampling/issues/620","id":184946380,"number":620,"title":"Change in storing policy for referenced objects","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":[{"url":"https://api.github.com/repos/openpathsampling/openpathsampling/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/openpathsampling/openpathsampling/milestones/1","html_url":"https://github.com/openpathsampling/openpathsampling/milestones/1.0","labels_url":"https://api.github.com/repos/openpathsampling/openpathsampling/milestones/1/labels","id":882847,"number":1,"title":"1.0","description":"Issues that should be solved before first public release.","creator":{"login":"dwhswenson","id":8178546,"avatar_url":"https://avatars.githubusercontent.com/u/8178546?v=3","gravatar_id":"","url":"https://api.github.com/users/dwhswenson","html_url":"https://github.com/dwhswenson","followers_url":"https://api.github.com/users/dwhswenson/followers","following_url":"https://api.github.com/users/dwhswenson/following{/other_user}","gists_url":"https://api.github.com/users/dwhswenson/gists{/gist_id}","starred_url":"https://api.github.com/users/dwhswenson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwhswenson/subscriptions","organizations_url":"https://api.github.com/users/dwhswenson/orgs","repos_url":"https://api.github.com/users/dwhswenson/repos","events_url":"https://api.github.com/users/dwhswenson/events{/privacy}","received_events_url":"https://api.github.com/users/dwhswenson/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":106,"state":"open","created_at":"2014-11-27T17:27:40Z","updated_at":"2016-10-24T20:30:11Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2016-10-24T20:30:11Z","updated_at":"2016-10-25T12:36:46Z","closed_at":null,"body":"This is born out of convenience for restart and trying to reflect what a user might want to happen, when he saves an object.\r\n\r\n#### The problem\r\n\r\nSome objects, e.g. `Sample`, reference other \"older\" samples which are part of their history. This is useful to build path trees but when you save an object to a new storage the current _completeness_ policy will trigger storing all related samples, which will trigger storing all their related samples and so on. This will lead to completely re-save a full simulation and not just the single sample.\r\n\r\nIn this case what the user wants is to store only this last sample and not everything.\r\n\r\n#### How to solve this\r\n\r\nThere are a few ways to get around this:\r\n\r\n1. Make a copy of the objet that does not have the reference to the other objects. This is the simplest yet most technical solution. You need to know which objects can have this issue and need to decide where to make the _cuts_. For a sample this would be `.previous` but there could be more. So this requires a user to know about these problems and fix them manually.\r\n\r\n2. There is a helper function for a sample set to do that for all samples alike. `sampleset.copy_without_parents()`\r\n\r\n3. We change the policy on delegation of saving for some attributes. For samples this would mean that saving a sample the object referenced in `.previous` will be stored only with its UUID but the referenced object is not stored. This will cause what the _above_ user wanted. But it will not cause the chain of storing events which might have been expected. I could imagine some cases where it will not stuff but a user might think he had stored it. In the current setup I am pretty sure that we the exact behaviour we would like to have. But: If you then save a sample you need to save `sample.previous` by hand provided that it is not saved already (which it will be in the production case)."},"comment":{"url":"https://api.github.com/repos/openpathsampling/openpathsampling/issues/comments/256022463","html_url":"https://github.com/openpathsampling/openpathsampling/issues/620#issuecomment-256022463","issue_url":"https://api.github.com/repos/openpathsampling/openpathsampling/issues/620","id":256022463,"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-10-25T12:36:45Z","updated_at":"2016-10-25T12:36:45Z","body":"Yes, that would be possible and seems like a good idea. You can even change this behaviour on the fly since it does not affect the storage itself, only what is stored. \r\n\r\nIf I understand you you want to exclude things that are not yet stored in the fallback storage, i.e. only store, if you cannot load the object in any way. That seems like a good default, when you have a fallback attached, just use it. In case you do want our current behaviour there could be an option to really store everything despite it being already in the fallback.\r\n\r\nI would say we we do not need option 3. then and the fallback based is much simpler and cleaner for the user. Thanks.\r\n\r\n"}}
{"actor":{"display_login":"jhprinz"}}