Skip to content

Commit 35c2c8b

Browse files
committed
Permit comment headers in RGB cmap/cycle files
1 parent 60a28b9 commit 35c2c8b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

proplot/styletools.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2848,8 +2848,11 @@ def _warn_or_raise(msg):
28482848
# NOTE: This appears to be biggest import time bottleneck! Increases
28492849
# time from 0.05s to 0.2s, with numpy loadtxt or with this regex thing.
28502850
delim = re.compile(r'[,\s]+')
2851-
data = [delim.split(line.strip())
2852-
for line in open(filename).readlines() if line.strip()]
2851+
data = [
2852+
delim.split(line.strip())
2853+
for line in open(filename).readlines()
2854+
if line.strip() and line.strip()[0] != '#'
2855+
]
28532856
try:
28542857
data = [[float(num) for num in line] for line in data]
28552858
except ValueError:

0 commit comments

Comments
 (0)