hikari.utility.interval
Classes
A class handling [A, B] line segments and numpy operations on them. |
Module Contents
- class hikari.utility.interval.Interval(left, right)[source]
A class handling [A, B] line segments and numpy operations on them. The following magic methods have been implemented for Interval:
creation using Interval(A, B) syntax (if A == B, represents a point)
comparison operations with numbers (True if holds for the whole Interval)
arithmetic operations, which act element-wise for left and right edge
access methods: A == Interval(A, B)[0] == Interval(A, B).left
container methods: 5 and 6.2 are in Interval(5, 7), but 7. might not be
- left
- right
- arange(step=1)[source]
Return a 1D-list of values from left to right every step :param step: spacing between adjacent values, default 1. :type step: int or float :return: array of values from left to right (including right) every step :rtype: np.array
- comb_with(*others, step=1)[source]
Return combinations of self.arange(step) with every other.arange(step) :param others: interval or iterable of intervals to comb self with :type others: Interval or tuple or list :param step: spacing between adjacent values, default 1. :type step: int or float :return: array of all combinations found in numpy.meshgrid every step :rtype: np.array
- mesh_with(*others, step=1)[source]
Return a numpy.mesh of self.arange(step) with every other.arange(step) :param others: interval or iterable of intervals to mesh self with :type others: Interval or tuple or list :param step: spacing between adjacent values, default 1. :type step: int or float :return: array of values meshed by numpy.meshgrid every step :rtype: np.array