Codex/modernize baseline#20
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Modernizes sbmlcore’s baseline by reducing import-time heaviness, making MDAnalysis-based functionality optional via extras, strengthening CI installation of external tools (DSSP/stride), and adding targeted tests to lock in the new import/version behavior.
Changes:
- Introduces lazy top-level exports in
sbmlcore/__init__.pyand switches version resolution to prefer the localVERSIONfile with metadata fallback. - Makes MDAnalysis an optional dependency via extras and updates MDAnalysis-dependent modules/tests to import/skip more gracefully.
- Updates CI workflows to build/install DSSP/stride reliably and improves subprocess test diagnostics.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_trajectorydistances.py | Relaxes DataFrame equality tolerances for trajectory distance outputs. |
| tests/test_trajectorydihedrals.py | Skips dihedrals tests when MDAnalysis is unavailable (module-level). |
| tests/test_modernization.py | Adds tests for lightweight top-level import and ResidueDepth offset behavior. |
| tests/test_dssp.py | Improves DSSP/stride failure diagnostics by capturing stdout/stderr. |
| setup.cfg | Raises minimum Python version and reorganizes dependencies into extras. |
| sbmlcore/TrajectoryDistances.py | Defers MDAnalysis import and adds a guard when no frames match time range. |
| sbmlcore/TrajectoryDihedrals.py | Defers MDAnalysis import in multiple code paths. |
| sbmlcore/TempFactors.py | Defers MDAnalysis import behind a helper. |
| sbmlcore/StructuralDistances.py | Defers MDAnalysis import behind a helper. |
| sbmlcore/ResidueDepth.py | Ensures segids is derived from offsets when offsets are provided. |
| sbmlcore/AminoAcidProperties.py | Replaces pkg_resources usage with importlib.resources. |
| sbmlcore/init.py | Implements lazy attribute exports and version resolution logic. |
| .github/workflows/tests.yaml | Updates DSSP/stride install steps and uses .[dev] for test deps. |
| .github/workflows/pypi.yaml | Mirrors workflow updates for release pipeline build/test steps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+90
to
91
| filename = files("sbmlcore").joinpath("data/rogov.csv") | ||
| self.lookup = pandas.read_csv(filename) |
|
|
||
| sbmlcore = importlib.import_module("sbmlcore") | ||
|
|
||
| assert sbmlcore.__version__ == "0.2.8" |
Comment on lines
+35
to
37
| md = | ||
| MDAnalysis | ||
| freesasa |
Comment on lines
+38
to
+40
| bio = | ||
| biopython | ||
| dev = |
| else: | ||
| distance_array = numpy.concatenate([distance_array, distances]) | ||
|
|
||
| assert not first_pass, "No trajectory frames matched the requested time range." |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
DylanAdlard
approved these changes
Jun 3, 2026
DylanAdlard
left a comment
Collaborator
There was a problem hiding this comment.
Some valid suggestions by copilot to do lazy loading of freesasa and biopython (as now doing for mda)
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.
No description provided.