Skip to content

Commit

Permalink
DOC: Change all single quotes to double
Browse files Browse the repository at this point in the history
  • Loading branch information
has2k1 committed Feb 23, 2024
1 parent b91bead commit beebabb
Show file tree
Hide file tree
Showing 16 changed files with 40 additions and 40 deletions.
18 changes: 9 additions & 9 deletions doc/changelog.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ not exist, got no description. This release is fixes error.
- You can now align the `plot_title` horizontally to the left or right.

```py
theme(plot_title=element_text(ha='left'))
theme(plot_title=element_text(ha="left"))
```

Before, the title was always centered.
Expand Down Expand Up @@ -584,7 +584,7 @@ not exist, got no description. This release is fixes error.
- Fixed issue where a plot has no data and the geoms have no data,
but the mappings are valid. ({{< issue 404 >}})

- Fixed `preserve='single'` in [](:class:`~plotnine.position_dodge`)
- Fixed `preserve="single"` in [](:class:`~plotnine.position_dodge`)
and [](:class:`~plotnine.position_dodge2`) to work for geoms that
only have `x` aesthetic and not `xmin` and `xmax`
e.g [](:class:`~plotnine.geom_text`).
Expand Down Expand Up @@ -631,7 +631,7 @@ not exist, got no description. This release is fixes error.
scale.

- Fixed [](:class:`~plotnine.geom_violin`) and other geoms when used
with `position='dodge'` not to crash when if a layer has an empty
with `position="dodge"` not to crash when if a layer has an empty
group of data.

- Fixed bug in [](:class:`~plotnine.geom_path`) for some cases when groups
Expand All @@ -640,7 +640,7 @@ not exist, got no description. This release is fixes error.
- Fixed all stats that compute kernel density estimates to work when all
the data points are the same. ({{< issue 317 >}})

- Fixed issue where setting the group to a string value i.e. `group='string'`
- Fixed issue where setting the group to a string value i.e. `group="string"`
outside `aes()` failed due to an error.

- Fixed issue where discrete position scales could not deal with fewer limits
Expand Down Expand Up @@ -910,7 +910,7 @@ not exist, got no description. This release is fixes error.
- Fixed bug in discrete scales where a column could not be mapped
to integer values. ({{< issue 108 >}})

- Make it possible to hide the legend with `theme(legend_position='none')`.
- Make it possible to hide the legend with `theme(legend_position="none")`.
({{< issue 119 >}})

- Fixed issue in [](:class:`~plotnine.stat_summary_bin`) where some input
Expand All @@ -922,8 +922,8 @@ not exist, got no description. This release is fixes error.
- Fixed `IndexError` in [](:class:`~plotnine.facet_grid`) when row/column
variable has 1 unique value. ({{< issue 129 >}})

- Fixed [](:class:`~plotnine.facet_grid`) when `scale='free'`,
`scale='free_x'` or `scale='free_y'`, the panels share axes
- Fixed [](:class:`~plotnine.facet_grid`) when `scale="free"`,
`scale="free_x"` or `scale="free_y"`, the panels share axes
along the row or column.

- Fixed [](:class:`~plotnine.geom_boxplot`) so that user can create a boxplot
Expand Down Expand Up @@ -1071,7 +1071,7 @@ not exist, got no description. This release is fixes error.
*(2017-06-22)*

- Fixed bug where manually setting the aesthetic `fill=None` or
`fill='None'` could lead to a black fill instead of an empty
`fill="None"` could lead to a black fill instead of an empty
fill.

- Fixed bug where computed aesthetics could not be used in larger
Expand All @@ -1083,7 +1083,7 @@ not exist, got no description. This release is fixes error.
- Fixed bug where `ggplot(data=df)`{.py} resulted in an exception.

- Fixed missing axis ticks and labels for [](:class:`~plotnine.facet_wrap`)
when the scales are allowed to vary (e.g `scales='free'`) between
when the scales are allowed to vary (e.g `scales="free"`) between
the panels.

- Fixed bug in [](:class:`~plotnine.stat_density`) where changing the
Expand Down
2 changes: 1 addition & 1 deletion plotnine/facets/facet.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def make_figure(self) -> tuple[Figure, list[Axes]]:
if not self.as_table:
axsarr = np.array([row[::-1] for row in axsarr])
else:
raise ValueError(f"Bad value `dir='{self.dir}'` for direction")
raise ValueError(f'Bad value `dir="{self.dir}"` for direction')

