Skip to content

Commit

Permalink
V2.0.6 - Add DataIterators (#227)
Browse files Browse the repository at this point in the history
- Add Iterator Utils
  • Loading branch information
jlsneto authored Feb 9, 2025
1 parent 4e0b384 commit 20d669a
Show file tree
Hide file tree
Showing 7 changed files with 761 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v2
Expand Down
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
3 changes: 3 additions & 0 deletions cereja/mltools/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ def max_freq(self):
def min_freq(self):
return self.sample(min(self.values()))

def to_dict(self):
return dict(self)


class ConnectValues(dict):
def __init__(self, name: str = None):
Expand Down
Loading

0 comments on commit 20d669a

Please sign in to comment.