{"action":"created","issue":{"url":"https://api.github.com/repos/Acellera/htmd/issues/415","repository_url":"https://api.github.com/repos/Acellera/htmd","labels_url":"https://api.github.com/repos/Acellera/htmd/issues/415/labels{/name}","comments_url":"https://api.github.com/repos/Acellera/htmd/issues/415/comments","events_url":"https://api.github.com/repos/Acellera/htmd/issues/415/events","html_url":"https://github.com/Acellera/htmd/issues/415","id":246800094,"number":415,"title":"production class is not considering the constraints set up by the user","user":{"login":"cuzzo87","id":10772443,"avatar_url":"https://avatars3.githubusercontent.com/u/10772443?v=4","gravatar_id":"","url":"https://api.github.com/users/cuzzo87","html_url":"https://github.com/cuzzo87","followers_url":"https://api.github.com/users/cuzzo87/followers","following_url":"https://api.github.com/users/cuzzo87/following{/other_user}","gists_url":"https://api.github.com/users/cuzzo87/gists{/gist_id}","starred_url":"https://api.github.com/users/cuzzo87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cuzzo87/subscriptions","organizations_url":"https://api.github.com/users/cuzzo87/orgs","repos_url":"https://api.github.com/users/cuzzo87/repos","events_url":"https://api.github.com/users/cuzzo87/events{/privacy}","received_events_url":"https://api.github.com/users/cuzzo87/received_events","type":"User","site_admin":false},"labels":[{"id":353460092,"url":"https://api.github.com/repos/Acellera/htmd/labels/bug:medium","name":"bug:medium","color":"d93f0b","default":false}],"state":"open","locked":false,"assignee":{"login":"j3mdamas","id":10810178,"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},"assignees":[{"login":"j3mdamas","id":10810178,"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}],"milestone":null,"comments":4,"created_at":"2017-07-31T15:37:30Z","updated_at":"2017-08-01T12:39:07Z","closed_at":null,"body":"When using the constraints feature in `protocol.production_v4`  and `protocol.production_v5` their write functions overwrite the `structure.pdb` with one present in the equil, practically not considering what the user had set up.\r\n\r\nHere the code:\r\n```\r\n# Adding constraints\r\n        if self.useconstraints:\r\n            inmol = Molecule(os.path.join(inputdir, self.acemd.coordinates))\r\n            inmol.set('occupancy', 0)\r\n            inmol.set('beta', 0)\r\n            if len(self.constraints) == 0:\r\n                raise RuntimeError('You have set the production to use constraints (useconstraints=True), but have not '\r\n                                   'defined any constraints (constraints={}).')\r\n            else:\r\n                for sel in self.constraints:\r\n                    inmol.set('beta', self.constraints[sel], sel)\r\n                outfile = os.path.join(outputdir, self.acemd.coordinates)\r\n                if not os.path.exists(outputdir):\r\n                    os.makedirs(outputdir)\r\n                inmol.write(outfile)\r\n                self.acemd.consref = self.acemd.coordinates\r\n\r\n        self.acemd.setup(inputdir, outputdir, overwrite=True)\r\n```\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Acellera/htmd/issues/comments/319358116","html_url":"https://github.com/Acellera/htmd/issues/415#issuecomment-319358116","issue_url":"https://api.github.com/repos/Acellera/htmd/issues/415","id":319358116,"user":{"login":"giadefa","id":7776826,"avatar_url":"https://avatars3.githubusercontent.com/u/7776826?v=4","gravatar_id":"","url":"https://api.github.com/users/giadefa","html_url":"https://github.com/giadefa","followers_url":"https://api.github.com/users/giadefa/followers","following_url":"https://api.github.com/users/giadefa/following{/other_user}","gists_url":"https://api.github.com/users/giadefa/gists{/gist_id}","starred_url":"https://api.github.com/users/giadefa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giadefa/subscriptions","organizations_url":"https://api.github.com/users/giadefa/orgs","repos_url":"https://api.github.com/users/giadefa/repos","events_url":"https://api.github.com/users/giadefa/events{/privacy}","received_events_url":"https://api.github.com/users/giadefa/received_events","type":"User","site_admin":false},"created_at":"2017-08-01T12:39:07Z","updated_at":"2017-08-01T12:39:07Z","body":"I have not even understood what the problem is. Let's talk later about it.\n\nOn 1 August 2017 at 14:31, Stefan Doerr <notifications@github.com> wrote:\n\n> You can't put it before either or this line will be ignored:\n> self.acemd.consref = self.acemd.coordinates\n>\n> Something like this should work:\n>\n>     # Adding constraints\n>     if self.useconstraints:\n>         if len(self.constraints) == 0:\n>             raise RuntimeError('You have set the production to use constraints (useconstraints=True), but have not '\n>                                 'defined any constraints (constraints={}).')\n>         self.acemd.consref = self.acemd.coordinates\n>\n>     self.acemd.setup(inputdir, outputdir, overwrite=True)\n>\n>     if self.useconstraints:\n>         self._writeConstraintsPDB(self.constraints, self.acemd, inputdir, outputdir)\n> def _writeConstraintsPDB(self, constraints, acemd, inputdir, outputdir):\n>     if self.useconstraints:\n>         inmol = Molecule(os.path.join(inputdir, acemd.coordinates))\n>         inmol.set('occupancy', 0)\n>         inmol.set('beta', 0)\n>         for sel in constraints:\n>             inmol.set('beta', constraints[sel], sel)\n>         outfile = os.path.join(outputdir, acemd.coordinates)\n>         if not os.path.exists(outputdir):\n>             os.makedirs(outputdir)\n>         inmol.write(outfile)\n>\n> But really this seems to me like it's broken anyway. It would not work if\n> the coordinates file is .coor instead of .pdb\n>\n> —\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/Acellera/htmd/issues/415#issuecomment-319356447>, or mute\n> the thread\n> <https://github.com/notifications/unsubscribe-auth/AHaqOm_SmrqAZe2KH8NRrabrPW0YJq6zks5sTxqggaJpZM4Ookb2>\n> .\n>\n\n\n\n-- \n<http://www.acellera.com>\n\n       <https://twitter.com/acellera>\n<https://www.youtube.com/user/acelleracom>\n<https://www.linkedin.com/company/2133167?trk=tyah&trkInfo=clickedVertical%3Acompany%2CclickedEntityId%3A2133167%2Cidx%3A2-1-2%2CtarId%3A1448018583204%2Ctas%3Aacellera>\n    <https://www.acellera.com/md-simulation-blog-news/>\n<http://is.gd/1eXkbS>\n"}}
{"actor":{"display_login":"giadefa"}}