Skip to content

Commit 9f59217

Browse files
committed
Remove lxml dependency
1 parent bdfdcb7 commit 9f59217

3 files changed

Lines changed: 5 additions & 8 deletions

File tree

docs/environment.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ dependencies:
1818
- pip
1919
- pip:
2020
- ..
21-
- lxml
2221
- pyyaml
2322
- pyqt5
2423
- nbsphinx

proplot/styletools.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env python3
22
"""
33
Tools for registering and visualizing colormaps, color cycles, color string
4-
names, and fonts. Defines new colormap classes, new colormap normalizer
4+
names, and fonts. New colormap classes, new colormap normalizer
55
classes, and new constructor functions for generating instances of these
6-
classes. Includes related utilities for manipulating colors. See
6+
classes. Related utilities for manipulating colors. See
77
:ref:`Colormaps`, :ref:`Color cycles`, and :ref:`Colors and fonts`
88
for details.
99
"""
@@ -14,7 +14,7 @@
1414
import json
1515
import glob
1616
import cycler
17-
from lxml import etree
17+
from xml.etree import ElementTree
1818
from numbers import Number, Integral
1919
from matplotlib import docstring, rcParams
2020
import numpy as np
@@ -2787,12 +2787,12 @@ def _load_cmap_cycle(filename, cmap=False):
27872787
# https://sciviscolor.org/matlab-matplotlib-pv44/
27882788
elif ext == 'xml':
27892789
try:
2790-
xmldoc = etree.parse(filename)
2790+
doc = ElementTree.parse(filename)
27912791
except IOError:
27922792
_warn_proplot(f'Failed to load {filename!r}.')
27932793
return None, None
27942794
x, data = [], []
2795-
for s in xmldoc.getroot().findall('.//Point'):
2795+
for s in doc.getroot().findall('.//Point'):
27962796
# Verify keys
27972797
if any(key not in s.attrib for key in 'xrgb'):
27982798
_warn_proplot(

requirements.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# Hard requirements
2-
# TODO: Remove lxml after #50 merged
32
# TODO: Remove pyyaml and copy matplotlib's manual parsing approach?
43
matplotlib
54
pyyaml
6-
lxml

0 commit comments

Comments
 (0)