Skip to content

Commit

Permalink
cartesian name change
Browse files Browse the repository at this point in the history
  • Loading branch information
jposada202020 committed Jul 28, 2023
1 parent 8fc78d5 commit 0693e3c
Show file tree
Hide file tree
Showing 48 changed files with 99 additions and 99 deletions.
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class-rgx=[A-Z_][a-zA-Z0-9_]+$
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
docstring-min-length=-1
function-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
good-names=r,g,b,w,i,j,k,n,x,y,z,ex,ok,Run,_,cs,TVOC,bar,rx,ry,x0,y0,y1,x1,logging,fillbetween,ucartesian,y2,map,pie,shade
good-names=r,g,b,w,i,j,k,n,x,y,z,ex,ok,Run,_,cs,TVOC,bar,rx,ry,x0,y0,y1,x1,logging,fillbetween,cartesian,y2,map,pie,shade
include-naming-hint=no
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
method-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
Expand Down
8 changes: 4 additions & 4 deletions circuitpython_uplot/bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"""

try:
from circuitpython_uplot.uplot import Uplot
from circuitpython_uplot.plot import Plot
except ImportError:
pass
from math import sin, cos, ceil
Expand All @@ -37,7 +37,7 @@ class Bar:

def __init__(
self,
plot: Uplot,
plot: Plot,
x: list,
y: list,
color: int = 0xFFFFFF,
Expand All @@ -49,7 +49,7 @@ def __init__(
max_value=None,
) -> None:
"""
:param Uplot plot: Plot object for the scatter to be drawn
:param Plot plot: Plot object for the scatter to be drawn
:param list x: x data
:param list y: y data
:param int color: boxes color. Defaults to const:``0xFFFFFF``
Expand Down Expand Up @@ -233,7 +233,7 @@ def _create_projections(self, xstart: int, indice: int, color_lenght: int):
)

def _draw_rectangle(
self, plot: Uplot, x: int, y: int, width: int, height: int, color: int
self, plot: Plot, x: int, y: int, width: int, height: int, color: int
) -> None:
"""
Helper function to draw bins rectangles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

"""
`ucartesian`
`cartesian`
================================================================================
CircuitPython cartesian graph
Expand All @@ -15,7 +15,7 @@
"""
try:
from typing import Optional, Union
from circuitpython_uplot.uplot import Uplot
from circuitpython_uplot.plot import Uplot
except ImportError:
pass
from bitmaptools import draw_line, fill_region
Expand All @@ -26,7 +26,7 @@
__repo__ = "https://github.com/adafruit/CircuitPython_uplot.git"


class ucartesian:
class Cartesian:
"""
Class to draw cartesian plane
"""
Expand Down
2 changes: 1 addition & 1 deletion circuitpython_uplot/fillbetween.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"""
try:
from typing import Optional, Union
from circuitpython_uplot.uplot import Uplot
from circuitpython_uplot.plot import Uplot
except ImportError:
pass
from ulab import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion circuitpython_uplot/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"""
try:
from typing import Union
from circuitpython_uplot.uplot import Uplot
from circuitpython_uplot.plot import Uplot
except ImportError:
pass
from bitmaptools import draw_line, fill_region
Expand Down
2 changes: 1 addition & 1 deletion circuitpython_uplot/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"""
try:
from circuitpython_uplot.uplot import Uplot
from circuitpython_uplot.plot import Uplot
except ImportError:
pass

Expand Down
2 changes: 1 addition & 1 deletion circuitpython_uplot/pie.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"""
try:
from circuitpython_uplot.uplot import Uplot
from circuitpython_uplot.plot import Uplot
except ImportError:
pass

Expand Down
4 changes: 2 additions & 2 deletions circuitpython_uplot/uplot.py → circuitpython_uplot/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

"""
`uplot`
`plot`
================================================================================
CircuitPython Plot Class
Expand Down Expand Up @@ -41,7 +41,7 @@
__repo__ = "https://github.com/jposada202020/CircuitPython_uplot.git"


