monte_carlo_analysis.utils package

Submodules

monte_carlo_analysis.utils.numba_utils module

Author : Robin Camarasa

Institution : Erasmus Medical Center

Position : PhD student

Contact : r.camarasa@erasmusmc.nl

Date : 2020-10-23

Project : monte_carlo_analysis

** Implement numba util functions **

Numba histogram - Code adapted from: https://numba.pydata.org/numba-examples/examples/density_estimation/histogram/results.html

monte_carlo_analysis.utils.numba_utils.compute_bin(x: numpy.array, bin_edges: numpy.array, min_value: float, max_value: float) → numpy.array[source]

Compute the histogram bins

Parameters
  • x – Flat array

  • bin_edges – Edges of the bin

  • min_value – Minimum value of the histogram

  • max_value – Minimum value of the histogram

monte_carlo_analysis.utils.numba_utils.get_bin_edges(bins: int, min_value: float, max_value: float) → numpy.array[source]

Compute the number of bins

Parameters
  • bins – Number of bin in the histogram

  • min_value – Minimum value of the histogram

  • max_value – Minimum value of the histogram

monte_carlo_analysis.utils.numba_utils.numba_cumul_histogram(a: numpy.array, bins: int, min_value: float = None, max_value: float = None, normalized: bool = False) → tuple[source]

Compute a cumulated histogram using numba

Parameters
  • a – array to transform to histogram

  • bins – Number of bins

  • min_value – Minimum value of the histogram

  • max_value – Minimum value of the histogram

  • normalized – Set normalization of the array

monte_carlo_analysis.utils.numba_utils.numba_histogram(a: numpy.array, bins: int, min_value: float = None, max_value: float = None, normalized: bool = False) → tuple[source]

Compute an histogram using numba

Parameters
  • a – array to transform to histogram

  • bins – Number of bins

  • min_value – Minimum value of the histogram

  • max_value – Minimum value of the histogram

  • normalized – Set normalization of the array

Module contents

Author : Robin Camarasa

Institution : Erasmus Medical Center

Position : PhD student

Contact : r.camarasa@erasmusmc.nl

Date : 2020-11-03

Project : monte_carlo_analysis

Module that contains the utils function