LC2ST_NF subclasses LC2ST, but its evaluation methods have a different contract. In LC2ST, theta_o are posterior samples at x_o. In LC2ST_NF, evaluation runs in the flow's base space on samples drawn once in __init__. The class docstring says so: no theta_o is passed to the evaluation functions.
The five overrides (get_scores, get_statistic_on_observed_data, p_value, reject_test, get_statistics_under_null_hypothesis) therefore drop theta_o. Pyright flags them under reportIncompatibleMethodOverride, see #1979.
A signature patch does not fix this. #1984 tried it: theta_o becomes an ignored parameter, x_o needs a None default plus a guard, and positional x_o calls break. We dropped that part of the PR.
The fix is structural. I see two options:
- Composition:
LC2ST_NF holds an LC2ST and exposes its own (x_o, ...) API.
- A shared private base for the training and null machinery.
LC2ST and LC2ST_NF each define their own public evaluation methods on top.
Both change the public hierarchy, isinstance(lc2st_nf, LC2ST) stops being true, so this needs a deprecation note.
LC2ST_NFsubclassesLC2ST, but its evaluation methods have a different contract. InLC2ST,theta_oare posterior samples atx_o. InLC2ST_NF, evaluation runs in the flow's base space on samples drawn once in__init__. The class docstring says so: notheta_ois passed to the evaluation functions.The five overrides (
get_scores,get_statistic_on_observed_data,p_value,reject_test,get_statistics_under_null_hypothesis) therefore droptheta_o. Pyright flags them underreportIncompatibleMethodOverride, see #1979.A signature patch does not fix this. #1984 tried it:
theta_obecomes an ignored parameter,x_oneeds aNonedefault plus a guard, and positionalx_ocalls break. We dropped that part of the PR.The fix is structural. I see two options:
LC2ST_NFholds anLC2STand exposes its own(x_o, ...)API.LC2STandLC2ST_NFeach define their own public evaluation methods on top.Both change the public hierarchy,
isinstance(lc2st_nf, LC2ST)stops being true, so this needs a deprecation note.