locan.data.region.EmptyRegion#
- class locan.data.region.EmptyRegion[source]#
Bases:
Region
Region class to define an empty region that has no dimension.
Methods
__init__
()as_artist
(**kwargs)- rtype:
None
buffer
(distance, **kwargs)Extend the region perpendicular by a distance.
contains
(points)Return list of indices for all points that are inside the region of interest.
from_intervals
(intervals)Constructor for instantiating axis-oriented, box-like Region from list of (min, max) bounds.
from_shapely
(shapely_object)- rtype:
intersection
(other)Returns a region representing the intersection of this region with
other
.symmetric_difference
(other)Returns the union of the two regions minus any areas contained in the intersection of the two regions.
union
(other)Returns a region representing the union of this region with
other
.Attributes
A region describing the minimum axis-aligned bounding box that encloses the original region.
Region bounds min_x, min_y, ..., max_x, max_y, .
Point coordinates for region centroid.
The region dimension.
The extent (max_x - min_x), (max_y - min_y), .
The maximum distance between any two points within the region.
Point coordinates.
Region measure, i.e. area (for 2d) or volume (for 3d).
Measure of the sub-dimensional region, i.e. circumference (for 2d) or surface (for 3d).
- property bounding_box: EmptyRegion#
A region describing the minimum axis-aligned bounding box that encloses the original region.
- Return type:
- property bounds: None#
Region bounds min_x, min_y, …, max_x, max_y, … for each dimension.
- Returns:
of shape (2 * dimension,)
- Return type:
npt.NDArray[np.float64] | None
- buffer(distance, **kwargs)[source]#
Extend the region perpendicular by a distance.
- Parameters:
distance (
float
) – Distance by which the region is extended.- Returns:
The extended region.
- Return type:
- property centroid: None#
Point coordinates for region centroid.
- Returns:
of shape (dimension,)
- Return type:
npt.NDArray[np.float64] | None
- contains(points)[source]#
Return list of indices for all points that are inside the region of interest.
- Parameters:
points (
Union
[_SupportsArray
[dtype
[Any
]],_NestedSequence
[_SupportsArray
[dtype
[Any
]]],bool
,int
,float
,complex
,str
,bytes
,_NestedSequence
[Union
[bool
,int
,float
,complex
,str
,bytes
]]]) – Coordinates of points that are tested for being inside the specified region.- Returns:
Array with indices for all points in original point array that are within the region.
- Return type:
npt.NDArray[np.int64]
- property dimension: None#
The region dimension.
- Return type:
int | None
- property extent: None#
The extent (max_x - min_x), (max_y - min_y), … for each dimension.
- Returns:
of shape (dimension,)
- Return type:
npt.NDArray[np.float64] | None
- intersection(other)[source]#
Returns a region representing the intersection of this region with
other
.
- property max_distance: int#
The maximum distance between any two points within the region.
- Return type:
float
- property points: ndarray[Any, dtype[float64]]#
Point coordinates.
- Returns:
of shape (n_points, dimension)
- Return type:
npt.NDArray[np.float64] | list[npt.NDArray[np.float64]]
- property region_measure: int#
Region measure, i.e. area (for 2d) or volume (for 3d).
- Return type:
float
- property subregion_measure: int#
Measure of the sub-dimensional region, i.e. circumference (for 2d) or surface (for 3d).
- Return type:
float