compas_fab.utilities

Package containing a set of utility functions.

File system functions

read_csv_to_dictionary

Reads a csv file and returns a dictionary with the respective keys specified in the first row of the csv file.

write_data_to_json

Write data to json file.

read_data_from_json

Read data from json file.

list_files_in_directory

This function lists just the files in a directory, not sub-directories.

Numerical functions

map_range

Performs a linear interpolation of a value within the range of [from_min, from_max] to another range of [to_min, to_max].

arange

Returns evenly spaced values within a given interval.

allclose

Returns True if two lists are element-wise equal within a tolerance.

Other functions

sign

Returns the sign of a number: +1 or -1.

argsort

Returns the indices that would sort a list of numbers.

LazyLoader

Lazily import a module, mainly to avoid pulling in large dependencies.