Skip to content

Commit

Permalink
Fix two more tests
Browse files Browse the repository at this point in the history
Order of arguments was wrong on np.arange, and BoroCnstArt needs to be zero to compare to riskless ConsIndShock after changes. Also fixed issue with dimensionality of supremum and infimum.
  • Loading branch information
mnwhite committed Aug 13, 2024
1 parent 739400c commit ea28e3a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions HARK/ConsumptionSaving/tests/test_modelcomparisons.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def setUp(self):
test_dictionary["UnempPrb"] = 0.0
test_dictionary["T_cycle"] = 1
test_dictionary["T_retire"] = 0
test_dictionary["BoroCnstArt"] = None
test_dictionary["BoroCnstArt"] = 0.0

InfiniteType = IndShockConsumerType(**test_dictionary)
InfiniteType.cycles = 0
Expand Down Expand Up @@ -79,7 +79,7 @@ def diffFunc(m):
m
) - self.InfiniteType.cFunc[0](m)

points = np.arange(0.5, mNrmMinInf + aXtraMin, mNrmMinInf + aXtraMax)
points = np.arange(0.5, mNrmMinInf + aXtraMax, mNrmMinInf + aXtraMin)
difference = diffFunc(points)
max_difference = np.max(np.abs(difference))

Expand Down
8 changes: 4 additions & 4 deletions HARK/distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -848,8 +848,8 @@ def __init__(
self.atoms = np.atleast_2d(atoms)
if limit is None:
limit = {
"infimum": np.min(self.atoms, axis=-1, keepdims=True),
"supremum": np.max(self.atoms, axis=-1, keepdims=True),
"infimum": np.min(self.atoms, axis=-1),
"supremum": np.max(self.atoms, axis=-1),
}
self.limit = limit

Expand Down Expand Up @@ -1132,8 +1132,8 @@ def __init__(
attrs = {} if attrs is None else attrs
if limit is None:
limit = {
"infimum": np.min(self.atoms, axis=-1, keepdims=True),
"supremum": np.max(self.atoms, axis=-1, keepdims=True),
"infimum": np.min(self.atoms, axis=-1),
"supremum": np.max(self.atoms, axis=-1),
}
self.limit = limit
attrs.update(limit)
Expand Down

0 comments on commit ea28e3a

Please sign in to comment.