Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added typestring parser checker #1402

Merged
merged 31 commits into from May 7, 2021
Merged
Changes from 12 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
796dfa7
Added typestring parser checker
Nikhil0504 Apr 24, 2021
7b641c0
Updated some errors
Nikhil0504 Apr 24, 2021
a960bac
Update
Nikhil0504 Apr 24, 2021
91724ea
Checking if installation wokrs
Nikhil0504 Apr 25, 2021
de6c15a
Trying again
Nikhil0504 Apr 25, 2021
5af2882
Updates
Nikhil0504 Apr 25, 2021
0054cf1
Another Update
Nikhil0504 Apr 25, 2021
7d29612
Update pyproject.toml
Nikhil0504 Apr 26, 2021
9d9b2b1
Update documentation.rst
Nikhil0504 Apr 26, 2021
da941c2
Merge branch 'master' into typestring_parser
Nikhil0504 Apr 26, 2021
b3301f6
Update requirements.txt
Nikhil0504 Apr 27, 2021
279e718
Update
Nikhil0504 Apr 28, 2021
c1f868c
syntax highlighting should work?
Nikhil0504 Apr 28, 2021
0d194c8
Update
Nikhil0504 Apr 28, 2021
611cfcd
Reverted back
Nikhil0504 Apr 28, 2021
9074967
Will this work?
Nikhil0504 Apr 29, 2021
d83e9fc
Update
Nikhil0504 Apr 29, 2021
5c79f5e
Still trying
Nikhil0504 Apr 29, 2021
71f6de8
Update
Nikhil0504 Apr 29, 2021
23de171
Update again
Nikhil0504 Apr 29, 2021
9b33fd9
Fixed the indentation issues
Nikhil0504 Apr 30, 2021
9a8dc83
Update
Nikhil0504 Apr 30, 2021
f6707ff
updated code block
Nikhil0504 May 1, 2021
f092a6d
Update again
Nikhil0504 May 1, 2021
d6036a0
Update
Nikhil0504 May 2, 2021
45bd43d
Update again with blackendocs
Nikhil0504 May 2, 2021
2d03500
Update documentation.rst
Nikhil0504 May 2, 2021
443318c
Added skip option to doctests
Nikhil0504 May 2, 2021
09f0157
Added the link
Nikhil0504 May 2, 2021
c40b742
Update link
Nikhil0504 May 2, 2021
a8cd95b
Merge branch 'master' into typestring_parser
Nikhil0504 May 7, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 19 additions & 1 deletion docs/source/contributing/documentation.rst
Expand Up @@ -91,7 +91,7 @@ Example:

See an example on list item 4.

.. NOTE::
.. note::
markromanmiller marked this conversation as resolved.
Show resolved Hide resolved

When documenting varargs (args and kwargs), make sure to
document them by listing the possible types of each value specified,
Expand Down Expand Up @@ -318,6 +318,24 @@ elements that are either a ``str`` or ``None``;
``(str, int)``; ``Tuple[:class:`int`, ...]`` for a tuple of variable
length with only integers.

.. note::
As a helper for tool for typesets, you can use ``typestring-parser`` which can
Nikhil0504 marked this conversation as resolved.
Show resolved Hide resolved
be accessed by first downloading it via ``pip`` - ``pip install typestring-parser`` and
Nikhil0504 marked this conversation as resolved.
Show resolved Hide resolved
then using ``from typestring_parser import parse``.

Example::

from typestring_parser import parse

>>> parse('int')
<class 'int'>
>>> parse('int or str')
typing.Union[int, str]
>>> parse('list of str or str')
typing.Union[typing.List[str], str]
>>> parse('list of (int, str)')
typing.List[typing.Tuple[int, str]]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't render properly with syntax highlighting
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No let's not have it as it just makes the CI fail.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would think there's some way to have a code block highlighted in the documentation, but not run - right? @naveen521kk

If not, this is definitely not a breaking change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nikhil0504 I know how to do this without breaking things, but I want you to search or rather explore to find things out.
You can easily add syntax highlighting, browse through though how it is done in other parts of manim itself or look at the reStructuredText Primer from sphinx or search the internet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, I tried fixing the issue and couldn't find a solution for it. Is it possible for you to fix it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.



Adding type hints to functions and parameters
---------------------------------------------
Expand Down