cogwheel.utilsΒΆ
Utility functions.
Functions
Clear caches of functions decorated with |
|
Return normalized probabilities from unnormalized log probabilities. |
|
Return pathlib.Path object for a directory of the form parentdir/prior_name/eventname/. |
|
Return pathlib.Path object for a directory of the form |
|
Return path to a directory where a new inference run can take place. |
|
Return a function that outputs a scalar instead of 0-d array. |
|
Import lal, disabling stdout/stderr redirection if in ipython. |
|
Cache function results and register it for easy cache clearing. |
|
Merge multiple dictionaries into one. |
|
Create directory and its parents if needed. |
|
Modulus operation, but allows to specify the domain of the output. |
|
Calculate the effective sample size from a set of weights. |
|
Compute the q-th quantile of the data. |
|
Return a class instance that was saved to json. |
|
Return real part of complex matrix multiplication. |
|
Replace specified elements in a sequence with new values. |
|
Resample a weighted DataFrame to produce equal-weight samples. |
|
Return first strech of numbers in rundir as |
|
Return rundirs sorted by number (i.e. 'run_2' before 'run_10'). |
|
Generic function to submit a job using HTCondor. |
|
Generic function to submit a job using IBM Spectrum LSF. |
|
Generic function to submit a job using slurm. |
|
Change attributes of an object temporarily in a context manager. |
|
Modify a dataframe in-place by adding the columns from another. |
|
Return average and standard deviation of values with weights. |
Classes
Like |
|
Decoder for subclasses of JSONMixin. |
|
Encoder for subclasses of JSONMixin. |
|
Provide methods |
|
Provide JSON output to subclasses. |
|
Encoder for numpy data types. |