axs = axsarr.ravel(order)

Expand Down
4 changes: 2 additions & 2 deletions plotnine/facets/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ def train_position(self, layers: Layers, scales: Scales):
Notes
-----
The number of x or y scales depends on the facetting,
particularly the scales parameter. e.g if `scales='free'`
particularly the scales parameter. e.g if `scales="free"`{.py}
then each panel will have separate x and y scales, and
if `scales='fixed'` then all panels will share an x
if `scales="fixed"`{.py} then all panels will share an x
scale and a y scale.
"""
layout = self.layout
Expand Down
2 changes: 1 addition & 1 deletion plotnine/geoms/annotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class annotate:
You should choose or ignore accordingly.
All `geoms` are created with `stat='identity'`{.py}.
All `geoms` are created with `stat="identity"`{.py}.
"""

_annotation_geom: geom_base_class
Expand Down
6 changes: 3 additions & 3 deletions plotnine/geoms/geom.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class geom(ABC, metaclass=Register):
"""Geom/layer specific dataframe"""

mapping: aes
"""Mappings i.e. `aes(x='col1', fill='col2')`{.py}"""
"""Mappings i.e. `aes(x="col1", fill="col2")`{.py}"""

aes_params: dict[str, Any] = {} # setting of aesthetic
params: dict[str, Any] # parameter settings
Expand Down Expand Up @@ -379,8 +379,8 @@ def draw_unit(
Plot data belonging to a unit.
A matplotlib plot function may require that an aethestic
have a single unique value. e.g. linestyle='dashed' and
not linestyle=['dashed', 'dotted', ...].
have a single unique value. e.g. `linestyle="dashed"`{.py}
and not `linestyle=["dashed", "dotted", ...]`{.py}.
A single call to such a function can only plot lines with
the same linestyle. However, if the plot we want has more
than one line with different linestyles, we need to group
Expand Down
2 changes: 1 addition & 1 deletion plotnine/geoms/geom_boxplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def __init__(
_position = kwargs.get("position", self.DEFAULT_PARAMS["position"])
varwidth = kwargs.get("varwidth", self.DEFAULT_PARAMS["varwidth"])

# varwidth = True is not compatible with preserve='total'
# varwidth = True is not compatible with preserve="total"
if varwidth:
if isinstance(_position, str):
kwargs["position"] = position_dodge2(preserve="single")
Expand Down
6 changes: 3 additions & 3 deletions plotnine/geoms/geom_dotplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def setup_data(self, data: pd.DataFrame) -> pd.DataFrame:
# Issue warnings when parameters don't make sense
if gp["position"] == "stack":
warn(
"position='stack' doesn't work properly with "
'position="stack" doesn"t work properly with '
"geom_dotplot. Use stackgroups=True instead.",
PlotnineWarning,
)
Expand All @@ -82,8 +82,8 @@ def setup_data(self, data: pd.DataFrame) -> pd.DataFrame:
):
warn(
"geom_dotplot called with stackgroups=TRUE and "
"method='dotdensity'. You probably want to set "
"binpositions='all'",
'method="dotdensity". You probably want to set '
'binpositions="all"',
PlotnineWarning,
)

Expand Down
8 changes: 4 additions & 4 deletions plotnine/geoms/geom_ribbon.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ class geom_ribbon(geom):
expression should match the `ymin` value or expression. i.e.
```python
aes(ymin=0, ymax='col1', where='col1 > 0') # good
aes(ymin=0, ymax='col1', where='col1 > 10') # bad
aes(ymin=0, ymax="col1", where="col1 > 0") # good
aes(ymin=0, ymax="col1", where="col1 > 10") # bad
aes(ymin=col2, ymax='col1', where='col1 > col2') # good
aes(ymin=col2, ymax='col1', where='col1 > col3') # bad
aes(ymin=col2, ymax="col1", where="col1 > col2") # good
aes(ymin=col2, ymax="col1", where="col1 > col3") # bad
```
"""
DEFAULT_AES = {
Expand Down
4 changes: 2 additions & 2 deletions plotnine/ggplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,9 +728,9 @@ def myplots():
def facet_pages(column)
base_plot = [
aes(x='wt', y='mpg', label='name'),
aes(x="wt", y="mpg", label="name"),
geom_text(),
]
]
for label, group_data in mtcars.groupby(column):
yield ggplot(group_data) + base_plot + ggtitle(label)
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 @@ -124,7 +124,7 @@ def merge(self, other):
```python
from ggplot import *
p = (
ggplot(aes(x='cut', fill='cut', color='cut'), data=diamonds)
ggplot(aes(x="cut", fill="cut", color="cut"), data=diamonds)
+ stat_bin()
)
```
Expand Down
6 changes: 3 additions & 3 deletions plotnine/scales/limits.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ def get_scale(self, plot):
# aesthetic is mapped to a categorical but the limits
# are not provided in categorical form. We only handle
# the case where the mapping uses an expression to
# conver to categorical e.g `aes(color='factor(cyl)')`.
# However if `'cyl'` column is a categorical and the
# mapping is `aes(color='cyl')`, that will result in
# conver to categorical e.g `aes(color="factor(cyl)")`.
# However if `"cyl"` column is a categorical and the
# mapping is `aes(color="cyl")`, that will result in
# an error. If later case proves common enough then we
# could inspect the data and be clever based on that too!!
ae = self.aesthetic
Expand Down
2 changes: 1 addition & 1 deletion plotnine/stats/smoothers.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def loess(data, xseq, **params):
kwargs["surface"] = "direct"
warnings.warn(
"Making prediction outside the data range, "
"setting loess control parameter `surface='direct'`.",
'setting loess control parameter `surface="direct"`.',
PlotnineWarning,
)

Expand Down
12 changes: 6 additions & 6 deletions plotnine/stats/stat_bindot.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ class stat_bindot(stat):
Number of bins. Overridden by binwidth. If `None`{.py},
a number is computed using the freedman-diaconis method.
binwidth : float, default=None
When `method='dotdensity'`{.py}, this specifies the maximum
binwidth. When `method='histodot'`{.py}, this specifies the
When `method="dotdensity"`{.py}, this specifies the maximum
binwidth. When `method="histodot"`{.py}, this specifies the
binwidth. This supercedes the `bins`.
origin : float, default=None
When `method='histodot'`{.py}, origin of the first bin.
When `method="histodot"`{.py}, origin of the first bin.
width : float, default=0.9
When `binaxis='y'`{.py}, the spacing of the dotstacks for
When `binaxis="y"`{.py}, the spacing of the dotstacks for
dodging.
binaxis : Literal["x", "y"], default="x"
Axis to bin along.
Expand All @@ -60,10 +60,10 @@ class stat_bindot(stat):
drop : bool, default=False
If `True`{.py}, remove all bins with zero counts.
right : bool, default=True
When `method='histodot'`{.py}, `True`{.py} means include right
When `method="histodot"`{.py}, `True`{.py} means include right
edge of the bins and if `False`{.py} the left edge is included.
breaks : FloatArray, default=None
Bin boundaries for `method='histodot'`{.py}. This supercedes the
Bin boundaries for `method="histodot"`{.py}. This supercedes the
`binwidth` and `bins`.
See Also
Expand Down
2 changes: 1 addition & 1 deletion plotnine/stats/stat_sina.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class stat_sina(stat):
bin_limit : int, default=1
If the samples within the same y-axis bin are more
than `bin_limit`, the samples's X coordinates will be adjusted.
This parameter is effective only when `method='counts'`{.py}
This parameter is effective only when `method="counts"`{.py}
random_state : int | ~numpy.random.RandomState, default=None
Seed or Random number generator to use. If `None`, then
numpy global generator [](`numpy.random`) is used.
Expand Down
2 changes: 1 addition & 1 deletion plotnine/stats/stat_ydensity.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class stat_ydensity(stat):
Parameters
----------
{common_parameters}
kernel : str, default='gaussian'
kernel : str, default="gaussian"
Kernel used for density estimation. One of:
```python
Expand Down
2 changes: 1 addition & 1 deletion tests/test_facets.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def test_array_mapping_and_evaluation():
{"x": range(12), "y": range(12), "g": list("abcd") * 3}
)

# should be the same as if color='g'
# should be the same as if color="g"
p = (
ggplot(data, aes("x", "y", color=data["g"]))
+ geom_point(size=4)
Expand Down

0 comments on commit beebabb

Please sign in to comment.