{"action":"created","issue":{"url":"https://api.github.com/repos/Acellera/htmd/issues/711","repository_url":"https://api.github.com/repos/Acellera/htmd","labels_url":"https://api.github.com/repos/Acellera/htmd/issues/711/labels{/name}","comments_url":"https://api.github.com/repos/Acellera/htmd/issues/711/comments","events_url":"https://api.github.com/repos/Acellera/htmd/issues/711/events","html_url":"https://github.com/Acellera/htmd/pull/711","id":331180817,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzOTc1MDY3","number":711,"title":"Refactoring of Molecule file reading","user":{"login":"stefdoerr","id":7935362,"node_id":"MDQ6VXNlcjc5MzUzNjI=","avatar_url":"https://avatars3.githubusercontent.com/u/7935362?v=4","gravatar_id":"","url":"https://api.github.com/users/stefdoerr","html_url":"https://github.com/stefdoerr","followers_url":"https://api.github.com/users/stefdoerr/followers","following_url":"https://api.github.com/users/stefdoerr/following{/other_user}","gists_url":"https://api.github.com/users/stefdoerr/gists{/gist_id}","starred_url":"https://api.github.com/users/stefdoerr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefdoerr/subscriptions","organizations_url":"https://api.github.com/users/stefdoerr/orgs","repos_url":"https://api.github.com/users/stefdoerr/repos","events_url":"https://api.github.com/users/stefdoerr/events{/privacy}","received_events_url":"https://api.github.com/users/stefdoerr/received_events","type":"User","site_admin":false},"labels":[{"id":941194593,"node_id":"MDU6TGFiZWw5NDExOTQ1OTM=","url":"https://api.github.com/repos/Acellera/htmd/labels/Priority:%20Medium","name":"Priority: Medium","color":"fbca04","default":false},{"id":265455042,"node_id":"MDU6TGFiZWwyNjU0NTUwNDI=","url":"https://api.github.com/repos/Acellera/htmd/labels/Type:%20Enhancement","name":"Type: Enhancement","color":"84b6eb","default":false}],"state":"open","locked":false,"assignee":{"login":"stefdoerr","id":7935362,"node_id":"MDQ6VXNlcjc5MzUzNjI=","avatar_url":"https://avatars3.githubusercontent.com/u/7935362?v=4","gravatar_id":"","url":"https://api.github.com/users/stefdoerr","html_url":"https://github.com/stefdoerr","followers_url":"https://api.github.com/users/stefdoerr/followers","following_url":"https://api.github.com/users/stefdoerr/following{/other_user}","gists_url":"https://api.github.com/users/stefdoerr/gists{/gist_id}","starred_url":"https://api.github.com/users/stefdoerr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefdoerr/subscriptions","organizations_url":"https://api.github.com/users/stefdoerr/orgs","repos_url":"https://api.github.com/users/stefdoerr/repos","events_url":"https://api.github.com/users/stefdoerr/events{/privacy}","received_events_url":"https://api.github.com/users/stefdoerr/received_events","type":"User","site_admin":false},"assignees":[{"login":"stefdoerr","id":7935362,"node_id":"MDQ6VXNlcjc5MzUzNjI=","avatar_url":"https://avatars3.githubusercontent.com/u/7935362?v=4","gravatar_id":"","url":"https://api.github.com/users/stefdoerr","html_url":"https://github.com/stefdoerr","followers_url":"https://api.github.com/users/stefdoerr/followers","following_url":"https://api.github.com/users/stefdoerr/following{/other_user}","gists_url":"https://api.github.com/users/stefdoerr/gists{/gist_id}","starred_url":"https://api.github.com/users/stefdoerr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefdoerr/subscriptions","organizations_url":"https://api.github.com/users/stefdoerr/orgs","repos_url":"https://api.github.com/users/stefdoerr/repos","events_url":"https://api.github.com/users/stefdoerr/events{/privacy}","received_events_url":"https://api.github.com/users/stefdoerr/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2018-06-11T13:05:59Z","updated_at":"2018-06-13T12:11:30Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/Acellera/htmd/pulls/711","html_url":"https://github.com/Acellera/htmd/pull/711","diff_url":"https://github.com/Acellera/htmd/pull/711.diff","patch_url":"https://github.com/Acellera/htmd/pull/711.patch"},"body":"As promised here comes the big PR.\r\nSo as per the discussion we had on multi-mol MOL2 file reader. \r\nWe needed the readers to be able to return multiple molecules. In readers.py I have the Topology and Trajectory classes which I only use temporarily to collect all the data in the file because appending to lists is faster than appending to numpy arrays which is what Molecule uses. \r\n\r\nSo then I needed a way to convert a Topology+Trajectory to a Molecule. Until now this was done inside the Molecule class. This however creates the problem that if you read a file with multiple molecules you need to instantiate multiple Molecule objects which could not be done in `Molecule.read`. So I moved the Molecule creation part out of Molecule now to a MolFactory class which creates Molecule objects. Then the readers can use that to return one or more Molecules. This allows us now to read multiple molecules from a single file by using directly the file reader.\r\n\r\nHence the `Molecule.read` now gets from the readers one or more `Molecule` objects which it then tries to merge into itself.\r\n\r\nAnd to answer the probably inevitable question, the `MolFactory` is not meant to be instantiated. It's a static class of the \"factory/builder\" pattern https://en.wikipedia.org/wiki/Builder_pattern. It probably doesn't follow the patterns to the T but I hope you don't mind. Yes, I could have made it a function instead of a class but I thought it nicer to group the functions together in that way. Your taste may vary.\r\n\r\nIf this takes too long to merge it will probably become a mess to merge later since it changes some core stuff in Molecule so please @j3mdamas review the soonest possible."},"comment":{"url":"https://api.github.com/repos/Acellera/htmd/issues/comments/396915416","html_url":"https://github.com/Acellera/htmd/pull/711#issuecomment-396915416","issue_url":"https://api.github.com/repos/Acellera/htmd/issues/711","id":396915416,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NjkxNTQxNg==","user":{"login":"j3mdamas","id":10810178,"node_id":"MDQ6VXNlcjEwODEwMTc4","avatar_url":"https://avatars1.githubusercontent.com/u/10810178?v=4","gravatar_id":"","url":"https://api.github.com/users/j3mdamas","html_url":"https://github.com/j3mdamas","followers_url":"https://api.github.com/users/j3mdamas/followers","following_url":"https://api.github.com/users/j3mdamas/following{/other_user}","gists_url":"https://api.github.com/users/j3mdamas/gists{/gist_id}","starred_url":"https://api.github.com/users/j3mdamas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j3mdamas/subscriptions","organizations_url":"https://api.github.com/users/j3mdamas/orgs","repos_url":"https://api.github.com/users/j3mdamas/repos","events_url":"https://api.github.com/users/j3mdamas/events{/privacy}","received_events_url":"https://api.github.com/users/j3mdamas/received_events","type":"User","site_admin":false},"created_at":"2018-06-13T12:11:30Z","updated_at":"2018-06-13T12:11:30Z","author_association":"CONTRIBUTOR","body":"General comment: I wonder if the strategy taken here should be applied in the `SmallMolLib`"}}
{"actor":{"display_login":"j3mdamas"}}