{"action":"created","issue":{"url":"https://api.github.com/repos/opencobra/cobrapy/issues/311","repository_url":"https://api.github.com/repos/opencobra/cobrapy","labels_url":"https://api.github.com/repos/opencobra/cobrapy/issues/311/labels{/name}","comments_url":"https://api.github.com/repos/opencobra/cobrapy/issues/311/comments","events_url":"https://api.github.com/repos/opencobra/cobrapy/issues/311/events","html_url":"https://github.com/opencobra/cobrapy/issues/311","id":188846016,"number":311,"title":"Refactor cobra.Model and cobra.Reaction","user":{"login":"pstjohn","id":2576846,"avatar_url":"https://avatars.githubusercontent.com/u/2576846?v=3","gravatar_id":"","url":"https://api.github.com/users/pstjohn","html_url":"https://github.com/pstjohn","followers_url":"https://api.github.com/users/pstjohn/followers","following_url":"https://api.github.com/users/pstjohn/following{/other_user}","gists_url":"https://api.github.com/users/pstjohn/gists{/gist_id}","starred_url":"https://api.github.com/users/pstjohn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pstjohn/subscriptions","organizations_url":"https://api.github.com/users/pstjohn/orgs","repos_url":"https://api.github.com/users/pstjohn/repos","events_url":"https://api.github.com/users/pstjohn/events{/privacy}","received_events_url":"https://api.github.com/users/pstjohn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-11T20:39:28Z","updated_at":"2016-11-17T08:41:17Z","closed_at":null,"body":"This is something I'd like to get to eventually. Hopefully we could keep these classes relatively clean and put a lot of the implementation in other files.\r\n\r\nSome candidates to move:\r\n\r\n - [ ] `Reaction.build_reaction_string`, `Reaction.build_reaction_from_string`\r\nThese could easily go into a cobra/utils/reaction_string.py or something similar.\r\n\r\n- [ ] `Model.copy` and `Reaction.copy`, could go into a utils/copy.py\r\n\r\n- [ ] `Model.add_reactions` and similar\r\nThese we could put in a cobra/utils/combine.py, and do something like `def add_reaction_to_model`, `add_reaction_to_reaction`, etc. If we thought it was worth it, it could then be pretty trivial to add in a bunch more functionality to `__add__`, checking the type of the other class and calling the correct routine as appropriate.\r\n\r\n- [ ] all the `optlang` stuff 😄 . When/where it makes sense at least\r\n"},"comment":{"url":"https://api.github.com/repos/opencobra/cobrapy/issues/comments/261187635","html_url":"https://github.com/opencobra/cobrapy/issues/311#issuecomment-261187635","issue_url":"https://api.github.com/repos/opencobra/cobrapy/issues/311","id":261187635,"user":{"login":"phantomas1234","id":55217,"avatar_url":"https://avatars.githubusercontent.com/u/55217?v=3","gravatar_id":"","url":"https://api.github.com/users/phantomas1234","html_url":"https://github.com/phantomas1234","followers_url":"https://api.github.com/users/phantomas1234/followers","following_url":"https://api.github.com/users/phantomas1234/following{/other_user}","gists_url":"https://api.github.com/users/phantomas1234/gists{/gist_id}","starred_url":"https://api.github.com/users/phantomas1234/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phantomas1234/subscriptions","organizations_url":"https://api.github.com/users/phantomas1234/orgs","repos_url":"https://api.github.com/users/phantomas1234/repos","events_url":"https://api.github.com/users/phantomas1234/events{/privacy}","received_events_url":"https://api.github.com/users/phantomas1234/received_events","type":"User","site_admin":false},"created_at":"2016-11-17T08:41:17Z","updated_at":"2016-11-17T08:41:17Z","body":"I think we need strike a balance between bloated core classes and scattered code. I see `Model.add_reactions` as one of the most important methods of `Model`. Wouldn't it be extremely inconvenient for the user to have to import basic functionality like this from some `util` module? I admit that we've been going a little bit too far with bloating the cameo core classes, but we're not planning to move all of it into cobrapy."}}
{"actor":{"display_login":"phantomas1234"}}