Suppose two source packets contain exactly the same four values but different claimed positions:
x = [1, 0, -1, 0]One packet says t = [10, 11, 12.25, 13]. Another says t = [10, 11, 12, 13]. Their first two timestamps are identical. If both are passed directly to scipy.signal.resample(x, 8, t=...), SciPy 1.17.0 documents a behavior that should make a numerical maintainer uncomfortable if physical time coordinates matter: t needs to contain at least the first two input timestamps, and every later timestamp is ignored when constructing the output grid. The returned timestamps use t[0], T = t[1] - t[0], the original sample count, and the requested output count.
So a smooth returned waveform and a plausible half-second grid are not evidence that the original positions were uniformly spaced. They are evidence that the Fourier resampling operation completed under the interval inferred from the first pair.
This article qualifies a different object: one complete, ordered, timestamped source record whose physical coordinates have been admitted before Fourier resampling, followed by separate reconciliation of the returned grid. The controlled scope is one-dimensional, finite, real float64 NumPy arrays on CPU, numeric seconds, axis=0, window=None, domain='time', four source samples and eight requested output samples.
Laboratory status: EXPECTED / NOT EXECUTED. The fixture below has not been represented as an observed SciPy run. Every evidence record therefore starts with executed=false and observed=null. Documented behavior, analytic expectations and application-owned admission policy remain separate throughout.
Define the signal and timing contract
The baseline record has four immutable source identities, S0 through S3, paired with values and positions:
Evidence status | ID | x | t_seconds |
EXPECTED source fixture | S0 | 1.0 | 10.0 |
EXPECTED source fixture | S1 | 0.0 | 11.0 |
EXPECTED source fixture | S2 | -1.0 | 12.0 |
EXPECTED source fixture | S3 | 0.0 | 13.0 |
The approved sampling interval is exactly 1.0 second, num=8, and the synthetic numerical model is one cosine cycle over a four-second periodic interval. The model is deliberately simple: at sample-index phases 0, π/2, π, 3π/2, the values are [1, 0, -1, 0]. This model supplies an analytic numerical oracle; it does not prove that any real sensor signal is cosine-like, periodic, correctly timestamped or physically valid.
Ownership matters. The acquisition owner supplies the ordered sample IDs, their positions and the fact that the unit is seconds. The numerical owner approves the sampling interval and identifies the periodic model under which Fourier resampling is admissible. The transformation owner checks those facts before calling SciPy. A consumer later verifies that published values remain paired with the qualified output coordinates.
That is a different contract from pandas time-window membership validation, where the central question is which events belong to which aggregation bins. The Refonte article on pandas explicitly treats boundary allocation and aggregate membership; this fixture instead qualifies the coordinates of signal samples before a Fourier-domain transformation.
Separate an acquired sample from a periodic boundary
The acquired source positions are 10, 11, 12, 13. The source record span, measured from the first acquired coordinate to the last, is three seconds. The authorized periodic duration is four seconds because the model advances one second per sample across four phases. Time 14 is therefore the next-cycle boundary, not an acquired fifth sample.
Those quantities should not be collapsed into one “duration.” Likewise, the eight-sample output grid extends from 10 through 13.5; it does not include the next-cycle boundary at 14.
Equal first and last acquired values are neither required by this fixture nor a general test of physical periodicity. SciPy documents resample as a Fourier method that assumes a periodic signal and equidistant input samples. Periodicity is a model assumption to approve, not something established merely because an endpoint happens to resemble another value.
Freeze the numerical environment and source packet
The documentation baseline is SciPy 1.17.0 for scipy.signal.resample, scipy.signal.resample_poly and scipy.interpolate.CubicSpline, together with the NumPy 2.3 documentation series for diff, linspace and isfinite. These manuals were accessed November 30, 2026. No publication date is inferred from the versioned pages, and these versions are not described here as “the latest.”
A later executed qualification must record the actual interpreter, exact installed SciPy version, exact installed NumPy patch version, operating system and platform details. The research date is not an execution timestamp. Likewise, “NumPy 2.3 documentation” is not permission to invent a patch such as 2.3.x in an evidence manifest.
The numerical profile is intentionally narrow:
axis = 0
window = None
domain = "time"
dtype = np.float64
backend = "NumPy"
device = "CPU"The complete SciPy call under qualification is:
scipy.signal.resample(
x,
num,
t=t,
axis=0,
window=None,
domain="time",
)SciPy 1.17.0 documents axis=0, window=None and domain='time' as the relevant defaults and describes the input as equidistant samples.
Keep a pristine packet before any diagnostic mutation:
SOURCE_PACKET = {
"source_revision": "synthetic-cosine-four-v1",
"sample_ids": ["S0", "S1", "S2", "S3"],
"x": [1.0, 0.0, -1.0, 0.0],
"t_seconds": [10.0, 11.0, 12.0, 13.0],
"units": "s",
"approved_interval_seconds": 1.0,
"model_id": "cosine-cycle-4s-v1",
"num": 8,
}Every case below begins from its own independent packet. R02 does not mutate R01, R03 does not inherit R02, and a rejected record never becomes the source for another case.
Any future execution manifest belongs beside, not inside, the research assumptions. It must describe what actually ran and retain the exact source bytes or a digest of those bytes.
Write the literal waveform and grid oracles
Define
For one cosine cycle represented by four source phases and evaluated at eight equally spaced phases, the independently authored expected value vector is:
Y1 = [
1,
sqrt(2)/2,
0,
-sqrt(2)/2,
-1,
-sqrt(2)/2,
0,
sqrt(2)/2
]Numerically:
q = np.sqrt(2.0) / 2.0
Y1 = np.array(
[1.0, q, 0.0, -q, -1.0, -q, 0.0, q],
dtype=np.float64,
)The baseline coordinate oracle is:
G1 = np.array(
[10.0, 10.5, 11.0, 11.5, 12.0, 12.5, 13.0, 13.5],
dtype=np.float64,
)Two other fixed coordinate expectations are needed:
G2 = np.array(
[10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0],
dtype=np.float64,
)
G3 = np.array(
[110.0, 110.5, 111.0, 111.5,
112.0, 112.5, 113.0, 113.5],
dtype=np.float64,
)These are not arrays copied from SciPy. They follow from the approved synthetic model and the documented time-grid expression.
For this fixture, amplitude reconciliation uses rtol=0 and atol=1e-12. That tolerance is scoped to these small float64 values; it is not a universal signal-processing threshold. Coordinate comparisons for G1, G2 and G3 are exact because every expected coordinate is a small integer or dyadic half represented exactly in binary floating point.
SciPy 1.17.0 specifies the returned coordinate expression as
t[0] + (t[1] - t[0]) n_x / num arange(num),with n_x the original sample count. With four source samples and eight outputs, a first interval of one second produces 0.5-second output spacing; a first interval of two seconds produces one-second spacing.
Keep the timing oracle independent of SciPy
Do not generate Y1 by making another call to resample. That would make the expected result depend on the same implementation under qualification.
The amplitude oracle instead comes from the literal analytic cycle cos(2πk/8) for k=0…7. The timing oracles come from rational arithmetic applied to the documented grid rule. G1 and G3 advance by 1/2 second; G2 advances by one second.
A second SciPy run can be useful diagnostic information, but agreement between two executions of the same implementation is not independent evidence.
This is also why the problem should not be conflated with preserving original FFT length metadata. That Refonte workflow addresses reconstruction ambiguity after a real FFT. Here num=8 is deliberately commissioned: we are changing sample count and qualifying the physical coordinates attached to the new representation.
Establish the qualified baseline
R01 is the primary admitted fixture:
x = [1, 0, -1, 0]
t = [10, 11, 12, 13]
approved interval = 1 second
model = cosine-cycle-4s-v1
num = 8NumPy diff defines each first difference as a[i+1] - a[i], so the complete interval oracle is [1, 1, 1]. The guarded call is expected to execute exactly once and, if SciPy 1.17.0 conforms to the cited contract for this fixture, produce coordinates G1 and values Y1.
Evidence status: EXPECTED / NOT EXECUTED
Output index | Expected t | Expected y |
0 | 10.0 | 1 |
1 | 10.5 | √2/2 |
2 | 11.0 | 0 |
3 | 11.5 | -√2/2 |
4 | 12.0 | -1 |
5 | 12.5 | -√2/2 |
6 | 13.0 | 0 |
7 | 13.5 | √2/2 |
R07 changes only an authorized origin:
t = [110, 111, 112, 113]
approved interval = 1 second
model = cosine-cycle-4s-v1Its interval oracle remains [1,1,1], its expected amplitude array remains Y1, and its coordinate oracle is G3. That distinction is useful: the Fourier amplitudes are indexed by the same four-value cycle, while the returned physical labels shift by 100 seconds because t[0] changed.
A readable source comparison is:
Evidence status | Case | Source positions | Δt | Expected grid |
EXPECTED | R01 | [10,11,12,13] | [1,1,1] | G1 |
EXPECTED | R07 | [110,111,112,113] | [1,1,1] | G3 |
The executable fixture should fail explicitly rather than relying on assert, which can be disabled under Python optimization:
def require(condition: bool, message: str) -> None:
if not condition:
raise RuntimeError(message)
def check_expected_output(y, t_out, expected_y, expected_t) -> None:
require(
np.allclose(y, expected_y, rtol=0.0, atol=1e-12),
"value oracle mismatch",
)
require(
np.array_equal(t_out, expected_t),
"coordinate oracle mismatch",
)An executed R01 would establish only that the admitted packet passed this wrapper's policy and that the observed SciPy result reconciled with these literal oracles under the recorded runtime. It would not authenticate the timestamps, prove sensor acquisition quality, synchronize a clock, or establish physical periodicity.
Change later timestamps without changing the waveform
Now hold x=[1,0,-1,0], the first pair [10,11] and num=8 fixed while changing only later timestamp metadata.
The four direct diagnostic cases are:
Evidence status | Case | t supplied directly | Full interval oracle | Direct expected result |
EXPECTED | R02 | [10,11,12.25,13] | [1,1.25,0.75] | G1 / Y1 |
EXPECTED | R03 | [10,11,13,14] | [1,2,1] | G1 / Y1 |
EXPECTED | R04 | [10,11,11,13] | [1,0,2] | G1 / Y1 |
EXPECTED | R05 | [10,11,9,13] | [1,-2,4] | G1 / Y1 |
Why should all four bypass calls return the same coordinates? Because SciPy 1.17.0 documents that, once t is present, it needs at least the first two timestamps and ignores all later positions when determining the output grid. All four cases preserve t[0]=10 and t[1]=11; therefore their documented proposed grid is G1.
The same x is also passed in every case, so the Fourier data operand is unchanged. Under this documented contract, Y1 remains the analytic expectation.
That is precisely the diagnostic trap. R02 through R05 contain respectively a nonuniform interval, a larger internal gap, a duplicate position and a backward step. A returned G1/Y1 cannot certify any of them as uniformly sampled.
The application wrapper therefore takes a different path. It examines every source position before SciPy is eligible to run. R02–R05 each receive REJECT_TIMEBASE under the one-second policy, with:
expected diagnostic_calls = 1
expected guarded_resample_calls = 0The diagnostic call is intentionally outside the admission boundary. It demonstrates API behavior. It is not a publication candidate.
Track the first rejected interval
A useful rejection record should preserve the entire original timestamp array and name the first violating adjacent pair.
For R02, for example:
{
"case_id": "R02",
"decision": "REJECT_TIMEBASE",
"original_t": [10.0, 11.0, 12.25, 13.0],
"interval_oracle": [1.0, 1.25, 0.75],
"first_violation": {
"left_sample_id": "S1",
"right_sample_id": "S2",
"left_t": 11.0,
"right_t": 12.25,
"actual_interval": 1.25,
"approved_interval": 1.0
}
}R04's duplicate coordinate and R05's negative interval deserve equally explicit evidence. np.diff is appropriate because its documented first-difference operation examines every adjacent pair in order.
Do not sort timestamps as an automatic repair. If sample identities and values are not reordered under an independently approved acquisition record, sorting positions alone destroys the original pairings. Even sorting whole (t,x) pairs would create a different ordered source record and still would not prove that the resulting coordinates were the measurements that should have existed.
Change the first interval and compare two source records
R06 moves the first interval as well:
R06
x = [1,0,-1,0]
t = [10,12,13,14]
intervals = [2,1,1]
approved interval = 1 secondThe direct diagnostic uses t[0]=10 and t[1]=12, so T=2. With n_x=4 and num=8, the documented output spacing is 2 * 4 / 8 = 1 second. The direct expected coordinate array is therefore G2, while the amplitude expectation remains Y1.
Under the original one-second source contract, however, R06 is REJECT_TIMEBASE. The wrapper must make zero guarded resample calls.
Now compare R11:
R11
x = [1,0,-1,0]
t = [10,12,14,16]
intervals = [2,2,2]
approved interval = 2 seconds
model = cosine-cycle-8s-v1
num = 8Here the complete interval ledger agrees with the approved two-second spacing. The periodic model is separately defined as one four-sample cycle over eight seconds. The guarded call is therefore admissible and expected to return G2/Y1 in one invocation.
Evidence status: EXPECTED / NOT EXECUTED
Case | S0 | S1 | S2 | S3 | Δt | Policy | Decision |
R06 | 10 | 12 | 13 | 14 | [2,1,1] | 1 s | REJECT_TIMEBASE |
R11 | 10 | 12 | 14 | 16 | [2,2,2] | 2 s | ACCEPT_BOUNDED |
Explain why matching output grids cannot qualify input timing
R06 and R11 can propose the same returned coordinate array G2 and the same value array Y1 through an unguarded call. Yet their source ledgers answer different physical questions.
R06 claims unequal elapsed times between successive values. R11 claims a uniform two-second interval. The result array contains no reverse encoding of the ignored later timestamps that would let a consumer reconstruct which source ledger was supplied.
Acceptance therefore comes from independent source evidence: units, all coordinates, all adjacent intervals, an approved interval and an approved periodic model. The returned grid is reconciled afterward.
This separation between index-space quantities and physical spacing has an analogue in sample spacing in SciPy peak validation: that Refonte article distinguishes the numerical selection policy around sample positions from assumptions a caller might otherwise attach to them. It is a different problem, but the discipline is similar: do not let an API parameter list silently stand in for an application-owned interpretation.
The strongest regression test here is not “does resample return sensible numbers?” It is “can I change ignored timestamp metadata while holding the values and first pair fixed, obtain the same proposed result, and still have the admission gate reject the malformed source?” R02–R06 make that contract falsifiable.
Test the API's two-timestamp shortcut
R08 supplies only:
x = [1,0,-1,0]
t = [10,11]
num = 8This is not described here as invalid SciPy input. SciPy 1.17.0 explicitly says that when t is supplied it must contain at least the first two timestamps of x; all others are ignored.
Therefore the direct diagnostic expectation is G1/Y1.
The application contract is intentionally stricter. Its accepted object is a complete source record with one position for each acquired sample. R08 cannot demonstrate the coordinates for S2 and S3, so the wrapper returns:
decision = HOLD_PROVENANCE
expected guarded_resample_calls = 0This is not REJECT_TIMEBASE, because no known irregular interval has been established. The evidence is incomplete rather than contradictory.
That distinction matters operationally. A REJECT_TIMEBASE record says, “we possess enough coordinate evidence to identify a violation.” HOLD_PROVENANCE says, “the required evidence is absent from this packet.”
If a trusted ledger elsewhere contains the full positions, that ledger may be joined to the source packet only under an owned provenance process; then all positions must be checked before resampling. The fact that SciPy can construct a return grid from two coordinates does not mean two coordinates satisfy this publication policy.
A useful decision record therefore preserves the reason:
{
"case_id": "R08",
"decision": "HOLD_PROVENANCE",
"reason": "full source position coverage required: 2 positions for 4 samples",
"diagnostic_calls": 1,
"guarded_resample_calls": 0,
"executed": false,
"observed": null
}The short form of the t argument is an API capability. Complete timestamp qualification is an application requirement layered above it.
Catch endpoint relabeling and nonfinite source positions
R09 starts with the valid R01 source packet. It passes source admission and is expected to make one guarded call producing G1/Y1.
Then a downstream step deliberately discards the qualified coordinates and substitutes:
wrong_grid = np.linspace(10.0, 13.0, 8)The independent wrong-grid oracle is:
[10,
73/7,
76/7,
79/7,
82/7,
85/7,
88/7,
13]NumPy 2.3 documents linspace(start, stop, num) as returning evenly spaced samples across the closed interval when endpoint=True, which is the default. It also documents that endpoint exclusion changes the spacing. Eight points from 10 through 13 therefore have spacing 3/7, not the half-second spacing required by G1.
R09 is not a failed source admission. The source was qualified; the candidate's coordinates were later replaced. The publication decision is:
REJECT_MISLABELED_OUTPUTThe correct coordinates remain G1. Replacing them with a visually convenient inclusive endpoint grid changes the physical labels attached to the resampled values.
R10 tests a different defect:
t = [10,11,NaN,13]Because the first pair is still [10,11], the direct bypass diagnostic is expected under the documented resample rule to propose G1/Y1; the later NaN is among the positions documented as ignored for output timestamp generation.
The wrapper must reject the source before interval arithmetic. NumPy isfinite tests values element-wise for being neither infinity nor NaN. The policy checks finiteness of both x and every supplied position before np.diff.
R10 therefore receives REJECT_TIMEBASE with zero guarded invocations.
A finite output grid does not rehabilitate a nonfinite original coordinate. That would confuse the coordinates SciPy used to synthesize its return grid with the coordinates the producer claimed for the complete source record.
Reject inadmissible packets before Fourier resampling
The wrapper below is a complete reusable fixture for this bounded laboratory. It preserves input order, requires full coordinate coverage, checks all source values before invoking SciPy and uses dependency injection so guarded calls can be counted independently.
from dataclasses import dataclass
from typing import Any, Callable
import numpy as np
from scipy.signal import resample
ACCEPT_BOUNDED = "ACCEPT_BOUNDED"
REJECT_TIMEBASE = "REJECT_TIMEBASE"
REJECT_MISLABELED_OUTPUT = "REJECT_MISLABELED_OUTPUT"
HOLD_PROVENANCE = "HOLD_PROVENANCE"
HOLD_MODEL = "HOLD_MODEL"
REBUILD_FROM_TRUSTED_SOURCE = "REBUILD_FROM_TRUSTED_SOURCE"
APPROVED_MODELS = {
"cosine-cycle-4s-v1": {
"approved_interval_seconds": 1.0,
"period_seconds": 4.0,
},
"cosine-cycle-8s-v1": {
"approved_interval_seconds": 2.0,
"period_seconds": 8.0,
},
}
@dataclass(frozen=True)
class Packet:
case_id: str
source_revision: str
sample_ids: tuple[str, ...]
x: tuple[float, ...]
t_seconds: tuple[float, ...]
units: str
approved_interval_seconds: float
model_id: str | None
num: int
@dataclass
class CallCounter:
calls: int = 0
def wrap(self, fn: Callable[..., Any]) -> Callable[..., Any]:
def counted(*args, **kwargs):
self.calls += 1
return fn(*args, **kwargs)
return counted
def decision(
code: str,
reason: str,
,
diagnostic_calls: int,
guarded_resample_calls: int,
expected_t=None,
expected_y=None,
):
return {
"decision": code,
"reason": reason,
"diagnostic_calls": diagnostic_calls,
"guarded_resample_calls": guarded_resample_calls,
"expected_t": expected_t,
"expected_y": expected_y,
"executed": False,
"observed": None,
}
def validate_packet(packet: Packet) -> tuple[str | None, str | None, np.ndarray | None]:
if packet.units != "s":
return HOLD_PROVENANCE, "numeric seconds units are required", None
if isinstance(packet.num, (bool, np.bool_)) or not isinstance(
packet.num, (int, np.integer)
):
return HOLD_PROVENANCE, "num must be a positive integer excluding bool", None
if packet.num <= 0:
return HOLD_PROVENANCE, "num must be positive", None
x = np.asarray(packet.x, dtype=np.float64)
t = np.asarray(packet.t_seconds, dtype=np.float64)
if x.ndim != 1 or t.ndim != 1:
return HOLD_PROVENANCE, "one-dimensional x and t are required", None
if x.size < 2:
return HOLD_PROVENANCE, "at least two source samples are required", None
if len(packet.sample_ids) != x.size:
return HOLD_PROVENANCE, "sample ID coverage must match x", None
if t.size != x.size:
return (
HOLD_PROVENANCE,
f"full position coverage required: {t.size} positions for {x.size} samples",
None,
)
if not np.all(np.isfinite(x)):
return HOLD_PROVENANCE, "all source values must be finite", None
# Position finiteness is checked before np.diff.
if not np.all(np.isfinite(t)):
return REJECT_TIMEBASE, "all source positions must be finite", None
interval = float(packet.approved_interval_seconds)
if not np.isfinite(interval) or interval <= 0.0:
return HOLD_MODEL, "approved interval must be finite and positive", None
if packet.model_id is None or packet.model_id not in APPROVED_MODELS:
return HOLD_MODEL, "approved periodic model identity is required", None
model = APPROVED_MODELS[packet.model_id]
if interval != model["approved_interval_seconds"]:
return HOLD_MODEL, "model interval does not match packet interval", None
dt = np.diff(t)
# Exact spacing is intentional for this synthetic fixture.
if not np.all(dt == interval):
bad = int(np.flatnonzero(dt != interval)[0])
return (
REJECT_TIMEBASE,
(
f"interval violation between {packet.sample_ids[bad]} and "
f"{packet.sample_ids[bad + 1]}: "
f"{dt[bad]!r} != {interval!r}"
),
dt,
)
return None, None, dt
def guarded_resample(
packet: Packet,
,
resample_fn: Callable[..., Any] = resample,
counter: CallCounter | None = None,
):
code, reason, dt = validate_packet(packet)
if code is not None:
return {
"decision": code,
"reason": reason,
"intervals": None if dt is None else dt.copy(),
"guarded_resample_calls": 0 if counter is None else counter.calls,
"candidate": None,
}
x = np.asarray(packet.x, dtype=np.float64)
t = np.asarray(packet.t_seconds, dtype=np.float64)
fn = resample_fn if counter is None else counter.wrap(resample_fn)
y, t_out = fn(
x,
packet.num,
t=t,
axis=0,
window=None,
domain="time",
)
return {
"decision": ACCEPT_BOUNDED,
"reason": "source admitted; output still requires oracle reconciliation",
"intervals": dt.copy(),
"guarded_resample_calls": 1 if counter is None else counter.calls,
"candidate": {
"y": np.asarray(y, dtype=np.float64),
"t_seconds": np.asarray(t_out, dtype=np.float64),
},
}
def reconcile_candidate(candidate, expected_y, expected_t):
y = candidate["y"]
t_out = candidate["t_seconds"]
if not np.allclose(y, expected_y, rtol=0.0, atol=1e-12):
return REJECT_MISLABELED_OUTPUT, "resampled value oracle mismatch"
if not np.array_equal(t_out, expected_t):
return REJECT_MISLABELED_OUTPUT, "resampled coordinate oracle mismatch"
return ACCEPT_BOUNDED, "value and coordinate oracles reconciled"
def validate_export_coordinates(export_t, qualified_t):
export_t = np.asarray(export_t, dtype=np.float64)
qualified_t = np.asarray(qualified_t, dtype=np.float64)
if not np.array_equal(export_t, qualified_t):
return (
REJECT_MISLABELED_OUTPUT,
"exported coordinates differ from qualified resample coordinates",
)
return ACCEPT_BOUNDED, "export coordinates preserved"The exact dt == interval comparison is intentional only because this laboratory uses small exactly representable seconds. Real acquisition systems often need tolerances. Such a tolerance must be justified in physical units from an owned clock/acquisition specification. It should not appear as an unexplained rtol against large absolute timestamps.
Count diagnostic calls separately from guarded calls
A diagnostic bypass should have its own counter:
diagnostic_counter = CallCounter()
guarded_counter = CallCounter()
diagnostic_resample = diagnostic_counter.wrap(resample)
# Bypass experiment:
# diagnostic_resample(x, 8, t=t, axis=0, window=None, domain="time")
# Admission-controlled experiment:
# guarded_resample(packet, resample_fn=resample, counter=guarded_counter)For R02, for example, the expected evidence is diagnostic_calls=1 and guarded_resample_calls=0. Do not merge those into total_calls=1 and imply the rejected packet crossed the guard.
Because this article is not reporting an executed laboratory, the call counts in the ledger are expectations, not observations.
The preservation rule echoes the narrower principle in source-preserving data cleaning in Python: retain the raw source and record transformations rather than overwriting evidence until only the cleaned candidate remains. The linked article applies that principle to a broader pandas workflow; here it is used only to keep source timestamp evidence intact.
Keep periodic-model approval separate from clock regularity
R12 deliberately separates “regular timestamps” from “approved Fourier model”:
x = [0,1,2,3]
t = [10,11,12,13]
intervals = [1,1,1]
model_id = nullThe timestamp ledger is regular. Nothing in [1,1,1] establishes, however, that this four-value sequence should be interpreted as one period of a periodic signal. SciPy documents resample as requiring the assumption of a periodic signal as well as equidistant samples.
The application decision is therefore:
HOLD_MODEL
guarded_resample_calls = 0
candidate = nullThis does not claim that a ramp is intrinsically unusable or that SciPy would throw an exception. No candidate call is made. The missing item is numerical authorization for this transformation contract.
Changing methods is a separate decision. SciPy 1.17.0 documents resample_poly as upsampling by up, applying a zero-phase low-pass FIR filter, then downsampling by down; it also exposes boundary-extension behavior through padtype. Those are different numerical and boundary assumptions. Switching to resample_poly does not itself examine and approve every timestamp in an irregular source ledger.
Likewise, an explicit-coordinate interpolation workflow can be commissioned separately. For example, SciPy 1.17.0 documents CubicSpline with a one-dimensional independent coordinate array that must be real, finite and strictly increasing, while dependent values must be finite and match the coordinate length along the interpolation axis. That is relevant when the requested operation is interpolation at specified coordinates, but it does not “recover” unknown acquisition timestamps.
The bounded rule is therefore: regularity answers one question; model approval answers another. Neither substitutes for the other.
Capture evidence that preserves the original time coordinates
The twelve-case ledger below is the publication specification. Every row is EXPECTED / NOT EXECUTED.
Case | Input t | Interval oracle | Diagnostic expectation | Guarded calls | Decision | Source preserved |
R01 | [10,11,12,13] | [1,1,1] | none | 1 | ACCEPT_BOUNDED | true |
R02 | [10,11,12.25,13] | [1,1.25,0.75] | G1/Y1 | 0 | REJECT_TIMEBASE | true |
R03 | [10,11,13,14] | [1,2,1] | G1/Y1 | 0 | REJECT_TIMEBASE | true |
R04 | [10,11,11,13] | [1,0,2] | G1/Y1 | 0 | REJECT_TIMEBASE | true |
R05 | [10,11,9,13] | [1,-2,4] | G1/Y1 | 0 | REJECT_TIMEBASE | true |
R06 | [10,12,13,14] | [2,1,1] | G2/Y1 | 0 | REJECT_TIMEBASE | true |
R07 | [110,111,112,113] | [1,1,1] | none | 1 | ACCEPT_BOUNDED | true |
R08 | [10,11] | unavailable: incomplete | G1/Y1 | 0 | HOLD_PROVENANCE | true |
R09 | [10,11,12,13] | [1,1,1] | none | 1 | REJECT_MISLABELED_OUTPUT | true |
R10 | [10,11,NaN,13] | not computed | G1/Y1 | 0 | REJECT_TIMEBASE | true |
R11 | [10,12,14,16] | [2,2,2] | G2/Y1 | 1 | ACCEPT_BOUNDED | true |
R12 | [10,11,12,13] | [1,1,1] | none | 0 | HOLD_MODEL | true |
For machine-readable evidence, do not leave aliases unresolved. A record should expand Y1 and every applicable grid:
{
"case_id": "R01",
"source_ids": ["S0", "S1", "S2", "S3"],
"original_x": [1.0, 0.0, -1.0, 0.0],
"original_t": [10.0, 11.0, 12.0, 13.0],
"units": "s",
"approved_interval_seconds": 1.0,
"model_id": "cosine-cycle-4s-v1",
"num": 8,
"executed": false,
"observed": null,
"expected_coordinates": [
10.0, 10.5, 11.0, 11.5, 12.0, 12.5, 13.0, 13.5
],
"expected_values": [
1.0,
0.7071067811865476,
0.0,
-0.7071067811865476,
-1.0,
-0.7071067811865476,
0.0,
0.7071067811865476
],
"diagnostic_calls": 0,
"guarded_resample_calls": 1,
"source_preserved": true
}G2 must be expanded as [10,11,12,13,14,15,16,17]; G3 as [110,110.5,111,111.5,112,112.5,113,113.5].
Nonfinite inputs need tagged representation if the evidence format is strict JSON, because bare NaN is not valid interoperable JSON:
{
"case_id": "R10",
"original_t": [
10.0,
11.0,
{"nonfinite": "NaN"},
13.0
]
}Required evidence fields are case_id, source IDs, original x and t, units, approved interval, model ID, num, executed, observed, expected coordinates and values, diagnostic_calls, guarded_resample_calls and source_preserved.
After a real run, append the actual environment, exact invocation and source digest. A checksum can identify bytes; it does not prove those bytes were executed, establish who acquired them, or authenticate the timestamps. Any discrepancy between expected and observed results belongs in the retained record.
Recover from trusted source records
A rejected source packet should not disappear simply because a later candidate is rebuilt. Preserve both the original packet and any exported candidate that exposed the defect.
If independently qualified original positions still exist, recovery can begin from those positions. Construct a new source candidate from the trusted record, apply the approved interval and model policy, run the guard, reconcile Y and the output coordinates, and only then consider replacing downstream data. The recovery decision can be recorded as REBUILD_FROM_TRUSTED_SOURCE while reconstruction is under way; it is not equivalent to acceptance.
If trustworthy source coordinates no longer survive, publication should remain on hold. A result array cannot reveal ignored timestamp metadata.
Do not manufacture missing acquisition evidence
Replacing unknown source positions with linspace creates a regular coordinate array; it does not recover measurements that were never retained. Silently filling a gap similarly turns missing evidence into authored data.
Changing from Fourier resampling to another method also cannot reconstruct provenance. A genuinely irregular acquisition may deserve a separate interpolation or estimation plan, but that plan must state what its independent coordinates mean and what model is being authorized.
Downstream rollback means restoring the last accepted data product together with its matching coordinate metadata. Do not restore values from one revision and timestamps from another.
This is distinct from filter-state continuity across signal chunks, where the missing object is numerical filter history carried across chunk boundaries. The Refonte lfilter article explicitly treats zi/zf continuation evidence and replay; this article deals instead with a complete source record whose timestamp ledger must be qualified before resampling.
A recovery record should therefore state what survived: original sample IDs, paired values and positions, units, source revision, model authorization and the evidence supporting each. If that list cannot be completed, REBUILD_FROM_TRUSTED_SOURCE remains a route, not a result.
Use an acceptance matrix with named owners
The decision vocabulary is deliberately bounded.
Decision | Required evidence | Primary owner | Next action |
ACCEPT_BOUNDED | complete source checks, approved model, expected output grid and values reconciled; execution evidence if claiming observation | transformation owner | publish only within recorded scope |
REJECT_TIMEBASE | known finite/spacing/order violation in supplied positions | acquisition + numerical owners | correct from trusted source evidence or hold |
REJECT_MISLABELED_OUTPUT | admitted transformation but exported coordinates differ from qualified coordinates | consumer + transformation owners | block publication and restore qualified labels |
HOLD_PROVENANCE | required source evidence absent or incomplete | acquisition owner | obtain trusted complete ledger |
HOLD_MODEL | timing may qualify but numerical model/interval authorization is missing | numerical owner | commission or approve model |
REBUILD_FROM_TRUSTED_SOURCE | trustworthy original record survives and a new candidate can be generated | acquisition + transformation owners | rebuild and fully requalify |
The acquisition owner qualifies original positions and units. The numerical owner approves the sample interval, periodic model and any future physical-unit tolerance. The transformation owner enforces the admission boundary, performs the SciPy operation and captures evidence. The consumer owner verifies that published coordinates remain attached to the right values and that the interpretation matches the accepted contract.
ACCEPT_BOUNDED is intentionally not “physically correct.” It means the complete supplied source record satisfied this bounded policy and, when execution is actually claimed, the result reconciled with the independent output oracles under a retained runtime manifest.
In the present article, even R01, R07 and R11 remain proposed ACCEPT_BOUNDED cases, because executed=false and observed=null. They should not be published as passed runtime tests.
Requalification is required when any contract-bearing element changes: source coordinates, source units, model identity, approved interval, num, window, domain, axis, wrapper implementation or runtime/dependency environment. The reason is not that every version change necessarily changes output. It is that prior evidence belongs to the configuration that produced it.
The central documented fact remains narrow. SciPy 1.17.0 says resample expects equidistant input samples and a periodic signal, while supplied t values after the first two do not participate in returned-grid construction. A caller whose publication standard requires complete source-time validation must implement and own that additional check.
Develop numerical validation skills with Refonte Learning
This laboratory exercises habits that fit naturally with Python and NumPy foundations: preserve raw arrays, separate metadata from computed results, inspect every adjacent interval, define literal numerical oracles and record why a candidate was accepted or held.
Refonte Learning's Data Science & AI Program currently names competencies including Python Data Science, Statistical Modelling, EDA and Data Visualization, Model Optimization & Problem-Solving Techniques, and application to industry projects. Its FAQ names Python, Jupyter Notebook, Pandas, NumPy, Matplotlib, scikit-learn and TensorFlow. The main page lists three months and 12–14 hours/week, and its completion section names a Training Certificate and Certificate of Internship; the page also contains an Educational Mentors section.
The programme page gives differing descriptions of duration and eligibility. Its main section lists three months and requires ongoing bachelor's or postgraduate study, while the FAQ describes a broader weeks-to-months duration and says there are no strict prerequisites. Confirm the current cohort's duration and eligibility directly. The reviewed page does not confirm instruction in this specific SciPy resampling laboratory, guaranteed internship placement, or a particular mentoring schedule. Its references to virtual internship opportunities and “Potential Internship” should not be interpreted as a placement guarantee.
A useful exercise is to explain why R06 and R11 can share the same proposed G2/Y1 result while receiving different admission decisions. The answer should come from the source ledgers, not the smoothness of the output.
Check the current programme information directly if those foundations match your learning goals, and keep the operational rule: approve the source timing and numerical contract before publishing resampled coordinates.
