Skip to content

Commit d9b0032

Browse files
authored
Merge pull request #492 from xylar/fix_sci_viz_colormaps
Fix reading of SciVisColor colormaps
2 parents da03486 + d36f7ab commit d9b0032

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

conda_package/docs/versions.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Documentation On GitHub
3030
`v0.15.0`_ `0.15.0`_
3131
`v0.16.0`_ `0.16.0`_
3232
`v0.17.0`_ `0.17.0`_
33+
`v0.18.0`_ `0.18.0`_
3334
================ ===============
3435

3536
.. _`stable`: ../stable/index.html
@@ -80,3 +81,5 @@ Documentation On GitHub
8081
.. _`0.16.0`: https://github.com/MPAS-Dev/MPAS-Tools/tree/0.16.0
8182
.. _`v0.17.0`: ../0.17.0/index.html
8283
.. _`0.17.0`: https://github.com/MPAS-Dev/MPAS-Tools/tree/0.17.0
84+
.. _`v0.18.0`: ../0.18.0/index.html
85+
.. _`0.18.0`: https://github.com/MPAS-Dev/MPAS-Tools/tree/0.18.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version_info__ = (0, 17, 0)
1+
__version_info__ = (0, 18, 0)
22
__version__ = '.'.join(str(vi) for vi in __version_info__)

conda_package/mpas_tools/viz/SciVisColorColormaps/__init__.py

Whitespace-only changes.

conda_package/mpas_tools/viz/colormaps.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import xml.etree.ElementTree as ET
2-
import pkg_resources
2+
try:
3+
from importlib.resources import files as imp_res_files
4+
except ImportError:
5+
# python<=3.8
6+
from importlib_resources import files as imp_res_files
37
from matplotlib.colors import LinearSegmentedColormap
48
import matplotlib.pyplot as plt
59

@@ -14,9 +18,8 @@ def register_sci_viz_colormaps():
1418
'green-7', 'green-8', 'orange-5', 'orange-6',
1519
'orange-green-blue-gray', 'purple-7', 'purple-8', 'red-1',
1620
'red-3', 'red-4', 'yellow-1', 'yellow-7']:
17-
18-
xmlFile = pkg_resources.resource_filename(
19-
__name__, 'SciVisColorColormaps/{}.xml'.format(mapName))
21+
xmlFile = str(imp_res_files('mpas_tools.viz.SciVisColorColormaps') /
22+
f'{mapName}.xml')
2023
_read_xml_colormap(xmlFile, mapName)
2124

2225

conda_package/recipe/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% set name = "mpas_tools" %}
2-
{% set version = "0.17.0" %}
2+
{% set version = "0.18.0" %}
33

44
package:
55
name: {{ name|lower }}

0 commit comments

Comments
 (0)