Skip to content

Improvements to Docs for new contributors #19344

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

Merged
merged 6 commits into from
Feb 5, 2021
Merged

Conversation

ianhi
Copy link
Contributor

@ianhi ianhi commented Jan 23, 2021

PR Summary

At least I think they are improvements. I tried to go through the process as if I didn't know and was starting by clicking the contributing tab. These changes address the areas where I felt I would have gotten stuck or knocked off course.

See also: https://discourse.matplotlib.org/t/contributor-onboarding-retention/21714

I tried to make granular commits and leave explanations in the body of the commit messages.

PR Checklist

  • Is Flake 8 compliant (run flake8 on changed files to check).
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).

Copy link
Contributor

@aitikgupta aitikgupta left a comment

Choose a reason for hiding this comment

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

Since we're installing the editable local version, should we also mention something about it?


4. Create a branch to hold your changes::
cd matplotlib
pip install -ve .
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
pip install -ve .
pip install -ve .
NOTE: `-e` flag would make your installation 'editable', such that your work is always
in sync as the installed version. For more details see [ref](https://pip.pypa.io/en/stable/reference/pip_install/#install-editable).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this resolved by entirely deferring this to the standalone dev install page

Comment on lines 117 to 121
4. Enter the directory and install the local version of Matplotlib. For more
detailed instructions on doing this see ref`<installing_for_devs>`::

4. Create a branch to hold your changes::
cd matplotlib
pip install -ve .
Copy link
Member

Choose a reason for hiding this comment

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

This is only half the truth. It's important to set up a dedicated environment (venv or conda) for development and do the editable install there. Otherwise people will corrupt their standard python environment.

I suggest not giving any details here but completely deferring to :ref:`installing_for_devs` .

@ianhi
Copy link
Contributor Author

ianhi commented Feb 4, 2021

Thank you for the reviews - I think I have address all of them. And sorry for the two week wait, it's amazing how a few emails can really make quite a lot of work materialize :P

@ianhi
Copy link
Contributor Author

ianhi commented Feb 4, 2021

I think the doc failures are unrelated:


Unexpected failing examples:
/home/circleci/project/examples/units/ellipse_with_units.py failed leaving traceback:
Traceback (most recent call last):
  File "/home/circleci/project/examples/units/ellipse_with_units.py", line 33, in <module>
    x, y = np.dot(R, [x, y])
  File "<__array_function__ internals>", line 5, in dot
FutureWarning: The input object of type 'TaggedValue' is an array-like implementing one of the corresponding protocols (`__array__`, `__array_interface__` or `__array_struct__`); but not a sequence (or 0-D). In the future, this object will be coerced as if it was first converted using `np.array(obj)`. To retain the old behaviour, you have to either modify the type 'TaggedValue', or assign to an empty array created with `np.empty(correct_shape, dtype=object)`.


/home/circleci/project/examples/units/radian_demo.py failed leaving traceback:
Traceback (most recent call last):
  File "/home/circleci/project/examples/units/radian_demo.py", line 26, in <module>
    axs[0].plot(x, cos(x), xunits=radians)
  File "/home/circleci/project/lib/matplotlib/axes/_axes.py", line 1605, in plot
    lines = [*self._get_lines(*args, data=data, **kwargs)]
  File "/home/circleci/project/lib/matplotlib/axes/_base.py", line 315, in __call__
    yield from self._plot_args(this, kwargs)
  File "/home/circleci/project/lib/matplotlib/axes/_base.py", line 490, in _plot_args
    x = _check_1d(xy[0])
  File "/home/circleci/project/lib/matplotlib/cbook/__init__.py", line 1328, in _check_1d
    return np.atleast_1d(x)
  File "<__array_function__ internals>", line 5, in atleast_1d
  File "/home/circleci/.local/lib/python3.8/site-packages/numpy/core/shape_base.py", line 66, in atleast_1d
    ary = asanyarray(ary)
  File "/home/circleci/.local/lib/python3.8/site-packages/numpy/core/_asarray.py", line 171, in asanyarray
    return array(a, dtype, copy=False, order=order, subok=True)
FutureWarning: The input object of type 'TaggedValue' is an array-like implementing one of the corresponding protocols (`__array__`, `__array_interface__` or `__array_struct__`); but not a sequence (or 0-D). In the future, this object will be coerced as if it was first converted using `np.array(obj)`. To retain the old behaviour, you have to either modify the type 'TaggedValue', or assign to an empty array created with `np.empty(correct_shape, dtype=object)`.


-------------------------------------------------------------------------------

Extension error:
Here is a summary of the problems encountered when running the examples

Unexpected failing examples:
/home/circleci/project/examples/units/ellipse_with_units.py failed leaving traceback:
Traceback (most recent call last):
  File "/home/circleci/project/examples/units/ellipse_with_units.py", line 33, in <module>
    x, y = np.dot(R, [x, y])
  File "<__array_function__ internals>", line 5, in dot
FutureWarning: The input object of type 'TaggedValue' is an array-like implementing one of the corresponding protocols (`__array__`, `__array_interface__` or `__array_struct__`); but not a sequence (or 0-D). In the future, this object will be coerced as if it was first converted using `np.array(obj)`. To retain the old behaviour, you have to either modify the type 'TaggedValue', or assign to an empty array created with `np.empty(correct_shape, dtype=object)`.


/home/circleci/project/examples/units/radian_demo.py failed leaving traceback:
Traceback (most recent call last):
  File "/home/circleci/project/examples/units/radian_demo.py", line 26, in <module>
    axs[0].plot(x, cos(x), xunits=radians)
  File "/home/circleci/project/lib/matplotlib/axes/_axes.py", line 1605, in plot
    lines = [*self._get_lines(*args, data=data, **kwargs)]
  File "/home/circleci/project/lib/matplotlib/axes/_base.py", line 315, in __call__
    yield from self._plot_args(this, kwargs)
  File "/home/circleci/project/lib/matplotlib/axes/_base.py", line 490, in _plot_args
    x = _check_1d(xy[0])
  File "/home/circleci/project/lib/matplotlib/cbook/__init__.py", line 1328, in _check_1d
    return np.atleast_1d(x)
  File "<__array_function__ internals>", line 5, in atleast_1d
  File "/home/circleci/.local/lib/python3.8/site-packages/numpy/core/shape_base.py", line 66, in atleast_1d
    ary = asanyarray(ary)
  File "/home/circleci/.local/lib/python3.8/site-packages/numpy/core/_asarray.py", line 171, in asanyarray
    return array(a, dtype, copy=False, order=order, subok=True)
FutureWarning: The input object of type 'TaggedValue' is an array-like implementing one of the corresponding protocols (`__array__`, `__array_interface__` or `__array_struct__`); but not a sequence (or 0-D). In the future, this object will be coerced as if it was first converted using `np.array(obj)`. To retain the old behaviour, you have to either modify the type 'TaggedValue', or assign to an empty array created with `np.empty(correct_shape, dtype=object)`.

@QuLogic
Copy link
Member

QuLogic commented Feb 4, 2021

If you rebase, it will fix that docs problem.

ianhi and others added 6 commits February 4, 2021 16:54
+ Reword contributing opening paragraph

Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
also remove the $ as they make it more difficult for readers to copy paste

link to more detailed dev install instructions

only link to install page in brief set up docs.
it seems to pair well with the contributor incubator part, and it was somewhat hard to notice where it used to be.
Less mental effort to read this, as no time spent thinking about how different your versions are.
It's super easy to click on that link and then get bogged down in details rather than read the short guide that follows that paragraph.
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
@timhoffm timhoffm added this to the v3.4.0 milestone Feb 5, 2021
@timhoffm timhoffm merged commit 0724d39 into matplotlib:master Feb 5, 2021
@timhoffm
Copy link
Member

timhoffm commented Feb 5, 2021

Thanks @ianhi!

@ianhi ianhi deleted the docs branch February 5, 2021 02:14
@ianhi ianhi mentioned this pull request Feb 5, 2021
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants