Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
Found via `codespell -L inout,whis,vermillion,applys,ans` and `typos
--hidden --format brief`
  • Loading branch information
kianmeng committed Jun 12, 2024
1 parent e7b8fda commit 8685efb
Show file tree
Hide file tree
Showing 40 changed files with 84 additions and 84 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ $ pip install 'plotnine[extra]' # 2. includes extra/optional packages
$ pip install 'plotnine[test]' # 3. testing
$ pip install 'plotnine[doc]' # 4. generating docs
$ pip install 'plotnine[dev]' # 5. development (making releases)
$ pip install 'plotnine[all]' # 6. everyting
$ pip install 'plotnine[all]' # 6. everything

# Or using conda
$ conda install -c conda-forge plotnine
Expand Down
2 changes: 1 addition & 1 deletion doc/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
EXAMPLES_DIR = DOC_DIR / "reference" / "examples"
TUTORIALS_DIR = DOC_DIR / "tutorials"

# The varibables file holds the version
# The variables file holds the version
variables_filepath = DOC_DIR / "_variables.yml"
VARIABLES_TPL = """\
version: {version}
Expand Down
20 changes: 10 additions & 10 deletions doc/changelog.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ title: Changelog
- You can now pickle the drawn matplotlib figures. ({{< issue 729 >}})

- The facet titles in the `strip_text` are now better aligned are appear more
centered withing the `strip_background`.
centered within the `strip_background`.


## v0.12.4
Expand Down Expand Up @@ -411,7 +411,7 @@ title: Changelog
renamed to
[](:class:`~plotnine.themes.themeable.strip_align`),
[](:class:`~plotnine.themes.themeable.strip_align_x`)
[](:class:`~plotnine.themes.themeable.strip_align_y`) repectively.
[](:class:`~plotnine.themes.themeable.strip_align_y`) respectively.

- [](:class:`~plotnine.themes.themeable.subplots_adjust`) has been deprecated.
You no longer need to use `theme(subplots_adjust={"right": 0.85})`{.py} and
Expand Down Expand Up @@ -475,7 +475,7 @@ not exist, got no description. This release is fixes error.
### New Features

- [](:class:`~plotnine.geom_ribbon`) acquired new parameter `where`
which can be used shade withing given limits .
which can be used shade within given limits .

- Added support for objects with a `to_pandas` method to convert them to
a pandas dataframe. You can now pass in [polars](https://pola.rs) dataframes.
Expand All @@ -490,7 +490,7 @@ not exist, got no description. This release is fixes error.
- The automatic groups generated by the system and depending on the aesthetic
mappings now only depend those aesthetics that have scales. This is more
strict than has been, should affect very few cases of code that has been
written and it should be less suprising to the users.
written and it should be less surprising to the users.

- [](:class:`~plotnine.geom_area`) and [](:class:`~plotnine.geom_density`)
now default to showing only the upper outline/boundary of the area.
Expand Down Expand Up @@ -604,7 +604,7 @@ not exist, got no description. This release is fixes error.
for gaussian densities with no weights. This was probably a regression.

- [](:class:`~plotnine.geom_map`) can now draw MultiPoints,
MultiLineStrings and MultiPolgons.
MultiLineStrings and MultiPolygons.

- [](:class:`~plotnine.geom_text`) with `adjust_text` can now be used
in more than one layer with good enough results.
Expand Down Expand Up @@ -717,7 +717,7 @@ not exist, got no description. This release is fixes error.

### API Changes

- Changed the default method of caculating bandwidth for all stats that
- Changed the default method of calculating bandwidth for all stats that
use kernel density estimation. The affected stats are
[](:class:`~plotnine.stat_density`),
[](:class:`~plotnine.stat_ydensity`), and
Expand Down Expand Up @@ -842,7 +842,7 @@ not exist, got no description. This release is fixes error.
({{< issue 242 >}})

- Fixed bug in [](:class:`~plotnine.position_dodge`) where by bar plot
could get thinner when facetting and useing `preserve = 'single'`.
could get thinner when facetting and using `preserve = 'single'`.
({{< issue 224 >}})

- Fixed bug in [](:class:`~plotnine.coord_trans`) where if the transformation
Expand Down Expand Up @@ -905,7 +905,7 @@ not exist, got no description. This release is fixes error.
- The `width` of the boxplot can now be set irrespective of the stat.

- The mid-point color of [](:class:`~plotnine.scale_color_distiller`) now
matches that of the trainned data.
matches that of the trained data.

- The way in which layers are created has been refactored to give packages that
that extend plotnine more flexibility in manipulating the layers.
Expand Down Expand Up @@ -952,7 +952,7 @@ not exist, got no description. This release is fixes error.
- Fixed bug in [](:class:`~plotnine.geom_abline`) where passing the mapping as
a keyword parameter lead to a wrong plot. ({{< issue 196 >}})

- Fixed issue where `minor_breaks` for tranformed scaled would have to be given
- Fixed issue where `minor_breaks` for transformed scaled would have to be given
in the transformed coordinates. Know they are given the data coordinates just
like the major `breaks`.

Expand All @@ -965,7 +965,7 @@ not exist, got no description. This release is fixes error.
is controlled by the new `na_translate` option.

- The `minor_breaks` parameter for continuous scales can now be given as an
integer. An integer is taken to controll the number of minor breaks between
integer. An integer is taken to control the number of minor breaks between
any set of major breaks.

## v0.4.0
Expand Down
12 changes: 6 additions & 6 deletions plotnine/_mpl/_plot_side_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
]

# Note
# Margins around the plot are specfied in figure coordinates
# We interprete that value to be a fraction of the width. So along
# Margins around the plot are specified in figure coordinates
# We interpret that value to be a fraction of the width. So along
# the vertical direction we multiply by W/H to get equal space
# in both directions

Expand Down Expand Up @@ -117,7 +117,7 @@ def _legend_size(self) -> TupleFloat2:
"""
Return size of legend in figure coordinates
We need this to accurately justify the legend by proprotional
We need this to accurately justify the legend by proportional
values e.g. 0.2, instead of just left, right, top, bottom &
center.
"""
Expand Down Expand Up @@ -477,7 +477,7 @@ def _calculate_panel_spacing_facet_grid(
sw = theme.getp("panel_spacing_x")
sh = theme.getp("panel_spacing_y") * W / H

# width and height of axes as fraction of figure width & heigt
# width and height of axes as fraction of figure width & height
w = ((spaces.right - spaces.left) - sw * (ncol - 1)) / ncol
h = ((spaces.top - spaces.bottom) - sh * (nrow - 1)) / nrow

Expand Down Expand Up @@ -511,7 +511,7 @@ def _calculate_panel_spacing_facet_wrap(
# +ve: Away from the panel
# 0: Top of the panel
# -ve: Into the panel
# Where values <= -1, put the strip completly into
# Where values <= -1, put the strip completely into
# the panel. We do not worry about larger -ves.
strip_align_x = theme.getp("strip_align_x")

Expand All @@ -527,7 +527,7 @@ def _calculate_panel_spacing_facet_wrap(
sw += max_ylabels_width(pack)
sw += max_yticks_width(pack)

# width and height of axes as fraction of figure width & heigt
# width and height of axes as fraction of figure width & height
w = ((spaces.right - spaces.left) - sw * (ncol - 1)) / ncol
h = ((spaces.top - spaces.bottom) - sh * (nrow - 1)) / nrow

Expand Down
10 changes: 5 additions & 5 deletions plotnine/_mpl/_plotnine_tight_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,24 +159,24 @@ def set_figure_artist_positions(
if pack.plot_title:
ha = theme.getp(("plot_title", "ha"))
pack.plot_title.set_y(sides.t.edge("plot_title"))
horizonally_align_text_with_panels(pack.plot_title, params, ha, pack)
horizontally_align_text_with_panels(pack.plot_title, params, ha, pack)

if pack.plot_subtitle:
ha = theme.getp(("plot_subtitle", "ha"))
pack.plot_subtitle.set_y(sides.t.edge("plot_subtitle"))
horizonally_align_text_with_panels(
horizontally_align_text_with_panels(
pack.plot_subtitle, params, ha, pack
)

if pack.plot_caption:
ha = theme.getp(("plot_caption", "ha"), "right")
pack.plot_caption.set_y(sides.b.edge("plot_caption"))
horizonally_align_text_with_panels(pack.plot_caption, params, ha, pack)
horizontally_align_text_with_panels(pack.plot_caption, params, ha, pack)

if pack.axis_title_x:
ha = theme.getp(("axis_title_x", "ha"), "center")
pack.axis_title_x.set_y(sides.b.edge("axis_title_x"))
horizonally_align_text_with_panels(pack.axis_title_x, params, ha, pack)
horizontally_align_text_with_panels(pack.axis_title_x, params, ha, pack)

if pack.axis_title_y:
va = theme.getp(("axis_title_y", "va"), "center")
Expand All @@ -187,7 +187,7 @@ def set_figure_artist_positions(
set_legends_position(pack.legends, tparams, pack.figure)


def horizonally_align_text_with_panels(
def horizontally_align_text_with_panels(
text: Text, params: GridSpecParams, ha: str | float, pack: LayoutPack
):
"""
Expand Down
2 changes: 1 addition & 1 deletion plotnine/_mpl/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class InsideStrokedRectangle(Rectangle):
@artist.allow_rasterization
def draw(self, renderer):
"""
Draw with the bounds of the rectangle adjusted to accomodate the stroke
Draw with the bounds of the rectangle adjusted to accommodate the stroke
"""
x, y = self.xy
w, h = self.get_width(), self.get_height()
Expand Down
10 changes: 5 additions & 5 deletions plotnine/_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def ninteraction(df: pd.DataFrame, drop: bool = False) -> list[int]:
Returns
-------
out : list
Row asssignments.
Row assignments.
Notes
-----
Expand Down Expand Up @@ -548,7 +548,7 @@ def to_rgba(
alpha: float | Sequence[float] | AnySeries,
) -> Sequence[ColorType] | ColorType:
"""
Covert hex colors to rgba values.
Convert hex colors to rgba values.
Parameters
----------
Expand Down Expand Up @@ -585,7 +585,7 @@ def no_color(c):

def to_rgba_hex(c: ColorType, a: float) -> str:
"""
Conver rgb color to rgba hex value
Convert rgb color to rgba hex value
If color c has an alpha channel, then alpha value
a is ignored
Expand Down Expand Up @@ -1230,14 +1230,14 @@ def simple_table(

def no_init(default: T) -> T:
"""
Set defaut value of a dataclass field that will not be __init__ed
Set default value of a dataclass field that will not be __init__ed
"""
return field(init=False, default=default)


def no_init_mutable(default: T) -> T:
"""
Set defaut value of a dataclass field that will not be __init__ed
Set default value of a dataclass field that will not be __init__ed
"""
return field(init=False, default_factory=lambda: deepcopy(default))

Expand Down
2 changes: 1 addition & 1 deletion plotnine/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def __draw_plots(

def initialise_artist_offsets(n: int):
"""
Initilise artists_offsets arrays to zero
Initialise artists_offsets arrays to zero
Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion plotnine/coords/coord.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def setup_data(self, data: list[pd.DataFrame]) -> list[pd.DataFrame]:
Parameters
----------
data :
Data for alls Layer
Data for all Layer
Returns
-------
Expand Down
4 changes: 2 additions & 2 deletions plotnine/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
faithfuld = pd.read_csv(DATA_DIR / "faithfuld.csv")
faithful = pd.read_csv(DATA_DIR / "faithful.csv")

# For conveniece to the user, we set some columns in these
# For convenience to the user, we set some columns in these
# dataframes to categoricals.
diamonds = pd.read_csv(DATA_DIR / "diamonds.csv")
midwest = pd.read_csv(DATA_DIR / "midwest.csv")
Expand Down Expand Up @@ -288,7 +288,7 @@ def _process_categories():
(https://www.uaf.edu/cfos/people/faculty/detail/kristen-gorman.php)
and the [Palmer Station, Antarctica LTER](https://pallter.marine.rutgers.edu/).
Made conveniently availabe by
Made conveniently available by
[Alison Horst](https://github.com/allisonhorst/palmerpenguins/) to serve as
a dataset exploration and visualisation.
"""
Expand Down
2 changes: 1 addition & 1 deletion plotnine/facets/labelling.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def label_context(
Returns
-------
out : str
Contatenated label values (or pairs of variable names
Concatenated label values (or pairs of variable names
& values)
"""
if len(label_info) == 1:
Expand Down
2 changes: 1 addition & 1 deletion plotnine/facets/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def setup(self, layers: Layers, plot: ggplot):
Create a layout for the panels
The layout is a dataframe that stores all the
structual information about the panels that will
structural information about the panels that will
make up the plot. The actual layout depends on
the type of facet.
Expand Down
2 changes: 1 addition & 1 deletion plotnine/geoms/geom_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
_params.update(
{
# boxstyle is one of
# cirle, larrow, rarrow, round, round4,
# circle, larrow, rarrow, round, round4,
# roundtooth, sawtooth, square
#
# Documentation at matplotlib.patches.BoxStyle
Expand Down
2 changes: 1 addition & 1 deletion plotnine/geoms/geom_raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def draw_panel(
yidx, xidx = nrow - y_pos - 1, x_pos

# Create and "color" the matrix.
# Any gaps left whites (ones) colors pluse zero alpha values
# Any gaps left whites (ones) colors plus zero alpha values
# allows makes it possible to have a "neutral" interpolation
# into the gaps when intervals are uneven.
X = np.ones((nrow, ncol, 4))
Expand Down
4 changes: 2 additions & 2 deletions plotnine/geoms/geom_rect.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def _rectangles_to_polygons(df: pd.DataFrame) -> pd.DataFrame:
"""
Convert rect data to polygons
Paramters
Parameters
---------
df : dataframe
Dataframe with *xmin*, *xmax*, *ymin* and *ymax* columns,
Expand All @@ -128,7 +128,7 @@ def _rectangles_to_polygons(df: pd.DataFrame) -> pd.DataFrame:
ymax_idx = ~ymin_idx

# There are 2 x and 2 y values for each of xmin, xmax, ymin & ymax
# The positions are as layed out in the indexing arrays
# The positions are as laid out in the indexing arrays
# x and y values
x = np.empty(n * 4)
y = np.empty(n * 4)
Expand Down
2 changes: 1 addition & 1 deletion plotnine/geoms/geom_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def __init__(
else:
check_adjust_text()

# Accomodate the old names
# Accommodate the old names
if mapping and "hjust" in mapping:
mapping["ha"] = mapping.pop("hjust")

Expand Down
4 changes: 2 additions & 2 deletions plotnine/guides/guide_colorbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class guide_colorbar(guide):

alpha: Optional[float] = None
"""
Opacity (in the range `[0, 1]`) of the colorbar. The defualt
Opacity (in the range `[0, 1]`) of the colorbar. The default
`None`, is to use the opacity of the plot.
"""

Expand Down Expand Up @@ -284,7 +284,7 @@ def add_gradient_colorbar(
if len(colors) == 1:
colors = [colors[0], colors[0]]

# Number of horizontal egdes(breaks) in the grid
# Number of horizontal edges(breaks) in the grid
# No need to create more nbreak than colors, provided
# no. of colors = no. of breaks = no. of cmap colors
# the shading does a perfect interpolation
Expand Down
2 changes: 1 addition & 1 deletion plotnine/guides/guide_legend.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def create_geoms(self):
will be used in the call to geom.
"""
# A layer either contributes to the guide, or it does not. The
# guide entries may be ploted in the layers
# guide entries may be plotted in the layers
for l in self.plot_layers:
exclude = set()
if isinstance(l.show_legend, dict):
Expand Down
4 changes: 2 additions & 2 deletions plotnine/iapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class scale_view:
scale: scale
aesthetics: list[ScaledAestheticsName]
name: Optional[str]
# Trainned limits of the scale
# Trained limits of the scale
limits: ScaleLimits
# Physical size of scale, including expansions
range: CoordRange
Expand All @@ -53,7 +53,7 @@ class scale_view:
@dataclass
class range_view:
"""
Range information after trainning
Range information after training
"""

range: TupleFloat2
Expand Down
Loading

0 comments on commit 8685efb

Please sign in to comment.