"""This script generates initial files for the tests in `examples.rs`. Afterwards, the files will be manually modified to account for slight differences in the writer implementations. (For example, NumPy tends to write a trailing comma in the Python dictionary literal that needs to be removed to match the output of `py_literal`.) """ import numpy as np def write_example_array(shape, dtype, order, f, dst): arr = np.zeros(shape, dtype=dtype, order=order) for i in range(arr.size): arr.flat[i] = f(i) np.save(dst, arr) def main(): write_example_array( (2, 3), dtype='