Skip to content

Commit

Permalink
Add test for make_figs()
Browse files Browse the repository at this point in the history
  • Loading branch information
mnwhite committed Feb 20, 2024
1 parent 6e8e2db commit b3baff4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions HARK/tests/test_HARKutilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""
# Bring in modules we need
import unittest
import matplotlib.pyplot as plt
from types import SimpleNamespace

import numpy as np
Expand All @@ -14,7 +15,7 @@
CRRAutilityPPP,
CRRAutilityPPPP,
)
from HARK.utilities import construct_assets_grid
from HARK.utilities import construct_assets_grid, make_figs


class testsForHARKutilities(unittest.TestCase):
Expand Down Expand Up @@ -66,7 +67,7 @@ def test_CRRAutilityPPPP(self):
self.derivative_func_comparison(CRRAutilityPPPP, CRRAutilityPPP)

def test_asset_grid(self):
# test linear asset grid
# Test linear asset grid

params = {
"aXtraMin": 0.0,
Expand All @@ -83,3 +84,10 @@ def test_asset_grid(self):
test = np.unique(np.diff(aXtraGrid).round(decimals=3))

self.assertEqual(test.size, 1)

def test_make_figs(self):
# Test the make_figs() function with a trivial output
plt.figure()
plt.plot(np.linspace(1,5,40),np.linspace(4,8,40) )
make_figs('test', True , False, target_dir='')
plt.clf()

0 comments on commit b3baff4

Please sign in to comment.