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

Sphinx errors #881

Closed
crusaderky opened this issue Sep 13, 2019 · 5 comments · Fixed by #970
Closed

Sphinx errors #881

crusaderky opened this issue Sep 13, 2019 · 5 comments · Fixed by #970

Comments

@crusaderky
Copy link
Contributor

Downstream of #880, I'm still getting a few errors when running sphinx-build:

pint/docs/plotting.rst:32: WARNING: Exception occurred in plotting plotting-1
 from pint/docs/plotting.rst:
Traceback (most recent call last):
  File "pint/pint/quantity.py", line 1476, in __getitem__
    value = self._magnitude[key]
TypeError: 'int' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "site-packages/matplotlib/sphinxext/plot_directive.py", line 499, in run_code
    exec(code, ns)
  File "<string>", line 13, in <module>
  File "site-packages/matplotlib/axes/_axes.py", line 798, in axhline
    yy = self.convert_yunits(y)
  File "site-packages/matplotlib/artist.py", line 195, in convert_yunits
    return ax.yaxis.convert_units(y)
  File "site-packages/matplotlib/axis.py", line 1521, in convert_units
    if munits.ConversionInterface.is_numlike(x):
  File "site-packages/matplotlib/units.py", line 126, in is_numlike
    for thisx in x:
  File "pint/pint/quantity.py", line 1480, in __getitem__
    "supports indexing".format(self._magnitude))
TypeError: Neither Quantity object nor its magnitude (26400)supports indexing
pint/docs/plotting.rst:52: WARNING: Exception occurred in plotting plotting-2
 from pint/docs/plotting.rst:
Traceback (most recent call last):
  File "pint/pint/quantity.py", line 1476, in __getitem__
    value = self._magnitude[key]
TypeError: 'int' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "site-packages/matplotlib/sphinxext/plot_directive.py", line 499, in run_code
    exec(code, ns)
  File "<string>", line 16, in <module>
  File "site-packages/matplotlib/axes/_axes.py", line 798, in axhline
    yy = self.convert_yunits(y)
  File "site-packages/matplotlib/artist.py", line 195, in convert_yunits
    return ax.yaxis.convert_units(y)
  File "site-packages/matplotlib/axis.py", line 1521, in convert_units
    if munits.ConversionInterface.is_numlike(x):
  File "site-packages/matplotlib/units.py", line 126, in is_numlike
    for thisx in x:
  File "pint/pint/quantity.py", line 1480, in __getitem__
    "supports indexing".format(self._magnitude))
TypeError: Neither Quantity object nor its magnitude (26400)supports indexing

pint/pint/quantity.py:docstring of pint.Quantity:: WARNING: py:class reference target not found: any numeric type                                                                                                                   
pint/pint/quantity.py:docstring of pint.Quantity.from_list:: WARNING: py:class reference target not found: list of pint.Quantity
pint/pint/quantity.py:docstring of pint.Quantity.from_sequence:: WARNING: py:class reference target not found: sequence of pint.Quantity
pint/pint/quantity.py:docstring of pint.quantity.Quantity:: WARNING: py:class reference target not found: any numeric type
pint/pint/quantity.py:docstring of pint.quantity.Quantity.from_list:: WARNING: py:class reference target not found: list of pint.Quantity
pint/pint/quantity.py:docstring of pint.quantity.Quantity.from_sequence:: WARNING: py:class reference target not found: sequence of pint.Quantity
pint/pint/systems.py:docstring of pint.systems.Group.from_lines:: WARNING: py:class reference target not found: str -> None
@jthielen
Copy link
Contributor

The TypeErrors you're receiving look a lot like #751 and #760, which should be fixed by #875 (or the original #764). Would you be able to see if that is the case?

bors bot added a commit that referenced this issue Oct 28, 2019
891: Reimplement _Quantity.__iter__ to return an iterator r=hgrecco a=jthielen

This PR implements the fix suggested by @crusaderky in #751 (comment). Also, adds a test using `np.iterable()`.

- Closes #751 
- Closes #760 
- Should resolve the `TypeError`s in #881 (not sure if it should close it though, since it looks like there were also some extra warnings to be resolved)

Co-authored-by: Jon Thielen <[email protected]>
@hgrecco
Copy link
Owner

hgrecco commented Dec 21, 2019

I am not getting this error any more, @crusaderky can you comment?

@crusaderky
Copy link
Contributor Author

Sorry I won't have access to a computer until Jan 2nd

@crusaderky
Copy link
Contributor Author

crusaderky commented Jan 6, 2020

On readthedocs, something is going horribly wrong - it's still using Python 2.7, which fails to parse any source file:
https://readthedocs.org/projects/pint/builds/10207877/

For the same reason, intersphinx is failing to generate references in objects.inv to pint.UnitRegistry, pint.Quantity, etc.

Locally, I'm getting several pages of errors, including (but not limited to) many " WARNING: Unexpected section title." which denote the numpy sphinx markdown isn't installed.

@hgrecco
Copy link
Owner

hgrecco commented Jan 6, 2020

I have changed read the docs to cpython 3.X. The docs, while not perfect, should be usable for 0.10.

@bors bors bot closed this as completed in a70be48 Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants