Expand description
Module containing miscellaneous utility functions.
Constants§
- NESTED_
STRUCT_ ERR - Error message for when user attempts to set value in a nested struct.
Functions§
- add_
from - Returns a new array with a constant added starting at xs[i] to the end. Values prior to xs[i] are unchanged.
- arrmax
- return max of arr
- arrmin
- return min of arr
- clear_
cache - Deletes FASTSim data directory, clearing its contents. If subpath is provided, will only delete the subdirectory pointed to by the subpath, rather than deleting the whole data directory. If the subpath is an empty string, deletes the entire FASTSim directory. USE WITH CAUTION, as this function deletes ALL objects stored in the FASTSim data directory or provided subdirectory.
- create_
project_ subdir - Creates/gets an OS-specific data directory and returns the path.
- diff
- download_
file_ from_ url - Assumes the parent directory exists. Assumes file doesn’t exist (i.e., newly created) or that it will be truncated if it does.
- first_
eq - Return first index of
arrequal tocut - first_
grtr - Return first index of
arrgreater thancut - get_
index_ permutations - Generate all permutations of indices for a given N-dimensional array shape
- interpolate
- interpolation algorithm from http://www.cplusplus.com/forum/general/216928/ Arguments: x : value at which to interpolate
- interpolate_
vectors - interpolation algorithm from http://www.cplusplus.com/forum/general/216928/ Arguments: x : value at which to interpolate
- max
- return max of 2 f64
- min
- return min of 2 f64
- multilinear
- Multilinear interpolation function, accepting any dimensionality N.
- ndarrallzeros
- return true if the array is all zeros
- ndarrcumsum
- return cumsum of arr
- ndarrunique
- return the unique values of the array
- path_
to_ cache - Returns the path to the OS-specific data directory, if it exists.
- tire_
code_ to_ radius - Calculate tire radius (in meters) from an ISO metric tire code
- url_
to_ cache - takes an object from a url and saves it in the FASTSim data directory in a rust_objects folder WARNING: if there is a file already in the data subdirectory with the same name, it will be replaced by the new file to save to a folder other than rust_objects, define constant CACHE_FOLDER to be the desired folder name