Skip to content

Commit

Permalink
viewf test more verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Havens committed Apr 8, 2021
1 parent 539b404 commit c5e37a2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions notebooks/viewf_theory.ipynb
Expand Up @@ -188,6 +188,13 @@
"\n",
"plt.show()\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
1 change: 0 additions & 1 deletion setup.py
Expand Up @@ -37,7 +37,6 @@
"hor1d.c",
]],
include_dirs=[numpy.get_include()],
# define_macros=[('NPY_NO_DEPRECATED_API', 'NPY_1_7_API_VERSION')],
# extra_compile_args=['-O3'],
# extra_link_args=['-O3'],
directives={'linetrace': False, 'language_level': 3}
Expand Down
9 changes: 5 additions & 4 deletions topocalc/tests/test_viewf.py
Expand Up @@ -19,9 +19,9 @@ def test_theory_edge(self):
svf, tvf = viewf(dem, spacing=10)

# The top should all be ones with 100% sky view
self.assertTrue(
np.array_equal(svf[:, :24],
np.ones_like(svf[:, :24]))
np.testing.assert_equal(
svf[:, :24],
np.ones_like(svf[:, :24])
)

# The edge should be 50% or 0.5 svf
Expand All @@ -39,7 +39,8 @@ def test_viewf_errors_dem(self):
def test_viewf_errors_angles(self):
"""Test viewf nangles errors"""

self.assertRaises(ValueError, viewf, np.ones((10, 1)), 10, nangles=10)
self.assertRaises(ValueError, viewf, np.ones(
(10, 1)), 10, nangles=10)

def test_viewf_errors_sin_slope(self):
"""Test viewf sin_slope errors"""
Expand Down

0 comments on commit c5e37a2

Please sign in to comment.