Repository navigation
Conversation
Preventing the Celery task from crashing with RuntimeError when
reconstructed model has no bio1 biomass reaction. Instead return a
structured {status: failed} result consistent with the mdlutl-is-None
guard. Also adds bio* fallback before giving up.
Closes ModelSEED/modelseed-api-ops#35
Mirror the tasks.py fix: if bio1 is missing fall back to any bio* reaction so cobra does not raise invalid objective. Refs ModelSEED/modelseed-api-ops#35
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.
Fixes ModelSEED/modelseed-api-ops#35\n\n## Root cause\n\nThe reconstruct Celery task raised RuntimeError when the built model had no bio1 biomass reaction (line 747, tasks.py). This made the Celery task fail with an exception, causing failure_watcher to file a bug - even though this is a user-input condition.\n\n## Changes\n\n- tasks.py: replace raise RuntimeError with a structured return dict (consistent with the mdlutl-is-None guard at line 679)\n- job_scripts/reconstruct.py: add bio1/bio* guard before setting the objective (was a bare unguarded assignment)\n- tests/unit/test_reconstruct_bio1_guard.py: unit tests for the guard logic\n\n## Prior art\n\nIssue 23 in modelseed-api-ops hit the same error; branch auto-triage/issue-23-bio1-objective-missing (PR 4) was never merged.