cosmicfishpie.utilities package

Submodules

cosmicfishpie.utilities.utils module

class cosmicfishpie.utilities.utils.filesystem[source]

Bases: object

static git_version()[source]
static mkdirp(dirpath)[source]

This function creates the directory dirpath if it is not found :type dirpath: :param dirpath: string with the path of the directory to be created :return: None :rtype: NoneType

class cosmicfishpie.utilities.utils.inputiniparser(config_dir, config_file='main.ini', parameter_translator={}, fiducial_translator={})[source]

Bases: object

free_epsilons(epsilon=0.01)[source]
class cosmicfishpie.utilities.utils.misc[source]

Bases: object

static deepupdate(original, update)[source]

Recursively update a dict.

Subdicts won’t be overwritten but also updated.

class cosmicfishpie.utilities.utils.numerics[source]

Bases: object

static bisection(array, value)[source]

Given an array, and given a value, returns an index j such that value is between array[j] and array[j+1]. array must be monotonic increasing. Returns 0 if value is less than or equal to the first element, and len(array)-1 if value is greater than or equal to the last element.

static closest(lst, K)[source]
static find_nearest(a, a0)[source]

Element in nd array a closest to the scalar value a0

static moving_average(data_set, periods=2)[source]
static round_decimals_up(number, decimals=2, precision=5)[source]

Returns a value rounded up to a specific number of decimal places.

old_round_decimals_up = False
class cosmicfishpie.utilities.utils.physmath[source]

Bases: object

static areasky()[source]
static degtorad(degs)[source]
fskytosqdeg()[source]
static radtodeg(rads)[source]
sqdegtofsky()[source]
sr = np.float64(3282.806350011744)
class cosmicfishpie.utilities.utils.printing[source]

Bases: object

static debug_print(*args, **kwargs)[source]
static suppress_warnings(func)[source]

Decorator to optionally suppress warnings based on global SUPPRESS_WARNINGS flag.

Parameters:

func (callable) – The function to wrap

Returns:

Wrapped function with optional warning suppression

Return type:

callable

static time_print(feedback_level=0, min_level=0, text='Computation done in: ', time_ini=None, time_fin=None, instance=None)[source]
SUPPRESS_WARNINGS = False
debug = False
cosmicfishpie.utilities.utils.load_fisher_from_json(json_path)[source]

Load a FisherMatrix configuration snapshot JSON and construct a FisherMatrix.

Parameters:

json_path (str) – Path to a JSON produced by FisherMatrix.export_fisher (*_specifications.json).

Returns:

(fisher_matrix_instance, snapshot_dict)

Return type:

tuple

Notes

  • This only reconstructs the object with the same options/specifications/parameters. You still need to call .compute() on the returned FisherMatrix to perform the run.