Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhahn committed Jul 13, 2024
1 parent c379f08 commit 44bc5c8
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions tests/test_construction.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,13 @@
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

"""
Test Fibonacci grid construction.
"""

import os
import unittest
from tempfile import mkdtemp

import numpy as np

from fibgrid.construction import compute_fib_grid, write_grid
from fibgrid.realization import read_grid
from fibgrid.construction import compute_fib_grid


class TestConstruction(unittest.TestCase):
Expand All @@ -55,22 +49,9 @@ def test_fibgrid(self):
"""
for n in self.n:
points, gpi, lon, lat = compute_fib_grid(n)
np.testing.assert_equal(points, np.arange(-n, n+1))
np.testing.assert_equal(points, np.arange(-n, n + 1))
np.testing.assert_equal(gpi, np.arange(points.size))

def test_read_write_fibgrid(self):
"""
Test read/write Fibonacci grid.
"""
for geodatum in self.geodatum:
for n in self.n:
filename = os.path.join(
self.test_path, 'fibgrid_{}_n{}.nc'.format(
geodatum.lower(), n))
write_grid(filename, n)
data = read_grid(filename)
np.testing.assert_equal(data['gpi'], np.arange(n*2+1))


if __name__ == '__main__':
unittest.main()

0 comments on commit 44bc5c8

Please sign in to comment.