bnl.core.BoundaryContour

class bnl.core.BoundaryContour(bs, *, name=None)[source]

Bases: TimeSpan

An intermediate, purely structural representation of boundary salience over time.

Public Data Attributes:

bs

start

end

Inherited from TimeSpan

name

duration

Duration in seconds.

start

end

Public Methods:

plot(**kwargs)

Plots the BoundaryContour on a Plotly figure.

clean([strategy])

Cleans up the boundary contour using a specified strategy.

level([strategy])

Converts the BoundaryContour to a BoundaryHierarchy by quantizing salience.


Parameters:
plot(**kwargs)[source]

Plots the BoundaryContour on a Plotly figure.

Parameters:
  • fig – Optional Plotly Figure to add to.

  • **kwargs (Any) – Additional keyword arguments to pass to the plotting function.

Returns:

A Plotly Figure object with the boundary contour visualization.

Return type:

Figure

clean(strategy='absorb', **kwargs)[source]

Cleans up the boundary contour using a specified strategy.

This is a convenience wrapper around bnl.ops.clean_boundaries.

Parameters:
  • strategy (str) – The cleaning strategy to use. See bnl.ops.clean_boundaries for details. Defaults to ‘absorb’.

  • **kwargs – Additional keyword arguments to pass to the strategy (e.g., window).

Returns:

A new, cleaned BoundaryContour.

Return type:

BoundaryContour

level(strategy='unique', **kwargs)[source]

Converts the BoundaryContour to a BoundaryHierarchy by quantizing salience.

Parameters:
  • strategy (str)

  • kwargs (Any)

Return type:

BoundaryHierarchy