ref: c9a9f8640bc74f286db859da8150d7c8e3b94d88
parent: 494df021aa56fb01c2d3a7de4d202737c6bae104
author: Paul Brossier <piem@piem.org>
date: Tue May 10 15:42:30 EDT 2016
python/demos/demo_pitch.py: clean up imports
--- a/python/demos/demo_pitch.py
+++ b/python/demos/demo_pitch.py
@@ -45,6 +45,7 @@
if 0: sys.exit(0)
#print pitches
+import os.path
from numpy import array, ma
import matplotlib.pyplot as plt
from demo_waveform_plot import get_waveform_plot, set_xlabels_sample2time
@@ -63,14 +64,11 @@
ax1.set_xlabel('')
def array_from_text_file(filename, dtype = 'float'):
- import os.path
- from numpy import array
filename = os.path.join(os.path.dirname(__file__), filename)
return array([line.split() for line in open(filename).readlines()],
dtype = dtype)
ax2 = fig.add_subplot(312, sharex = ax1)
-import sys, os.path
ground_truth = os.path.splitext(filename)[0] + '.f0.Corrected'
if os.path.isfile(ground_truth):
ground_truth = array_from_text_file(ground_truth)