fix: unblock bulk-reconstruct code path (biochem_db parens + dead print_json_debug_file) - #46
Open
jplfaria wants to merge 1 commit into
Open
fix: unblock bulk-reconstruct code path (biochem_db parens + dead print_json_debug_file)#46jplfaria wants to merge 1 commit into
jplfaria wants to merge 1 commit into
Conversation
…nt_json_debug_file) Two latent bugs along the compute_ontology_model_changes -> build_metabolic_model -> _add_reactions_from_gene_mapping path. Neither has an active call site in the existing KBase-wrapped flows (kb_build_metabolic_models guards them out in practice), but they are hard-blocking the modelseed-api bulk-reconstruct endpoint which calls these primitives directly per Chris's guidance. Bug 1: ms_reconstruction_utils.py:111 modelseeddb = self.biochem_db() biochem_db is a @Property (MSBiochemUtils, line 85), not a method. The parens call the returned ModelSEEDDatabase instance as a function and raise TypeError on the first reaction added via this path. Bug 2: ms_reconstruction_utils.py:379 + kb_model_utils.py:425, 600 self.print_json_debug_file(...) print_json_debug_file is referenced 3 times but defined nowhere in the active code (only in kb_model_utils.py.bak, which isn't loaded). Any call path through compute_ontology_model_changes or save-without-workspace AttributeErrors immediately. The debug hook was leftover from a refactor; drop the calls. Re-add via the proper debug interface if needed later. Verified end-to-end against poplar bulk_reconstruct (KO-annotated test genomes) once both fixes were applied: model build succeeds, reactions.csv + genes.csv populated, COBRA JSON written to workspace. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
jplfaria
force-pushed
the
fix/bulk-reconstruct-build-bugs
branch
from
July 21, 2026 22:11
cf91762 to
1907ecc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two latent bugs along the
compute_ontology_model_changes->build_metabolic_model->_add_reactions_from_gene_mappingpath. Neither has an active call site in the existing KBase-wrapped flows (kb_build_metabolic_modelsguards them out in practice), but they are hard-blocking the modelseed-api bulk-reconstruct endpoint which calls these primitives directly per the Phase 3 PRD path you'd suggested.Bug 1:
biochem_dbcalled as a functionsrc/kbutillib/ms_reconstruction_utils.py:111biochem_dbis a@property(MSBiochemUtils:85), not a method. The parens call the returnedModelSEEDDatabaseinstance as a function and raiseTypeError: 'ModelSEEDDatabase' object is not callableon the first reaction added via this path. Fix: drop the parens.Bug 2:
print_json_debug_filereferences with no definitionsrc/kbutillib/ms_reconstruction_utils.py:379,src/kbutillib/kb_model_utils.py:425, 600print_json_debug_fileis referenced 3 times but defined nowhere in the active code (only inkb_model_utils.py.bak, which isn't loaded). Any call path throughcompute_ontology_model_changesor save-without-workspaceAttributeErrors immediately. The debug hook was leftover from a refactor; this PR drops the three calls. Re-add via the proper debug interface if needed later.Verification
Verified end-to-end against poplar
/api/jobs/bulk_reconstruct(KO-annotated test genomes) once both fixes were applied locally: model build succeeds,reactions.csv+genes.csvpopulated, COBRA JSON written to workspace.🤖 Generated with Claude Code