Skip to content

imspy-simulation: depend on mzprov; fix the flaky GMM test that stopped CI - #487

Merged
theGreatHerrLebert merged 3 commits into
mainfrom
feat/mzprov-dependency
Sep 23, 2026
Merged

theGreatHerrLebert merged 3 commits into
mainfrom
feat/mzprov-dependency

Conversation

@theGreatHerrLebert

Copy link
Copy Markdown
Owner

Why CI on main didn't finish

After #486 merged, the Python 3.12 job failed in imspy-predictors on test_mixture.py::TestGaussianMixtureModel::test_fit (assert 1 > 1). Because that step failed, the imspy-simulation step never ran.

The test data was seeded, but the model's initial means were unseeded N(0, 1) draws. In about 4% of runs all three components collapsed into one cluster. I measured 8 of 200 with the current test, and 0 of 200 after this change. The fixture now starts the means at data points under a fixed seed.

mzprov is now a dependency

emit_provenance is on by default, but mzprov wasn't on PyPI, so a normal install silently skipped signing with a warning. mzprov 0.1.1 is published now:

  • imspy-simulation declares mzprov>=0.1.1. It needs only cryptography.
  • The three ImportError fallbacks are gone. Signing stays non-fatal: any error is logged and the run continues.
  • The out-of-date docstring claiming mzprov can't sign vendor .raw is removed.
  • CONFIGURATION.md says how to check an output: mzprov verify <output>.

Test

tests/test_mzprov_signing.py runs each vendor path's signer against mzprov's own fixture files and checks the result with mzprov's verifier:

  • .d and mzML, both as a sidecar file and embedded in the file
  • .raw
  • a signing failure does not fail the run

Locally, the GMM tests passed three times in a row. The new signing tests pass against these exact helper functions, but I loaded them in isolation, because the local imspy_connector build is older than main's. The full import runs in CI here.

test_fit started its means at unseeded N(0, 1) draws. In about 4% of runs
(8 of 200 measured) all three components collapsed into one cluster and
'assert 1 > 1' failed, which is what stopped the Python 3.12 job on main
after #486 and skipped the imspy-simulation suite. Start the means at data
points under a fixed seed: 0 of 200 runs collapse.
emit_provenance is on by default, but mzprov was not installable from PyPI,
so a normal install silently skipped signing with a warning. mzprov 0.1.1 is
now on PyPI: declare it, drop the ImportError fallbacks, and keep signing
non-fatal. The .raw docstring's claim that mzprov cannot sign vendor .raw is
out of date and goes.

test_mzprov_signing runs each vendor path's signer (.d and mzML, sidecar and
embedded; .raw) against mzprov's fixtures and checks the result with mzprov's
verifier.
mzprov 0.1.2 keeps new keys under ~/.config/mzprov/keys/ and uses an
existing ~/.config/timsim/keys/ key in place, so TimSim users keep their
signing identity. Require 0.1.2 and describe the default accordingly.
@theGreatHerrLebert
theGreatHerrLebert merged commit 3e869d6 into main Sep 23, 2026
5 checks 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.

1 participant