nirs4all.api.native_refit_result module

Public, scoreless result of one fresh native Methods full refit.

Package V3 deliberately records a new REFIT artifact rather than copying the parent CV/SELECT score set. This result therefore exposes identity-bound PREDICT replay and its durable child package, but never invents a new cross-validation score or a legacy workspace projection.

class nirs4all.api.native_refit_result.NativeMethodsRefitResult(package: Any, *, methods_library_path: str | None, dagml_module: str, decoder: Callable[[Any, Any], ndarray])[source]

Bases: object

A detached V3 child with explicit-identity native prediction only.

export(output_path: str | Path, *, archive_id: str | None = None, core_module: str = 'nirs4all_core', **kwargs: Any) → Path[source]

Write a strict Core Archive V3 without any legacy bundle fallback.

DAG-ML assembles the exact V3 semantic closure from this child package. Core alone writes and validates the ZIP container. The optional archive_id is passed to the DAG-ML assembler; a deterministic, portable identifier is used when it is omitted.

classmethod from_package_json(package_json: str, *, methods_library_path: str | None = None, dagml_module: str = 'dag_ml', decoder: Callable[[Any, Any], ndarray] | None = None) → NativeMethodsRefitResult[source]

Load and strictly validate a detached V3 package JSON payload.

classmethod load_archive(path: str | Path, *, methods_library_path: str | None = None, dagml_module: str = 'dag_ml', decoder: Callable[[Any, Any], ndarray] | None = None, core_module: str = 'nirs4all_core') → NativeMethodsRefitResult[source]

Load a Core-validated Archive V3, then strictly parse Package V3.

classmethod load_package(path: str | Path, *, methods_library_path: str | None = None, dagml_module: str = 'dag_ml', decoder: Callable[[Any, Any], ndarray] | None = None) → NativeMethodsRefitResult[source]

Load one explicit Package V3 JSON file for native PREDICT replay.

property package: Any

The exact DAG-ML Package V3 child returned by native REFIT.

package_json() → str[source]

Return the strict, self-fingerprinted Package V3 JSON payload.

predict(X: Any, *, sample_ids: Any, groups: Any = None, metadata: Any = None) → PredictResult[source]

Run scheduler-owned PREDICT from a V3 native Methods child.

Native N4MM/N4ME states and the closed native PLS RolePipeline retain their original controller identities, with no host model conversion.

sample_ids are mandatory. No positional IDs, source estimator, Python model or host-sidecar is used by this operation.

save_package(path: str | Path) → Path[source]

Persist the signed V3 package without invoking a legacy exporter.

This is intentionally a Package V3 JSON file, not an Archive V3 container. Core remains the owner of archive containers and their publication policy. Existing paths are refused and a failed write is removed, so callers never receive a partially written replacement.