Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gapfillhelper edits and error corrections #7

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

freiburgermsu
Copy link

@freiburgermsu freiburgermsu commented Jul 2, 2022

Hello @cshenry !

Here are edits and error corrections of Gapfillinghelper, with a summary of the changes:

  1. custom Exception classes are relegated to a distinguished exceptions.py script, which is apart of the recent commits to main
  2. unused imports and variables are flagged
  3. the build_id functions were redundant and thus consolidated into build_id()
  4. set operations were leveraged to concisely acquire a unique collection of blacklist.
  5. variable names as Python keywords were renamed
  6. list comprehension simplifies and expedites for loops
  7. variable definitions are consolidated in-line
  8. both test_reaction_additions_againt_limits functions were unfinished, hence the inferred intention of the functions were complete (two functions with the same name may also not be able to be defined in Python).
  9. possibly erroneous function calls are flagged
  10. enumerate is leveraged to simplify and expedite indexing a list
  11. PEP-8 spacing in function parameters is introduced
  12. the undefined penalties dictionary is replaced with gapfilling_penalties, which is defined earlier in the build_model_extended_for_gapfilling function
  13. next is replaced with continue to fulfill the intended result of proceeding to the next iteration
  14. 1/0 logic is replaced with True/False logic
  15. an intermediary variable rxn is introduced for the repeated attribute call to improve the readability of mdl_extend_model_index_for_gapfilling
  16. intermediary variables that are only used once are removed for simplicity
  17. items() is leveraged to eliminate a nested loop
  18. redundant definitions of obj_coef in create_minimal_reaction_objective are removed
  19. a missing self object call is added to convert_cobra_compound_to_kbcompound
  20. max() and list comprehension succinctly determine a maximum
  21. a function call to KBaseFBAUtilities in replicate_model is commented since the function does not exist and thus this would throw an exception
  22. references to id as a function are replaced with calls to id as an attribute

I can elaborate or amend any edits at your request.

Thank you :)
Andrew

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant