nenupy.schedule.constraints.ScheduleConstraint

class nenupy.schedule.constraints.ScheduleConstraint(weight)[source]

Bases: Constraint

Base class for constraints involving time range checks.

Warning

ScheduleConstraint should not be used on its own.

Added in version 1.2.0.

__call__(*arg)

Evaluate the constraint against the schedule properties.

Returns:

The constraint score evaluated at each time step.

Return type:

ndarray

Raises:

AttributeError – If the constraint does not have an _evaluate() method.

__init__(weight)[source]

Methods

__init__(weight)

plot([fig, ax])

Plot the constraint's score previously evaluated.

Attributes

weight

Relative weight associated to the constraint.

plot(fig=None, ax=None, **kwargs)

Plot the constraint’s score previously evaluated.

Parameters:
  • fig (Figure) – Figure instance to re-use for plotting purposes, by default None (i.e., a new Figure will be created)

  • ax (Axes) – Ax instance to re-use for plotting purposes, by default None (i.e., a new Axes will be created)

  • figsize ([float, float]) – Size of the figure, by default (10, 5)

  • figname (str) – Name of the figure to be saved, by default '' (i.e., the figure is only displayed)

  • marker (str) – Plot marker type (see matplotlib.pyplot.plot()), by default '.'

  • linestyle (str) – Plot line style (see matplotlib.pyplot.plot()), by default ':'

  • linewidth (int) – Plot line width (see matplotlib.pyplot.plot()), by default 1

property weight

Relative weight associated to the constraint. The constraint score of an observation block within a given schedule is ultimately taken at the weighted mean among all the constraints associated to this observaiton request.