Skip to content

Commit 53aff70

Browse files
committed
Code qaulity, Colormap.from_list improvements, cyclic + transparent maps, more docs
1 parent e9e8634 commit 53aff70

20 files changed

+849
-578
lines changed

.codacy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
exclude_paths:
33
- 'docs/**'
4+
- 'proplot/tests/**'
45
- 'proplot/fonts/**'
56
- 'proplot/colors/**'
67
- 'proplot/cycles/**'
78
- 'proplot/cmaps/**'
8-
- 'proplot/cmaps_rejects/**'
File renamed without changes.

.gitignore

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,26 @@ build
88
dist
99
*.egg-info
1010

11-
# Builds made during testing
11+
# Local docs builds
1212
docs/api
1313
docs/_build
1414

15-
# Deleted
16-
trash
17-
notebooks*
18-
garbage
15+
# Notebook stuff
16+
**/tests/*.ipynb
17+
.ipynb_checkpoints
1918

2019
# Python extras
2120
*.log
2221
*.pyc
2322
.*.pyc
2423
__pycache__
2524

26-
# Notebooks
27-
# NOTE: For now ignore, contributors just need RST files to build docs and
28-
# have personal control over quickstart.
29-
**/tests/*.ipynb
30-
.ipynb_checkpoints
31-
3225
# OS files
3326
.DS_Store
3427
.DS_Store?
3528
._*
3629
.Trashes
30+
31+
# Old files
32+
trash
33+
garbage

HOWTOCONTRIBUTE.rst

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ Contribution guide
33
==================
44

55
Contributions are highly welcomed and appreciated. Every little help counts,
6-
so do not hesitate! You can make a high impact on ``proplot`` just by using it and
6+
so do not hesitate! You can make a high impact on ProPlot just by using it and
77
reporting `issues <https://github.com/lukelbd/proplot/issues>`__.
88

99
The following sections cover some general guidelines
10-
regarding development in ``proplot`` for maintainers and contributors.
10+
regarding development in ProPlot for maintainers and contributors.
1111
Nothing here is set in stone and can't be changed.
1212
Feel free to suggest improvements or changes in the workflow.
1313

@@ -16,7 +16,7 @@ Feature requests and feedback
1616

1717
We are eager to hear about your requests for new features and any suggestions about the
1818
API, infrastructure, and so on. Feel free to submit these as
19-
`issues <https://github.com/lukelbd/proplot/issues/new>`__ with the label "feature request."
19+
`issues <https://github.com/lukelbd/proplot/issues/new>`__ with the label "feature."
2020

2121
Please make sure to explain in detail how the feature should work and keep the scope as
2222
narrow as possible. This will make it easier to implement in small PRs.
@@ -25,14 +25,14 @@ narrow as possible. This will make it easier to implement in small PRs.
2525
Report bugs
2626
===========
2727

28-
Report bugs for ``proplot`` in the `issue tracker <https://github.com/lukelbd/proplot/issues>`__
28+
Report bugs for ProPlot in the `issue tracker <https://github.com/lukelbd/proplot/issues>`__
2929
with the label "bug".
3030

3131
If you are reporting a bug, please include:
3232

3333
* Your operating system name and version.
3434
* Any details about your local setup that might be helpful in troubleshooting,
35-
specifically the Python interpreter version, installed libraries, and ``proplot``
35+
specifically the Python interpreter version, installed libraries, and ProPlot
3636
version.
3737
* Detailed steps to reproduce the bug.
3838

@@ -50,7 +50,7 @@ Talk to developers to find out how you can fix specific bugs.
5050
Write documentation
5151
===================
5252

53-
`proplot` could always use better documentation. For small changes, you can edit documentation files directly in the GitHub web interface,
53+
ProPlot could always use better documentation. For small changes, you can edit documentation files directly in the GitHub web interface,
5454
without using a local copy.
5555

5656
* The documentation is written in reStructuredText with `numpydoc <https://numpydoc.readthedocs.io/en/latest/>`__ style headers.
@@ -75,7 +75,7 @@ Preparing pull requests
7575

7676
#. Fork the
7777
`proplot GitHub repository <https://github.com/lukelbd/proplot>`__. It's
78-
fine to use ``proplot`` as your fork repository name because it will live
78+
fine to use ProPlot as your fork repository name because it will live
7979
under your user.
8080

8181
#. Clone your fork locally using `git <https://git-scm.com/>`__, connect your repository
@@ -105,10 +105,13 @@ Preparing pull requests
105105
repo storage size and lets us use
106106
`nbsphinx <https://nbsphinx.readthedocs.io/en/0.4.3/>`__
107107
to test each ``git push``, since ``nbsphinx`` must then re-run every cell.
108-
The ``git config`` command configures the filters referenced in
109-
``proplot/.gitattributes`` with the options declared in ``proplot/.gitconfig``.
110108

111-
#. Make an editable install of proplot by running:
109+
The ``git config`` command associates the filters declared in
110+
``proplot/.gitattributes`` with the operations described in ``proplot/.gitconfig``
111+
by adding them to the *recognized* local configuration file
112+
``proplot/.git/config``.
113+
114+
#. Make an editable install of ProPlot by running:
112115

113116
.. code-block:: bash
114117
@@ -127,19 +130,16 @@ Preparing pull requests
127130
The commit messages should be short, sweet, and use the imperative mood,
128131
e.g. "Fix bug" instead of "Fixed bug".
129132

130-
#. Run all the tests. Now running tests is as simple as issuing this command:
131-
132-
.. code-block:: bash
133-
134-
coverage run --source proplot -m py.test
135-
136-
This command will run tests via the ``pytest`` tool against Python 3.7.
137-
133+
..
134+
#. Run all the tests. Now running tests is as simple as issuing this command:
135+
.. code-block:: bash
136+
coverage run --source proplot -m py.test
137+
This command will run tests via the ``pytest`` tool against Python 3.7.
138138
139139
#. Create a new changelog entry in ``CHANGELOG.rst``:
140140

141141
- The entry should be entered as:
142-
142+
143143
.. code-block::
144144
145145
<description> (:pr:`<PR number>`) `<author name>`_
@@ -159,13 +159,13 @@ Preparing pull requests
159159
base: master
160160
161161
Note that you can create the Pull Request while you're working on this. The PR will update
162-
as you add more commits. ``proplot`` developers and contributors can then review your code
162+
as you add more commits. ProPlot developers and contributors can then review your code
163163
and offer suggestions.
164164

165165
Release procedure
166166
=================
167167

168-
``proplot`` follows semantic versioning, e.g., v1.0.0. A major version causes incompatible
168+
ProPlot follows semantic versioning, e.g., v1.0.0. A major version causes incompatible
169169
API changes, a minor version adds functionality, and a patch covers bug fixes.
170170

171171
#. Create a new branch ``release-vX.x.x`` with the version for the release.

README.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. image:: docs/_static/logo_long.png
22
:width: 1000px
33

4-
|build-status| |coverage| |quality| |docs| |license| |pr-welcome| |donations|
4+
|build-status| |coverage| |quality| |docs| |license| |gitter| |pr-welcome| |donations|
55

66
A comprehensive, easy-to-use `matplotlib <https://matplotlib.org/>`__ wrapper for making beautiful, publication-quality graphics.
77

@@ -15,8 +15,6 @@ Donations
1515
=========
1616
At well over 10,000 lines of code, this package took a huge amount of time to write and an equally huge amount of time to share online -- especially with my day job as a graduate student. If ProPlot has been useful for you, consider clicking the `"donate" badge <https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VMJSNABTFF4AA&source=url>`__ and sending me a small donation.
1717

18-
.. Links and badges
19-
2018
.. |build-status| image:: https://img.shields.io/travis/lukelbd/proplot.svg?style=flat
2119
:alt: build status
2220
:target: https://travis-ci.org/lukelbd/proplot
@@ -37,6 +35,10 @@ At well over 10,000 lines of code, this package took a huge amount of time to wr
3735
:alt: docs
3836
:target: https://proplot.readthedocs.io/en/latest/?badge=latest
3937

38+
.. |gitter| image:: https://badges.gitter.im/gitterHQ/gitter.svg
39+
:alt: gitter
40+
:target: https://gitter.im/pro-plot/community
41+
4042
.. |pr-welcome| image:: https://img.shields.io/badge/PR-Welcome-%23FF8300.svg?
4143
:alt: PR welcome
4244
:target: https://git-scm.com/book/en/v2/GitHub-Contributing-to-a-Project

docs/.gitattributes

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/conf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@
6767
'pr': ('https://github.com/lukelbd/proplot/pull/%s', 'GH#'),
6868
}
6969

70+
# Give *lots* of time for cell execution! The projection tables
71+
# in particular are massive.
72+
nbsphinx_timeout = 120
73+
7074
# Do not run doctest tests, these are just to show syntax and expected
7175
# output may be graphical
7276
doctest_test_doctest_blocks = ''

docs/cycles.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
"ax.format(title='Cycle from color')\n",
125125
"# Example 2\n",
126126
"ax = axs[1]\n",
127-
"cycle = plot.Cycle('blues', 'reds', 'oranges', 15, left=[0.1]*3)\n",
127+
"cycle = plot.Cycle('blues', 'reds', 'oranges', 15, left=0.1)\n",
128128
"lines = ax.plot(data[:,:15], cycle=cycle, lw=5)\n",
129129
"f.colorbar(lines, loc='b', col=2, values=np.arange(0,len(lines)), locator=2)\n",
130130
"f.legend(lines, loc='b', col=2, labels=np.arange(0,len(lines)), ncols=4)\n",

docs/faq.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Why didn't you add to matplotlib directly?
2323

2424
Since ProPlot is built right into the matplotlib API, you might be wondering why we didn't contribute to the matplotlib project directly. The main answer is *speed* and *autonomy*, but there are a few practical limitations:
2525

26-
* Certain features directly conflict with matplotlib. For example, ProPlot's "smart tight layout" conflicts with matplotlib's `tight layout <https://matplotlib.org/tutorials/intermediate/tight_layout_guide.html>`__ by permitting *fluid figure dimensions*. Also, the new `~proplot.subplots.FlexibleGridSpec` class permits *variable spacing* between rows and columns, and specifies spacing in *physical units* instead of figure-relative and axes-relative units.
26+
* Certain features directly conflict with matplotlib. For example, ProPlot's tight layout algorithm conflicts with matplotlib's `tight layout <https://matplotlib.org/tutorials/intermediate/tight_layout_guide.html>`__ by permitting *fluid figure dimensions*, and the `~proplot.subplots.FlexibleGridSpec` class permits *variable spacing* between rows and columns and uses *physical units* rather than figure-relative and axes-relative units.
2727
* Other features may be too redundant. For example, `~proplot.axes.Axes.format` is convenient, but the same tasks can be accomplished with existing axes and axis "setter" methods. Also, some of the functionality of `~proplot.subplots.subplots` can be replicated with `axes_grid1 <https://matplotlib.org/mpl_toolkits/axes_grid1/index.html>`__. Following `TOOWTDI <https://wiki.python.org/moin/TOOWTDI>`__ philosophy, these features should probably not be integrated.
2828

2929
Nevertheless, if any core matplotlib think that some of ProPlot's features should be added to matplotlib, please contact core developer `Luke Davis <https://github.com/lukelbd>`__ and let him know!

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# since otherwise setup.py will not think it is necessary to rebuild
77
lxml>=4.0.0
88
pyyaml>=5.0.0
9+
sphinx>=2.2.0
910
numpy>=1.14
1011
ipython>=7.0.0
1112
ipykernel>=5.0.0

0 commit comments

Comments
 (0)