org.pycforge.numpy · Author: PyCForge
License: GPL-3.0-only · Created: 2026-10-29
Runtime conversion · Direct numeric calls
add · argmax · argmin · array · copy · full · max · min · multiply · ones · subtract · zeros
A bounded NumPy conversion package for one-dimensional finite float64 arrays.
Select Runtime and declare *import numpy as np. Use np.array(values, dtype="float64"). Read results with indexing or tolist(); copy with np.copy(a) or a.copy().
One-dimensional contiguous finite float64 arrays only; no dtype inference, views, slicing, array broadcasting or external buffers. Assignment and argument passing share the same array; constructors, copy and arithmetic allocate independent storage. Integer indexing (including negatives), finite numeric item assignment, len, iteration/reversed, copy()/tolist() and shape/size/ndim are supported. Nonfinite inputs and arithmetic overflow are explicitly outside this profile; NumPy warning/seterr policies are not implemented. Allocation and work share the Runtime context budgets. Budget exhaustion is fatal; ordinary type, shape and bounds errors are catchable. Returned arrays stay valid within their originating context until destruction or explicit collection without a live root. Runtime only; no Python/NumPy runtime or arbitrary native dependencies in generated C. Profile 0.2 adds min/max (float64) and argmin/argmax (int64) module functions on supported arrays. axis defaults to None; only None, integer 0 or -1 are accepted. Empty inputs raise ValueError. No sequence coercion, axis tuples, keepdims, out, initial, where, reduction methods or other reductions. When the selected minimum/maximum is zero and both zero signs occur, min/max raise ValueError: NumPy's zero sign can depend on reduction order. Single-sign zero extrema retain their sign. Index reductions accept mixed zero signs and return the first tied index. Scalar results have independent value ownership. Array printing/formatting, comparisons, dtype objects, NumPy scalar object identity and warning/seterr behavior are unsupported. Arithmetic overflow is refused explicitly; no silent approximation.
Adds minimum/maximum values and first minimum/maximum indices through profile 0.2. Reference fixtures generated with NumPy 2.5.4.
Examples are author-supplied fixture snapshots. The SDK reports verification for its recorded environment; PyCForge registration does not rerun them.
Use *import numpy in the module preamble. Each signature states accepted positions, names and defaults. A slash marks positional-only parameters; a star marks keyword-only parameters. Argument expansion, function values and Typed conversion are unsupported.
One-dimensional contiguous finite float64 arrays only; no dtype inference, views, slicing, array broadcasting or external buffers. Assignment and argument passing share the same array; constructors, copy and arithmetic allocate independent storage. Integer indexing (including negatives), finite numeric item assignment, len, iteration/reversed, copy()/tolist() and shape/size/ndim are supported. Nonfinite inputs and arithmetic overflow are explicitly outside this profile; NumPy warning/seterr policies are not implemented. Allocation and work share the Runtime context budgets. Budget exhaustion is fatal; ordinary type, shape and bounds errors are catchable. Returned arrays stay valid within their originating context until destruction or explicit collection without a live root. Runtime only; no Python/NumPy runtime or arbitrary native dependencies in generated C. Profile 0.2 adds min/max (float64) and argmin/argmax (int64) module functions on supported arrays. axis defaults to None; only None, integer 0 or -1 are accepted. Empty inputs raise ValueError. No sequence coercion, axis tuples, keepdims, out, initial, where, reduction methods or other reductions. When the selected minimum/maximum is zero and both zero signs occur, min/max raise ValueError: NumPy's zero sign can depend on reduction order. Single-sign zero extrema retain their sign. Index reductions accept mixed zero signs and return the first tied index. Scalar results have independent value ownership.
Add two equal-length float64 arrays, or an array and a numeric scalar, into new storage.
x1: positional-only; required
x2: positional-only; required
Add two equal-length float64 arrays, or an array and a numeric scalar, into new storage.
Add two equal-length float64 arrays, or an array and a numeric scalar, into new storage.
Argument 1: x1: See the fixed operation signature and contract.
Argument 2: x2: See the fixed operation signature and contract.
Returns: A new independent one-dimensional float64 array owned by the Runtime context.
Return the int64 index of the first maximum in a nonempty supported array. Equal values, including signed zeros, keep the first index. axis accepts None, 0 or -1. Empty arrays raise ValueError. No out/keepdims/where/initial, sequence coercion or method form. Min/max reject mixed-sign zero extrema; argmin/argmax keep the first tied index.
a: positional-or-keyword; required
axis: positional-or-keyword; default None
Return the int64 index of the first maximum in a nonempty supported array. Equal values, including signed zeros, keep the first index.
Result must fit signed int64; nonfinite or out-of-range results raise an exception.
Return the int64 index of the first maximum in a nonempty supported array. Equal values, including signed zeros, keep the first index. axis accepts None, 0 or -1. Empty arrays raise ValueError. No out/keepdims/where/initial, sequence coercion or method form. Min/max reject mixed-sign zero extrema; argmin/argmax keep the first tied index.
Argument 1: a: A supported finite float64 array; reductions require at least one element.
Argument 2: axis: None (default), integer 0 or -1 reduces the one-dimensional array; no axis tuples or booleans.
Returns: An independent int64 scalar; the input array is unchanged.
Return the int64 index of the first minimum in a nonempty supported array. Equal values, including signed zeros, keep the first index. axis accepts None, 0 or -1. Empty arrays raise ValueError. No out/keepdims/where/initial, sequence coercion or method form. Min/max reject mixed-sign zero extrema; argmin/argmax keep the first tied index.
a: positional-or-keyword; required
axis: positional-or-keyword; default None
Return the int64 index of the first minimum in a nonempty supported array. Equal values, including signed zeros, keep the first index.
Result must fit signed int64; nonfinite or out-of-range results raise an exception.
Return the int64 index of the first minimum in a nonempty supported array. Equal values, including signed zeros, keep the first index. axis accepts None, 0 or -1. Empty arrays raise ValueError. No out/keepdims/where/initial, sequence coercion or method form. Min/max reject mixed-sign zero extrema; argmin/argmax keep the first tied index.
Argument 1: a: A supported finite float64 array; reductions require at least one element.
Argument 2: axis: None (default), integer 0 or -1 reduces the one-dimensional array; no axis tuples or booleans.
Returns: An independent int64 scalar; the input array is unchanged.
Copy a flat numeric list, tuple or supported array into new float64 storage. Explicit dtype='float64' is required; no dtype inference.
object: positional-or-keyword; required
dtype: positional-or-keyword; required
Copy a flat numeric list, tuple or supported array into new float64 storage. Explicit dtype='float64' is required; no dtype inference.
Copy a flat numeric list, tuple or supported array into new float64 storage. Explicit dtype='float64' is required; no dtype inference.
Argument 1: object: See the fixed operation signature and contract.
Argument 2: dtype: Float64 string; required unless the signature supplies its default.
Returns: A new independent one-dimensional float64 array owned by the Runtime context.
Copy a supported array into independent writable storage. Assignment alone shares the original array.
a: positional-or-keyword; required
Copy a supported array into independent writable storage. Assignment alone shares the original array.
Copy a supported array into independent writable storage. Assignment alone shares the original array.
Argument 1: a: A supported finite float64 array; reductions require at least one element.
Returns: A new independent one-dimensional float64 array owned by the Runtime context.
View example: independent-copies
Create a one-dimensional array filled with one numeric value. Explicit dtype='float64' is required.
shape: positional-or-keyword; required
fill_value: positional-or-keyword; required
dtype: positional-or-keyword; required
Create a one-dimensional array filled with one numeric value. Explicit dtype='float64' is required.
Create a one-dimensional array filled with one numeric value. Explicit dtype='float64' is required.
Argument 1: shape: See the fixed operation signature and contract.
Argument 2: fill_value: See the fixed operation signature and contract.
Argument 3: dtype: Float64 string; required unless the signature supplies its default.
Returns: A new independent one-dimensional float64 array owned by the Runtime context.
Return the maximum finite float64 value of a nonempty supported array, without modifying it or allocating array storage. axis accepts None, 0 or -1. Empty arrays raise ValueError. No out/keepdims/where/initial, sequence coercion or method form. Min/max reject mixed-sign zero extrema; argmin/argmax keep the first tied index.
a: positional-or-keyword; required
axis: positional-or-keyword; default None
Return the maximum finite float64 value of a nonempty supported array, without modifying it or allocating array storage.
Return the maximum finite float64 value of a nonempty supported array, without modifying it or allocating array storage. axis accepts None, 0 or -1. Empty arrays raise ValueError. No out/keepdims/where/initial, sequence coercion or method form. Min/max reject mixed-sign zero extrema; argmin/argmax keep the first tied index.
Argument 1: a: A supported finite float64 array; reductions require at least one element.
Argument 2: axis: None (default), integer 0 or -1 reduces the one-dimensional array; no axis tuples or booleans.
Returns: An independent float64 scalar; the input array is unchanged.
Return the minimum finite float64 value of a nonempty supported array, without modifying it or allocating array storage. axis accepts None, 0 or -1. Empty arrays raise ValueError. No out/keepdims/where/initial, sequence coercion or method form. Min/max reject mixed-sign zero extrema; argmin/argmax keep the first tied index.
a: positional-or-keyword; required
axis: positional-or-keyword; default None
Return the minimum finite float64 value of a nonempty supported array, without modifying it or allocating array storage.
Return the minimum finite float64 value of a nonempty supported array, without modifying it or allocating array storage. axis accepts None, 0 or -1. Empty arrays raise ValueError. No out/keepdims/where/initial, sequence coercion or method form. Min/max reject mixed-sign zero extrema; argmin/argmax keep the first tied index.
Argument 1: a: A supported finite float64 array; reductions require at least one element.
Argument 2: axis: None (default), integer 0 or -1 reduces the one-dimensional array; no axis tuples or booleans.
Returns: An independent float64 scalar; the input array is unchanged.
Multiply two equal-length float64 arrays, or an array and a numeric scalar, into new storage.
x1: positional-only; required
x2: positional-only; required
Multiply two equal-length float64 arrays, or an array and a numeric scalar, into new storage.
Multiply two equal-length float64 arrays, or an array and a numeric scalar, into new storage.
Argument 1: x1: See the fixed operation signature and contract.
Argument 2: x2: See the fixed operation signature and contract.
Returns: A new independent one-dimensional float64 array owned by the Runtime context.
Create a one-dimensional float64 array filled with one; shape is an integer or a one-item tuple/list.
shape: positional-or-keyword; required
dtype: positional-or-keyword; default 'float64'
Create a one-dimensional float64 array filled with one; shape is an integer or a one-item tuple/list.
Create a one-dimensional float64 array filled with one; shape is an integer or a one-item tuple/list.
Argument 1: shape: See the fixed operation signature and contract.
Argument 2: dtype: Float64 string; required unless the signature supplies its default.
Returns: A new independent one-dimensional float64 array owned by the Runtime context.
Subtract two equal-length float64 arrays, or an array and a numeric scalar, into new storage.
x1: positional-only; required
x2: positional-only; required
Subtract two equal-length float64 arrays, or an array and a numeric scalar, into new storage.
Subtract two equal-length float64 arrays, or an array and a numeric scalar, into new storage.
Argument 1: x1: See the fixed operation signature and contract.
Argument 2: x2: See the fixed operation signature and contract.
Returns: A new independent one-dimensional float64 array owned by the Runtime context.
Create a one-dimensional float64 array filled with zero; shape is an integer or a one-item tuple/list.
shape: positional-or-keyword; required
dtype: positional-or-keyword; default 'float64'
Create a one-dimensional float64 array filled with zero; shape is an integer or a one-item tuple/list.
Create a one-dimensional float64 array filled with zero; shape is an integer or a one-item tuple/list.
Argument 1: shape: See the fixed operation signature and contract.
Argument 2: dtype: Float64 string; required unless the signature supplies its default.
Returns: A new independent one-dimensional float64 array owned by the Runtime context.
*import numpy as np
def main():
a=np.array([1, 2, -3], dtype="float64")
b=np.array([2, -1, 4], dtype="float64")
print(np.add(a,b).tolist(), np.subtract(a,b).tolist(), np.multiply(a,b).tolist())
print((a+b).tolist(), (a-b).tolist(), (a*b).tolist())
print((2+a).tolist(), (2-a).tolist(), (2*a).tolist())
print((a+2).tolist(), (a-2).tolist(), (a*2).tolist())
print((-a).tolist(), (+a).tolist())
return 0
Expected standard output:
[3.0, 1.0, 1.0] [-1.0, 3.0, -7.0] [2.0, -2.0, -12.0] [3.0, 1.0, 1.0] [-1.0, 3.0, -7.0] [2.0, -2.0, -12.0] [3.0, 4.0, -1.0] [1.0, 0.0, 5.0] [2.0, 4.0, -6.0] [3.0, 4.0, -1.0] [-1.0, 0.0, -5.0] [2.0, 4.0, -6.0] [-1.0, -2.0, 3.0] [1.0, 2.0, -3.0]
Expected exit code: 0
*import numpy as np
def main():
a=np.array([1, 2.5, True], dtype="float64")
print(a.tolist(), a.shape, a.size, a.ndim, len(a))
print(np.zeros(3).tolist(), np.ones((2,)).tolist())
print(np.full([3], -2, dtype="float64").tolist())
return 0
Expected standard output:
[1.0, 2.5, 1.0] (3,) 3 1 3 [0.0, 0.0, 0.0] [1.0, 1.0] [-2.0, -2.0, -2.0]
Expected exit code: 0
*import numpy as np
def main():
a=np.array([1, 2], "float64")
b=a
c=np.copy(a)
d=np.array(a, dtype="float64")
e=a.copy()
b[0]=9
print(a.tolist(), c.tolist(), d.tolist(), e.tolist(), a is b, a is c)
return 0
Expected standard output:
[9.0, 2.0] [1.0, 2.0] [1.0, 2.0] [1.0, 2.0] True False
Expected exit code: 0
*import numpy as np
def main():
a=np.array([4, -3, 8, -3, 8], dtype="float64")
print(np.min(a), np.max(a), np.argmin(a), np.argmax(a))
print(np.min(a, 0), np.max(a, -1), np.argmin(a, axis=None), np.argmax(a, axis=0))
print(a.tolist())
return 0
Expected standard output:
-3.0 8.0 1 2 -3.0 8.0 1 2 [4.0, -3.0, 8.0, -3.0, 8.0]
Expected exit code: 0