sage.core.utils

Filename : utils.py Description : Short description of the file

Created on 2025-11-06 17:39:59

__author__ = Narenraju Nagarajan __copyright__ = Copyright 2025, ProjectName __license__ = MIT Licence __version__ = 0.0.1 __maintainer__ = Narenraju Nagarajan __affiliation__ = N/A __email__ = N/A __status__ = [‘inProgress’, ‘Archived’, ‘inUsage’, ‘Debugging’]

GitHub Repository: NULL

Documentation: NULL

Functions

to_sequence(x)

Wrap scalars into a tuple so everything becomes iterable.

ensure_1d(x)

Convert x to a NumPy array and assert it is one-dimensional.

Module Contents

to_sequence(x)[source]

Wrap scalars into a tuple so everything becomes iterable.

ensure_1d(x)[source]

Convert x to a NumPy array and assert it is one-dimensional.

Parameters:

x (array-like) – Input to validate.

Returns:

One-dimensional view of x.

Return type:

numpy.ndarray, shape (N,)

Raises:

ValueError – If the resulting array has more than one dimension.