Skip to content

Codex/modernize baseline#20

Merged
DylanAdlard merged 15 commits into
mainfrom
codex/modernize-baseline
Jun 3, 2026
Merged

Codex/modernize baseline#20
DylanAdlard merged 15 commits into
mainfrom
codex/modernize-baseline

Conversation

@philipwfowler

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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__.py and switches version resolution to prefer the local VERSION file 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 thread setup.cfg
Comment on lines +35 to 37
md =
MDAnalysis
freesasa
Comment thread setup.cfg
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."
Comment thread tests/test_trajectorydihedrals.py
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@DylanAdlard DylanAdlard left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some valid suggestions by copilot to do lazy loading of freesasa and biopython (as now doing for mda)

@DylanAdlard DylanAdlard merged commit 7f0ae88 into main Jun 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants