Skip to content

Commit

Permalink
Cleanup internals and remove premature note box
Browse files Browse the repository at this point in the history
  • Loading branch information
lukelbd committed Jan 25, 2022
1 parent 9bded5a commit f33edfe
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
7 changes: 0 additions & 7 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ is deprecated (see :ref:`What's New <whats_new>`). However, proplot adheres to
deprecated functionality will still work and issue warnings rather than errors
until the first major release (version 1.0.0).

.. important::

The color transformation functions like `to_rgba` and `scale_luminance` from
proplot < 0.10.0 can now be found as methods on the new `~proplot.colors.Color`
class. Note that old code that uses commands like ``pplt.to_rgba()`` and
``pplt.scale_luminance()`` will still work (but result in a deprecation warning).

.. important::

The documentation for "wrapper" functions like `standardize_1d` and `cmap_changer`
Expand Down
4 changes: 2 additions & 2 deletions proplot/axes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2724,8 +2724,8 @@ def set_prop_cycle(self, *args, **kwargs):
# Includes both proplot syntax with positional arguments interpreted as
# color arguments and oldschool matplotlib cycler(key, value) syntax.
if len(args) == 2 and isinstance(args[0], str) and np.iterable(args[1]):
if _pop_props({args[0]: object()}, 'line'):
kwargs = {args[0]: args[1]}
if _pop_props({args[0]: object()}, 'line'): # if a valid line property
kwargs = {args[0]: args[1]} # pass as keyword argument
args = ()
cycle = self._active_cycle = constructor.Cycle(*args, **kwargs)
return super().set_prop_cycle(cycle) # set the property cycler after validation
Expand Down
29 changes: 22 additions & 7 deletions proplot/axes/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2273,11 +2273,26 @@ def _parse_cmap(
return kwargs

def _parse_cycle(
self, ncycle=None, *,
cycle=None, cycle_kw=None, cycle_manually=None, return_cycle=False, **kwargs
self, ncycle=None, *, cycle=None, cycle_kw=None,
cycle_manually=None, return_cycle=False, **kwargs
):
"""
Parse property cycle-related arguments.
Parameters
----------
ncycle : int, optional
The number of samples to draw for the cycle.
cycle : cycle-spec, optional
The property cycle specifier.
cycle_kw : dict-like, optional
The property cycle keyword arguments
cycle_manually : dict-like, optional
Mapping of property cycle keys to plotting function keys. Used
to translate property cycle line properties to scatter properties.
return_cycle : bool, optional
Whether to simply return the property cycle or apply it. The cycle is
only applied (and therefore reset) if it differs from the current one.
"""
# Create the property cycler and update it if necessary
# NOTE: Matplotlib Cycler() objects have built-in __eq__ operator
Expand Down Expand Up @@ -2348,11 +2363,11 @@ def _parse_level_count(
symmetric : bool, optional
Whether the resulting levels should be symmetric about zero.
Parameters
----------
Returns
-------
levels : list of float
The level edges.
kwargs
**kwargs
Unused arguments.
"""
# Input args
Expand Down Expand Up @@ -2467,7 +2482,7 @@ def _parse_level_list(
-------
levels : list of float
The level edges.
kwargs
**kwargs
Unused arguments.
"""
# Helper function that restricts levels
Expand Down Expand Up @@ -2621,7 +2636,7 @@ def _parse_level_lim(
-------
vmin, vmax : float
The minimum and maximum.
kwargs
**kwargs
Unused arguemnts.
"""
# Parse vmin and vmax
Expand Down

0 comments on commit f33edfe

Please sign in to comment.