Share

read_NumPy

Reads a NumPy .npy file and import it into a bifrost array. It is up to the user to decide the shape of the data to read into.

Inputs

file_path

The full file path to read. Environment variables and sequence tokens (see frame) in paths are supported. For example, ${SOME_PROJECT_ROOT}/DataSet/data.#.npy

frame

The frame number of a sequence to write. If the file_path contains a sequence token (such as file.####.npy), the frame number will be substituted there. time.frame may be connected here to drive the frame of a sequence to write.

type

The type of array to fill. Types can be array<T>or array<array<T>> or array<array<array<T>>> where T is of type :

  • float, float2, float3, float4, float2x2, float3x3, float4x4,
  • double, double2, double3, double4, double2x2, double3x3, double4x4,
  • int, int2, int3, int4, int2x2, int3x3, int4x4,
  • long, long2, long3, long4, long2x2, long3x3, long4x4,

Outputs

data

The data read.

shape

The NumPy shape. Array of int corresponding to the "dimensions" encoded in the output flat array.

status

Output string message.

success

True if the file was successfully read-in. The operation will fail if the data type is not a supported, or if the shape is not compatible with the type parameter. For instance, if the file represent a NumPy array of shape (12345, 3) floats, the data can be read as an array<array<float>>, an array<float> or an array<float3>.

Limitations

Readable files are limited to these basic data types:

  • numpy.int32, numpy.int64, numpy.float32, numpy.float64,

Was this information helpful?