Repository navigation
Remove deprecated petab.* aliases for petab.v1 - #538
Merged
Merged
Conversation
Accessing `petab.<name>` or importing `petab.<module>` has been deprecated in favor of `petab.v1` since 0.4.0. Remove the `__getattr__` fallback and the `sys.modules` aliases. The only top-level names left are `petab.v1`, `petab.v2`, `petab.ENV_NUM_THREADS` and `petab.__version__`. Everything else now raises `AttributeError` or `ModuleNotFoundError`. As a side effect, `import petab` no longer imports `petab.v1`. Removing the eager `petab.v1` import exposed a circular import between `petab.versions` and `petab.v1.yaml`. Fix it by importing `petab.v1` lazily in `get_major_version`. Also: * import `ENV_NUM_THREADS` in `petab.v1.parameter_mapping` from `petab` instead of defining it again * update tests, docstring cross-references, messages, README and the visualization notebook to use `petab.v1` * remove `test_problem_with_sbml_model`, which only differed from `test_get_condition_specific_models` by using the deprecated alias * add a changelog section for the unreleased 0.10.0 Generated with AI assistance. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dweindl
force-pushed
the
remove-petab-v1-shims
branch
from
October 12, 2026 09:39
23f0cd5 to
6e45519
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #538 +/- ##
==========================================
- Coverage 76.77% 76.67% -0.10%
==========================================
Files 67 67
Lines 7547 7516 -31
Branches 1346 1339 -7
==========================================
- Hits 5794 5763 -31
- Misses 1259 1262 +3
+ Partials 494 491 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
dweindl
marked this pull request as ready for review
October 12, 2026 09:59
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.
Accessing
petab.<name>or importingpetab.<module>has been deprecated in favor ofpetab.v1since 0.4.0 (July 2024). This removes the__getattr__fallback and thesys.modulesaliases frompetab/__init__.py. The only top-level names left arepetab.v1,petab.v2,petab.ENV_NUM_THREADSandpetab.__version__. Everything else now raisesAttributeErrororModuleNotFoundError. As a side effect,import petabno longer importspetab.v1.This is a breaking change for code that still uses the old paths. The fix is to replace
import petabwithimport petab.v1 as petabandfrom petab.<module> import ...withfrom petab.v1.<module> import ....Other changes:
petab.versionsandpetab.v1.yamlthat the old eagerpetab.v1import had been hiding.petab.v1.parameter_mappingnow importsENV_NUM_THREADSfrompetabinstead of defining it again.petab.v1.test_problem_with_sbml_model, which only differed fromtest_get_condition_specific_modelsby using the deprecated alias.Requires Benchmarking-Initiative/Benchmark-Models-PEtab#330: CI installs
benchmark_models_petabfrom master, which still importspetab.yaml.tests/v1/test_priors.pyfails until that PR is merged.🤖 Drafted with AI assistance (Claude Code)