Repository navigation
Export ObjectivePkg at top level so MSPackageManager can find it - #173
Merged
Merged
Conversation
MSPackageManager discovers packages from the top-level modelseedpy
namespace (inspect.getmembers(sys.modules["modelseedpy"])). ObjectivePkg is
exported from modelseedpy.fbapkg but was missing from the top-level import
list, so model.pkgmgr.getpkg("ObjectivePkg") raised
PackageError("Package ObjectivePkg does not exist!"). That breaks every
caller that sets an objective through the package manager, e.g. KBUtilLib's
MSFBAUtils.set_objective_from_string and run_fva.
Adds ObjectivePkg to the top-level fbapkg import, and a regression test that
every concrete *Pkg class exported by modelseedpy.fbapkg is also exported at
top level and that ObjectivePkg is listed by MSPackageManager.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
looks like simple styling complain will fix later. PR approved |
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.
Problem
MSPackageManagerdiscovers packages from the top-levelmodelseedpynamespace (inspect.getmembers(sys.modules["modelseedpy"]),fbapkg/mspackagemanager.py).ObjectivePkgis exported frommodelseedpy.fbapkgbut is missing from the top-level import list inmodelseedpy/__init__.py. So ondev:This breaks every caller that sets an objective through the package manager. For example, KBUtilLib's
MSFBAUtils.set_objective_from_stringandrun_fvasilently produced zero FVA rows againstdev. The released 0.4.2 line exports it, so this is a regression ondev.Fix
ObjectivePkgto the top-levelfrom modelseedpy.fbapkg import (...)list.tests/fbapkg/test_package_manager_exports.py, which asserts that every concrete*Pkgclass exported bymodelseedpy.fbapkgis also exported at top level, and thatObjectivePkgappears inMSPackageManager.list_available_packages().Verification
tests/fbapkg: 26 passed with the fix. Without it, the 24 pre-existing tests pass and the 2 new ones fail.MSPackageManager.get_pkg_mgr(e_coli_core).getpkg("ObjectivePkg")returns anObjectivePkg.🤖 Generated with Claude Code