Skip to content

Commit d811512

Browse files
committed
added optional dependencies for plots submodule, added to readme. Works for pip (once re-released) and still working on conda-forge.
1 parent 478a704 commit d811512

File tree

4 files changed

+38
-35
lines changed

4 files changed

+38
-35
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
cmocean
2+
=======
3+
4+
Documentation available: [http://matplotlib.org/cmocean/](http://matplotlib.org/cmocean/).
5+
6+
Besides Python, the cmocean colormaps are also available for:
7+
8+
* For [MATLAB](http://www.mathworks.com/matlabcentral/fileexchange/57773-cmocean-perceptually-uniform-colormaps) by [Chad Greene](http://www.chadagreene.com/)
9+
* For R: [Oce](http://dankelley.github.io/oce/) oceanographic analysis package by [Dan Kelley](http://www.dal.ca/faculty/science/oceanography/people/faculty/daniel-e-kelley.html) and [Clark Richards](http://clarkrichards.org/)
10+
* For [Ocean Data Viewer](https://github.com/kthyng/cmocean-odv)
11+
* For Generic Mapping Tools (GMT) at [cpt-city](http://soliton.vm.bytemark.co.uk/pub/cpt-city/cmocean/index.html) and on [github](https://github.com/kthyng/cmocean-gmt)
12+
* For [Paraview](https://github.com/kthyng/cmocean-paraview) inspired by [Phillip Wolfram](https://github.com/pwolfram)
13+
* In [Plotly](https://plot.ly/python/cmocean-colorscales/)
14+
* Chad Greene's [Antartic Mapping Tools](http://www.mathworks.com/matlabcentral/fileexchange/47638-antarctic-mapping-tools) in Matlab uses `cmocean`
15+
16+
17+
To install:
18+
``pip install cmocean``
19+
20+
To install with Anaconda:
21+
``conda install -c conda-forge cmocean``
22+
23+
If you want to be able to use the `plots` submodule, you can instead install with:
24+
25+
`pip install "cmocean[plots]"`
26+
27+
which will also install `viscm` and `colorspacious`.

README.rst

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

setup.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,9 @@
44
setup.py for cmocean
55
66
"""
7-
# import shutil
87
import sys
98
from setuptools import setup # to support "develop" mode
109
from setuptools.command.test import test as TestCommand
11-
# from numpy.distutils.core import setup, Extension
12-
13-
# cmocean_mod = Extension(name = "cmocean",
14-
# sources=['rgb/*',
15-
# ],
16-
# )
17-
18-
# print cmocean_mod
1910

2011
class PyTest(TestCommand):
2112
def finalize_options(self):
@@ -27,6 +18,12 @@ def run_tests(self):
2718
errno = pytest.main(self.test_args)
2819
sys.exit(errno)
2920

21+
extras_require={
22+
'plots': ["colorspacious", "viscm"],
23+
}
24+
# # in case I add more later
25+
# extras_require['complete'] = sorted(set(sum(extras_require.values(), [])))
26+
3027
setup(
3128
name = "cmocean",
3229
version = "1.1",
@@ -35,19 +32,18 @@ def run_tests(self):
3532
url = 'https://github.com/matplotlib/cmocean',
3633
download_url = 'https://github.com/matplotlib/cmocean/tarball/1.1',
3734
description = ("Colormaps for Oceanography"),
38-
long_description=open('README.rst').read(),
35+
long_description=open('README.md').read(),
36+
long_description_content_type='text/markdown',
3937
classifiers=[
4038
"Development Status :: 3 - Alpha",
41-
# "Topic :: Utilities",
4239
],
4340
package_data={
4441
'cmocean': ['rgb/*.txt'],
4542
},
4643
packages = ["cmocean"],
47-
# py_modules = cmocean_mod,
4844
ext_package='cmocean',
49-
# ext_modules = [cmocean_mod],
5045
scripts = [],
5146
keywords = ['colormaps', 'oceanography', 'plotting', 'visualization'],
52-
tests_require=['pytest']
47+
tests_require=['pytest'],
48+
extras_require=extras_require
5349
)

tests/test_cmocean.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ def test_cmap_import():
2323
plt.figure()
2424
plt.pcolor(X, cmap=cmap)
2525
plt.title(name)
26+
plt.close(plt.gcf())

0 commit comments

Comments
 (0)