mushi.histories.History

class History(change_points, vals)[source]

Bases: object

Base class piecewise constant history. The first epoch starts at zero, and the last epoch extends to infinity.

Parameters:
  • change_points (array) – epoch change points (times)

  • vals (ndarray) – constant values for each epoch (rows)

Methods

arrays

Return time grid and values in each cell.

check_grid

Test if time grid is the same as another instance.

epochs

Generator yielding epochs as tuples: (start_time, end_time, value)

plot

Plot the history.

arrays()[source]

Return time grid and values in each cell.

epochs()[source]

Generator yielding epochs as tuples: (start_time, end_time, value)

check_grid(other)[source]

Test if time grid is the same as another instance.

Parameters:

other (History) – another History object

plot(t_gen=None, types=None, **kwargs)[source]

Plot the history.

Parameters:
  • t_gen (float) – generation time in years (optional)

  • kwargs – key word arguments passed to plt.plot

Return type:

List[Line2D]