Skip to content

Commit

Permalink
chore: add DataIterator
Browse files Browse the repository at this point in the history
  • Loading branch information
jlsneto committed Feb 8, 2025
1 parent 4e0b384 commit a442ba8
Show file tree
Hide file tree
Showing 5 changed files with 524 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cereja/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
from . import scraping
from . import wcag

VERSION = "2.0.5.final.0"
VERSION = "2.0.6.final.0"

__version__ = get_version_pep440_compliant(VERSION)

Expand Down
28 changes: 28 additions & 0 deletions cereja/geolinear/point.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,3 +386,31 @@ def __ge__(self, other: Union['Point', Sequence]) -> bool:
"""
other = Point(other)
return (self.magnitude, *self.coordinates) >= (other.magnitude, *other.coordinates)

def __hash__(self):
return hash(self.coordinates)

def plot(self, ax=None, **kwargs):
"""
Plot the point on a 2D or 3D matplotlib axis.
Args:
ax (matplotlib.axes.Axes, optional): The matplotlib axis to plot the point on.
**kwargs: Additional keyword arguments to pass to the plot function.
Returns:
matplotlib.axes.Axes: The matplotlib axis with the point plotted.
"""
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

if ax is None:
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d' if self.is_3d else None)

if self.is_3d:
ax.scatter(self.x, self.y, self.z, **kwargs)
else:
ax.scatter(self.x, self.y, **kwargs)

return ax
Loading

0 comments on commit a442ba8

Please sign in to comment.