Skip to content

Refactor cobra.Model and cobra.Reaction #311

@pstjohn

Description

@pstjohn

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.

Some candidates to move:

  • Reaction.build_reaction_string, Reaction.build_reaction_from_string
    These could easily go into a cobra/utils/reaction_string.py or something similar.

  • Model.copy and Reaction.copy, could go into a utils/copy.py

  • Model.add_reactions and similar
    These 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.

  • all the optlang stuff 😄 . When/where it makes sense at least

    • upper_bound and lower_bound

Note: From cobrapy meeting, lets prioritize where methods can be reused.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions