Skip to content
Snippets Groups Projects
Commit e425daa0 authored by mads's avatar mads
Browse files

bug fixes

parent a16cc72d
No related branches found
No related tags found
No related merge requests found
......@@ -14,3 +14,4 @@ doctrees
/wetb/dlc/tests/test_files/res_all
/wetb/dlc/tests/test_files/res2_all
/wetb/hawc2/ascii2bin/ascii2bin_dist
/wetb/hawc2/tests/test_files/htcfiles/tmp.htc
......@@ -51,16 +51,16 @@ packages =
[test]
# py.test options when running `python setup.py test`
addopts = tests
#addopts = tests
[pytest]
# Options for py.test:
# Specify command line options as you would do when invoking py.test directly.
# e.g. --cov-report html (or xml) for html/xml output or --junitxml junit.xml
# in order to write a coverage file that can be read by Jenkins.
addopts =
--cov wetb --cov-report term-missing
--verbose
#addopts =
# --cov wetb --cov-report term-missing
# --verbose
[aliases]
docs = build_sphinx
......
......@@ -2,8 +2,6 @@ import glob
import unittest
import os
os.environ['QT_API'] = "pyqt"
def module_strings():
test_file_paths = glob.glob('test_*.py')
#test_file_strings.extend(glob.glob('../wetb/**/test_*.py'))
......
......@@ -76,7 +76,7 @@ class DLCHighLevel(object):
self.dlc_df.columns = columns
else:
raise e
self.dlc_df[vk] = [str(n).lower().replace(vk, "") for n in self.dlc_df[vk]]
self.dlc_df[vk].values[:] = [str(n).lower().replace(vk, "") for n in self.dlc_df[vk]]
if 'psf' not in self.dlc_df:
self.dlc_df['psf'] = 1
......
......@@ -66,7 +66,7 @@ class HTCFile(HTCContents, HTCDefaults):
self.contents[key] = value
def __str__(self):
return "\n".join(self.initial_comments) + "\n" + "".join([c.__str__(1) for c in self])
return "".join(self.initial_comments + [c.__str__(1) for c in self])
def save(self, filename=None):
if filename is None:
......
......@@ -8,7 +8,7 @@ from wetb.utils.geometry import xyz2uvw
import wetb.gtsdf
from wetb.wind.shear import power_shear, fit_power_shear, fit_power_shear_ref, \
log_shear, fit_log_shear, stability_term
from pylab import *
import unittest
......@@ -145,7 +145,7 @@ class TestShear(unittest.TestCase):
plt.plot(u, z, 'r.')
z = np.arange(10, 100)
plt.plot(log_shear(u_star, z0, z), z)
show()
plt.show()
for _zu, b in zip(zu, log_shear(u_star, z0, [85, 21])):
self.assertAlmostEqual(_zu[1], b, 4)
......@@ -156,10 +156,10 @@ class TestShear(unittest.TestCase):
for ustar in [1, 2]:
for z0 in [1, 10]:
z = np.arange(z0, 200)
plot(log_shear(ustar, z0, z), z, label="z0=%d, u*=%d" % (z0, ustar))
yscale('log')
legend()
show()
plt.plot(log_shear(ustar, z0, z), z, label="z0=%d, u*=%d" % (z0, ustar))
plt.yscale('log')
plt.legend()
plt.show()
def test_show_log_shear_stability(self):
if 0:
......@@ -167,10 +167,10 @@ class TestShear(unittest.TestCase):
ustar = 1
z = np.arange(z0, 200)
for L in [-2000, -100, 100, 2000]:
plot(log_shear(ustar, z0, z, L), z, label="L=%d" % (L))
plt.plot(log_shear(ustar, z0, z, L), z, label="L=%d" % (L))
#yscale('log')
legend()
show()
plt.legend()
plt.show()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment