Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Create category.pyi#30093
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Create category.pyi#30093
Conversation
Hi@Santt997, I suggest you install and run the precommit hooks to help fix the linting errorshttps://matplotlib.org/devdocs/devel/development_setup.html#install-pre-commit-hooks |
""" | ||
Plotting of string "category" data: ``plot(['d', 'f', 'a'], [1, 2, 3])`` will | ||
plot three points with x-axis values of 'd', 'f', 'a'. | ||
See :doc:`/gallery/lines_bars_and_markers/categorical_variables` for an | ||
example. | ||
The module uses Matplotlib's `matplotlib.units` mechanism to convert from | ||
strings to integers and provides a tick locator, a tick formatter, and the | ||
`.UnitData` class that creates and stores the string-to-integer mapping. | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The .pyi files don't typically have doc strings
class StrCategoryConverter(ConversionInterface): | ||
@staticmethod | ||
def convert( | ||
value: Union[str, Iterable[str]], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
value:Union[str,Iterable[str]], | |
value:str|Iterable[str], |
The .pyi files typically use the union operator rather than explicit union, please make this change to all the unions in this file
https://mypy.readthedocs.io/en/stable/cheat_sheet_py3.html
class StrCategoryFormatter(ticker.Formatter): | ||
def __init__(self, units_mapping: Dict[str, int]) -> None: ... | ||
def __call__(self, x: float, pos: Optional[int] = None) -> str: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
def__call__(self,x:float,pos:Optional[int]=None)->str: ... | |
def__call__(self,x:float,pos:int|None)->str: ... |
also use the | convetion for optional, seehttps://mypy.readthedocs.io/en/stable/cheat_sheet_py3.html
class UnitData: | ||
_mapping: OrderedDict[Union[str, bytes], int] | ||
def __init__( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think._counter
also needs to be documented
Uh oh!
There was an error while loading.Please reload this page.
PR summary
PR checklist