Skip to content

Commit

Permalink
Merge branch 'master' into plumbing/more_param_types
Browse files Browse the repository at this point in the history
  • Loading branch information
Mv77 committed May 1, 2024
2 parents 2c410fd + 8e70825 commit 2c985e0
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 59 deletions.
42 changes: 0 additions & 42 deletions .github/workflows/coverage.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up Python 3.10
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.10" # Interpolation.py doesn't support Python 3.11 [2023-07]
python-version: "3.12"
cache: "pip"
cache-dependency-path: |
requirements/base.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/hark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
max-parallel: 5
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.8, 3.9, "3.10"]
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
python-version: ["3.12"]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion HARK/econforgeinterp.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def _derivs(self, deriv_tuple, *args):
self.f_val,
np.column_stack([x.flatten() for x in array_args]),
out=None,
order=1,
k=1,
diff=str(deriv_tuple),
extrap_mode=self.extrap_mode,
)
Expand Down
14 changes: 8 additions & 6 deletions HARK/tests/test_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_distr_of_function(self):
norm = Normal(mu=-(sig**2) / 2, sigma=sig).discretize(131, method="hermite")
my_logn = distr_of_function(norm, func=lambda x: np.exp(x))
exp = calc_expectation(my_logn)
self.assertAlmostEqual(exp, 1.0)
self.assertAlmostEqual(float(exp), 1.0)

# Function 1 -> n
# Mean and variance of the normal
Expand Down Expand Up @@ -184,7 +184,7 @@ def test_self_dist_of_func(self):
norm = Normal(mu=-(sig**2) / 2, sigma=sig).discretize(131, method="hermite")
my_logn = norm.dist_of_func(lambda x: np.exp(x))
exp = my_logn.expected()
self.assertAlmostEqual(exp, 1.0)
self.assertAlmostEqual(float(exp), 1.0)

# Function 1 -> n
# Mean and variance of the normal
Expand Down Expand Up @@ -327,16 +327,18 @@ def test_Uniform(self):

Uniform().draw(1)[0]

self.assertEqual(
calc_expectation(uni.discretize(10, method="equiprobable")), 0.5
self.assertAlmostEqual(
float(calc_expectation(uni.discretize(10, method="equiprobable"))),
0.5,
)

uni_discrete = uni.discretize(10, method="equiprobable", endpoints=True)

self.assertEqual(uni_discrete.atoms[0][0], 0.0)
self.assertEqual(uni_discrete.atoms[0][-1], 1.0)
self.assertEqual(
calc_expectation(uni.discretize(10, method="equiprobable")), 0.5
self.assertAlmostEqual(
float(calc_expectation(uni.discretize(10, method="equiprobable"))),
0.5,
)

def test_Bernoulli(self):
Expand Down
2 changes: 1 addition & 1 deletion HARK/tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ def setUp(self):
self.test_block_A = model.DBlock(**test_block_A_data)

def test_init(self):
self.assertEquals(self.test_block_A.name, "test block A")
self.assertEqual(self.test_block_A.name, "test block A")
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ classifiers = [
"License :: OSI Approved :: Apache Software License",
"License :: OSI Approved",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
description = "Heterogenous Agents Resources & toolKit"
keywords = ["economics", "modelling", "modeling", "heterogeneity"]
requires-python = ">=3.8"
requires-python = ">=3.10"
dynamic = ["dependencies", "optional-dependencies"]


Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ interpolation>=2.2.3
joblib>=1.2
matplotlib>=3.6
networkx>=3
numba<0.59
numba
numpy>=1.23
pandas>=1.5
quantecon
Expand Down

0 comments on commit 2c985e0

Please sign in to comment.