class Uplot(displayio.Group):
class Plot(displayio.Group):
"""
Canvas Class to add different elements to the screen.
The origin point set by ``x`` and ``y`` properties
Expand Down
2 changes: 1 addition & 1 deletion circuitpython_uplot/polar.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"""
try:
from typing import Optional, Union
from circuitpython_uplot.uplot import Uplot
from circuitpython_uplot.plot import Uplot
except ImportError:
pass
from bitmaptools import draw_line, draw_circle
Expand Down
2 changes: 1 addition & 1 deletion circuitpython_uplot/scatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"""
try:
from typing import Optional, Union
from circuitpython_uplot.uplot import Uplot
from circuitpython_uplot.plot import Uplot
except ImportError:
pass

Expand Down
2 changes: 1 addition & 1 deletion circuitpython_uplot/shade.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"""
try:
from typing import Optional, Union
from circuitpython_uplot.uplot import Uplot
from circuitpython_uplot.plot import Uplot
except ImportError:
pass
from ulab import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion circuitpython_uplot/svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"""
try:
from circuitpython_uplot.uplot import Uplot
from circuitpython_uplot.plot import Uplot
except ImportError:
pass
from bitmaptools import draw_line
Expand Down
2 changes: 1 addition & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Uplot Library
.. automodule:: circuitpython_uplot.pie
:members:

.. automodule:: circuitpython_uplot.ucartesian
.. automodule:: circuitpython_uplot.cartesian
:members:

.. automodule:: circuitpython_uplot.fillbetween
Expand Down
14 changes: 7 additions & 7 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,18 +137,18 @@ Cartesian Advanced Example

Showing the ability to display to graphs in the same plot with different colors

.. literalinclude:: ../examples/uplot_ucartesian_advanced.py
:caption: examples/uplot_ucartesian_advanced.py
.. literalinclude:: ../examples/uplot_cartesian_advanced.py
:caption: examples/uplot_cartesian_advanced.py
:lines: 5-
.. image:: ../docs/uplot_ex11.jpg
.. image:: ../docs/uplot_cartesian_advance.jpg

Cartesian Table Example
---------------------------

Example showing how to add a data table to the plot

.. literalinclude:: ../examples/uplot_ucartesian_table.py
:caption: examples/uplot_ucartesian_table.py
.. literalinclude:: ../examples/uplot_cartesian_table.py
:caption: examples/uplot_cartesian_table.py
:lines: 5-

Lissajous Curves Example
Expand Down Expand Up @@ -235,8 +235,8 @@ Cartesian Animation Example

Cartesian animation example

.. literalinclude:: ../examples/uplot_ucartesian_loggin_data.py
:caption: examples/uplot_ucartesian_loggin_data.py
.. literalinclude:: ../examples/uplot_cartesian_loggin_data.py
:caption: examples/uplot_cartesian_loggin_data.py
:lines: 5-
.. image:: ../docs/uplot_cartesian.gif

Expand Down
10 changes: 5 additions & 5 deletions docs/quick_start.rst
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ to the `ulab` library
from ulab import numpy as np
from circuitpython_uplot.uplot import Uplot
from circuitpython_uplot.ucartesian import ucartesian
from circuitpython_uplot.cartesian import Cartesian
display = board.DISPLAY
plot = Uplot(0, 0, display.width, display.height)
Expand All @@ -184,7 +184,7 @@ After the initial setup we add our xy plane and show our plot

.. code-block:: python
ucartesian(plot, x, y)
Cartesian(plot, x, y)
display.show(plot)
Expand All @@ -203,7 +203,7 @@ the y axis to [0, 1], line color to Green :const:`0x00FF00` and no filling
x = np.linspace(-3, 3, num=50)
constant = 2.0 / np.sqrt(2 * np.pi)
y = constant * np.exp((-(x**2)) / 2.0)
ucartesian(plot, x, y, rangex=[-5, 5], rangey=[0, 1], line_color=0x00FF00)
Cartesian(plot, x, y, rangex=[-5, 5], rangey=[0, 1], line_color=0x00FF00)
if you want to add more than un line to your plot, you could do something like this:
Expand All @@ -214,8 +214,8 @@ if you want to add more than un line to your plot, you could do something like t
x = np.linspace(-4, 4, num=25)
y1 = x**2 / 2
y2 = 2 + x**2 + 3 * x
ucartesian(plot, x, y1)
ucartesian(plot, x, y1)
Cartesian(plot, x, y1)
Cartesian(plot, x, y1)
display.show(plot)
Expand Down
File renamed without changes
2 changes: 1 addition & 1 deletion examples/uplot_bar_3Dbars.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import time
import board
from circuitpython_uplot.uplot import Uplot
from circuitpython_uplot.plot import Uplot
from circuitpython_uplot.bar import Bar


Expand Down
2 changes: 1 addition & 1 deletion examples/uplot_bar_color_changing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import time
import board
from circuitpython_uplot.uplot import Uplot, color
from circuitpython_uplot.plot import Uplot, color
from circuitpython_uplot.bar import Bar

# Setting up the display
Expand Down
2 changes: 1 addition & 1 deletion examples/uplot_bar_colorpalette.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: MIT

import board
from circuitpython_uplot.uplot import Uplot, color
from circuitpython_uplot.plot import Uplot, color
from circuitpython_uplot.bar import Bar

# Setting up the display
Expand Down
2 changes: 1 addition & 1 deletion examples/uplot_bar_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import time
import board
from circuitpython_uplot.uplot import Uplot
from circuitpython_uplot.plot import Uplot
from circuitpython_uplot.bar import Bar


Expand Down
2 changes: 1 addition & 1 deletion examples/uplot_bar_scale_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import time
import board
import displayio
from circuitpython_uplot.uplot import Uplot
from circuitpython_uplot.plot import Uplot
from circuitpython_uplot.bar import Bar

# from uplot_examples import u8
Expand Down
2 changes: 1 addition & 1 deletion examples/uplot_bar_updating_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import time
import board
from circuitpython_uplot.uplot import Uplot, color
from circuitpython_uplot.plot import Uplot, color
from circuitpython_uplot.bar import Bar

# Setting up the display
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import time
import board
from ulab import numpy as np
from circuitpython_uplot.uplot import Uplot
from circuitpython_uplot.ucartesian import ucartesian
from circuitpython_uplot.plot import Uplot
from circuitpython_uplot.cartesian import Cartesian

# Setting up the display
display = board.DISPLAY
Expand All @@ -18,13 +18,13 @@
y = constant * np.exp((-(x**2)) / 2.0)

# Drawing the graph
ucartesian(plot, x, y, rangex=[-5, 5], rangey=[0, 1], line_color=0xFF0000)
Cartesian(plot, x, y, rangex=[-5, 5], rangey=[0, 1], line_color=0xFF0000)

# Creating some points to graph
x = np.linspace(-3, 3, num=50)
constant = 2.0 / np.sqrt(2 * np.pi)
y = constant * np.exp((-(x**2)) / 2.0)
ucartesian(plot, x, y, rangex=[-5, 5], rangey=[0, 1], line_color=0x00FF00)
Cartesian(plot, x, y, rangex=[-5, 5], rangey=[0, 1], line_color=0x00FF00)

# Plotting and showing the plot
display.show(plot)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import terminalio
import board
from adafruit_display_text import label
from circuitpython_uplot.uplot import Uplot, color
from circuitpython_uplot.ucartesian import ucartesian
from circuitpython_uplot.plot import Uplot, color
from circuitpython_uplot.cartesian import Cartesian

# Setting up the display
display = board.DISPLAY
Expand Down Expand Up @@ -83,7 +83,7 @@
display.refresh()

for i, element in enumerate(x):
ucartesian(
Cartesian(
plot_1,
x[0:i],
temp_y[0:i],
Expand All @@ -93,7 +93,7 @@
line_color=color.BLACK,
logging=True,
)
ucartesian(
Cartesian(
plot_2,
x[0:i],
humidity_y[0:i],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import board
from ulab import numpy as np
from table import Table
from circuitpython_uplot.uplot import Uplot, color
from circuitpython_uplot.ucartesian import ucartesian
from circuitpython_uplot.plot import Uplot, color
from circuitpython_uplot.cartesian import Cartesian
from circuitpython_uplot.shade import shade


Expand Down Expand Up @@ -101,7 +101,7 @@ def heat_index(temp, humidity):

# Drawing the graphs
for i in range(40, 110, 10):
ucartesian(plot, x, heat_index(x, i), rangex=[25, 50], rangey=[25, 60])
Cartesian(plot, x, heat_index(x, i), rangex=[25, 50], rangey=[25, 60])

g.append(plot)

Expand Down
2 changes: 1 addition & 1 deletion examples/uplot_display_shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import board
from adafruit_display_shapes.polygon import Polygon
from adafruit_display_shapes.roundrect import RoundRect
from circuitpython_uplot.uplot import Uplot
from circuitpython_uplot.plot import Uplot

# Setting up the display
display = board.DISPLAY
Expand Down
2 changes: 1 addition & 1 deletion examples/uplot_fillbetween.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import time
import board
from ulab import numpy as np
from circuitpython_uplot.uplot import Uplot
from circuitpython_uplot.plot import Uplot
from circuitpython_uplot.fillbetween import Fillbetween


Expand Down
Loading

0 comments on commit 0693e3c

Please sign in to comment.