diff --git a/.gitignore b/.gitignore index adc083f6384aa482570c2627a9caf8f5e7d95db9..9b30bae1706b02cc042d976744c0defeb94bd818 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/setup.cfg b/setup.cfg index 40b32de217f739674405fdccd27ad13a5f986f27..aa1d709fbe2d258183ac9990729b8ab6bc509f98 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 diff --git a/tests/testsuite.py b/tests/testsuite.py index e833720c2fb1818d6f4e80d974eb3408063573c4..614b76c005f54b9a714a6bbbbb0e49582d198685 100644 --- a/tests/testsuite.py +++ b/tests/testsuite.py @@ -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')) diff --git a/wetb/dlc/high_level.py b/wetb/dlc/high_level.py index df8c5eb5d9b04e193a9d74c6dc3c895f07bd42a4..de5029011bdead7ef11242f2da64fe15131e1cc3 100644 --- a/wetb/dlc/high_level.py +++ b/wetb/dlc/high_level.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 diff --git a/wetb/hawc2/htc_file.py b/wetb/hawc2/htc_file.py index d875d1ed7764078bd6c9a23de56009ca63f8a036..9d432fd1055a21026730dc69235ad714ddd9a5a5 100644 --- a/wetb/hawc2/htc_file.py +++ b/wetb/hawc2/htc_file.py @@ -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: diff --git a/wetb/wind/tests/test_Shear.py b/wetb/wind/tests/test_Shear.py index 1e26306314847ae2eff54bd15cfea1659cd73f65..981d4ac61c6c3c94983237ef230d31dea6fd749b 100644 --- a/wetb/wind/tests/test_Shear.py +++ b/wetb/wind/tests/test_Shear.py @@ -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()