bhepop2.sources.global_distribution

This module contains classes describing global distributions sources.

The distributions are global in the sense that they describe a complete population , and can then be used by themselves for population enrichment.

Module Contents

Classes

QuantitativeGlobalDistribution

A single global distribution used as an enrichment source.

class bhepop2.sources.global_distribution.QuantitativeGlobalDistribution(data, name=None, abs_minimum: int = 0, relative_maximum: float = 1.5)

Bases: bhepop2.sources.base.EnrichmentSource, bhepop2.sources.base.QuantitativeAttributes

A single global distribution used as an enrichment source.

For now, only deciles distributions are managed.

_evaluate_feature_values()

Directly return the deciles values, plus the last one multiplied by _relative_maximum.

Returns:

list of feature values

_validate_data()

Check that the deciles columns are present and that length is 1.

get_value_for_feature(feature_index, rng)

Return a value drawn from the interval corresponding to the feature index.

The first interval is defined as [self._abs_minimum, self.feature_values[0]]. and so on. The value is drawn using a uniform rule.

Parameters:
  • feature_index

  • rng

Returns: