utils#

Numerical utilities

Classes

ndict

A dictionary-like class that provides additional functionalities for handling named items.

Functions

warn

Helper function to handle warnings -- shortcut to warnings.warn

find_contacts

Variation on Network.find_contacts() that avoids sorting.

set_seed

Reset the random seed -- complicated because of Numba, which requires special syntax to reset the seed.

check_requires

Check that the module's requirements (of other modules) are met

standardize_netkey

Networks can be upper or lowercase, and have a suffix 'net' or not; this function standardizes them

standardize_data

Standardize formats of input data

validate_sim_data

Validate data intended to be compared to the sim outputs, e.g. for calibration.

load

Alias to Sciris sc.loadany()

save

Alias to Sciris sc.save()

return_fig

Do postprocessing on the figure: by default, don't return if in Jupyter, but show instead