Skip to content

test: fix the strict XPASS on the FMPE shifted-data test - #1992

Merged
janfb merged 1 commit into
mainfrom
fix/vf-zscore-none-xfail
Aug 17, 2026
Merged

janfb merged 1 commit into
mainfrom
fix/vf-zscore-none-xfail

Conversation

@janfb

@janfb janfb commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Problem

CD is red on all four Python versions since #1921:

FAILED tests/linearGaussian_vector_field_test.py::test_fmpe_shifted_data_c2st[None-False]
  - [XPASS(strict)] No z-scoring fails

Cause

The case does not test "no z-scoring" any more.

  • The config layer drops None fields, because None is its "unset" sentinel.
  • Add VectorFieldEstimatorBuilder for FMPE / NPSE trainers #1921 changed the build_vector_field_estimator defaults for z_score_x and
    z_score_y from None to "independent". That change is correct. Without it, a
    default VectorFieldEstimatorBuilder() builds FMPE and NPSE with z-scoring off.
  • Together, posterior_flow_nn(z_score_theta=None) forwards nothing, and the new
    default applies. None now means "independent".

The case thus trains a fully z-scored FMPE, and it passes.

Fix

The case uses "none", which still disables z-scoring. The xfail stays valid: FMPE without z-scoring gives C2ST 0.61 on the shifted data, against 0.54 with z-scoring. The test id changes from [None-False] to [no_zscore].

No source change. The behavior of None is a separate decision, below.

For the per-model config work (GSoC PR 7.5 and PR 9)

No action in this PR. None needs a defined meaning before the conversion lands.

  • Today None means "independent" on all factories. The density factories behave this way since 0.26. For the vector-field factories it starts with Add VectorFieldEstimatorBuilder for FMPE / NPSE trainers #1921, which is not released.
  • With per-model configs and real defaults, the Literal check makes None raise. That gives three different behaviors in three releases.

My preference is that None keeps the meaning of "none" while the factories live, because z_score_parser always read the two values the same way. We can then drop Optional from those signatures at 1.0.

One test pins the decision either way: an explicitly disabled z-scoring must stay disabled after the build. That is the counterpart of the default-z-scoring test from July. The builder-versus-factory comparison in vf_builder_integration_test.py cannot see this class of change, because both paths moved together, and it goes away with the factory in PR 8.

Analysis done with Claude Code.

`posterior_flow_nn(z_score_theta=None)` does not disable z-scoring any more.
The config layer drops `None` fields as "unset", and #1921 changed the
`build_vector_field_estimator` default from `None` to "independent". The
parametrization thus trained a z-scored network, and the strict xfail became
an XPASS on all Python versions.

"none" disables z-scoring, so the case again tests what its id says. The xfail
stays valid: FMPE without z-scoring gives C2ST 0.61 on the shifted data.
@coderabbitai

coderabbitai Bot commented Aug 17, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e73796d1-826e-4048-946f-0c99bf9f80bf

📥 Commits

Reviewing files that changed from the base of the PR and between d8f8ddb and 4eab3b2.

📒 Files selected for processing (1)
  • tests/linearGaussian_vector_field_test.py

Included review availability: Your plan includes up to 3 reviews per rolling hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The FMPE shifted-data test now uses "none" to disable theta z-scoring. It also adds the no_zscore test ID and retains the expected-failure marker.

Changes

FMPE test configuration

Layer / File(s) Summary
Update no-z-score test case
tests/linearGaussian_vector_field_test.py
The test passes "none" instead of None, adds the no_zscore ID, and preserves the expected-failure reason.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 4eab3

This is a localized test-only update that explicitly selects the no-z-score case and adjusts its test identifier; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the test fix and the strict XPASS issue addressed by the pull request.
Description check ✅ Passed The description clearly explains the problem, cause, fix, test behavior, and related context, although it omits the template checklist and issue section.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/vf-zscore-none-xfail

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.15%. Comparing base (d8f8ddb) to head (4eab3b2).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1992      +/-   ##
==========================================
+ Coverage   88.20%   89.15%   +0.95%     
==========================================
  Files         140      140              
  Lines       14120    14120              
==========================================
+ Hits        12454    12589     +135     
+ Misses       1666     1531     -135     
Flag Coverage Δ
fast 84.13% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 29 files with indirect coverage changes

@janfb
janfb merged commit dbae9b6 into main Aug 17, 2026
20 checks passed
@janfb
janfb deleted the fix/vf-zscore-none-xfail branch August 17, 2026 11:57
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