{"action":"created","issue":{"url":"https://api.github.com/repos/choderalab/openpathsampling/issues/157","labels_url":"https://api.github.com/repos/choderalab/openpathsampling/issues/157/labels{/name}","comments_url":"https://api.github.com/repos/choderalab/openpathsampling/issues/157/comments","events_url":"https://api.github.com/repos/choderalab/openpathsampling/issues/157/events","html_url":"https://github.com/choderalab/openpathsampling/pull/157","id":57229173,"number":157,"title":"[WIP] Add Query support for storages","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,"milestone":null,"comments":10,"created_at":"2015-02-10T20:08:14Z","updated_at":"2015-02-12T01:02:15Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/choderalab/openpathsampling/pulls/157","html_url":"https://github.com/choderalab/openpathsampling/pull/157","diff_url":"https://github.com/choderalab/openpathsampling/pull/157.diff","patch_url":"https://github.com/choderalab/openpathsampling/pull/157.patch"},"body":"This allows to easily define a Query for the storage and load all objects that match this.\r\n\r\n### Example\r\nLoad all samples that are samples for a specific ensemble\r\n```\r\nensemble = ... # ensemble to be searched for\r\nquery = paths.storage.StorageQuery(lambda self : self.ensemble is ensemble)\r\n\r\n# Query the storage and return an iterator over all matchin samples\r\nfor sample in query(storage.samples):\r\n    print sample.ensemble.idx[storage] # check, if the idx is the same for all found samples\r\n```"},"comment":{"url":"https://api.github.com/repos/choderalab/openpathsampling/issues/comments/73998522","html_url":"https://github.com/choderalab/openpathsampling/pull/157#issuecomment-73998522","issue_url":"https://api.github.com/repos/choderalab/openpathsampling/issues/157","id":73998522,"user":{"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},"created_at":"2015-02-12T01:02:15Z","updated_at":"2015-02-12T01:02:15Z","body":"All looks reasonable, although I can't tell from the above whether `CalculationStep` is the `root_mover` or not.\r\n\r\nHowever, this can't be auto-merged. There's some conflict with master. (You might also consider merging #159 first; that way if the storage test causes problems again, we'll get a hint what's going on.)\r\n\r\nAnyway, if you can make this merge-ready tonight, I think it is (in principle) good to be merged."}}