From 8123924423c896f531aa849a3909def10a747da0 Mon Sep 17 00:00:00 2001 From: "Matthew N. White" Date: Wed, 28 Feb 2024 10:40:46 -0500 Subject: [PATCH 1/4] Change repr to describe() When the "parameters code" was added, it specified new behavior for `__repr__()`, listing *all* of the parameters whenever the object was returned to stdout. This is ok sometimes, but generates a massive amount of printed output in lifecycle models. Often the user just wants to do a quick check that an object is the class they think it is, or that there are the right number and kind of things in a list, and this behavior makes that impossible. This commit *only* changes the function name `__repr__` to describe. I.e. the "list everything" behavior is still there, it just needs to be explicitly requested rather than assumed as the default. --- HARK/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HARK/core.py b/HARK/core.py index 71a79e2a9..bae538f1a 100644 --- a/HARK/core.py +++ b/HARK/core.py @@ -323,7 +323,7 @@ def __str__(self): s += ">" return s - def __repr__(self): + def describe(self): return self.__str__() From 28b72a5b7c311aaa27258d0f610bae083e5e497b Mon Sep 17 00:00:00 2001 From: "Matthew N. White" Date: Wed, 28 Feb 2024 10:48:46 -0500 Subject: [PATCH 2/4] Update CHANGELOG Fixed tiny formatting errorS, and missing entry for prior pr. --- Documentation/CHANGELOG.md | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/Documentation/CHANGELOG.md b/Documentation/CHANGELOG.md index 3ac0ab23c..5f3482d89 100644 --- a/Documentation/CHANGELOG.md +++ b/Documentation/CHANGELOG.md @@ -8,17 +8,30 @@ For more information on HARK, see [our Github organization](https://github.com/e ## Changes +### 0.14.1 (IN DEVELOPMENT) + +Release date: ??? + +#### Major Changes + +none + +#### Minor Changes + +- Fixes a bug in make_figs arising from the metadata argument being incompatible with jpg. [#1386](https://github.com/econ-ark/HARK/pull/1386) +- Reverts behavior of the repr method of the Model class, so that long strings aren't generated. Full description is available with describe(). [#1390](https://github.com/econ-ark/HARK/pull/1390) + ### 0.14.0 Release Date: February 12, 2024 -### Major Changes +#### Major Changes - Adds `HARK.core.AgentPopulation` class to represent a population of agents with ex-ante heterogeneous parametrizations as distributions. [#1237](https://github.com/econ-ark/HARK/pull/1237) - Adds `HARK.core.Parameters` class to represent a collection of time varying and time invariant parameters in a model. [#1240](https://github.com/econ-ark/HARK/pull/1240) - Adds `HARK.simulation.monte_carlo` module for generic Monte Carlo simulation functions using Python model configurations. [1296](https://github.com/econ-ark/HARK/pull/1296) -### Minor Changes +#### Minor Changes - Adds option `sim_common_Rrisky` to control whether risky-asset models draw common or idiosyncratic returns in simulation. [#1250](https://github.com/econ-ark/HARK/pull/1250),[#1253](https://github.com/econ-ark/HARK/pull/1253) - Addresses [#1255](https://github.com/econ-ark/HARK/issues/1255). Makes age-varying stochastic returns possible and draws from their discretized version. [#1262](https://github.com/econ-ark/HARK/pull/1262) @@ -35,7 +48,7 @@ Release Date: February 12, 2024 Release Date: February 16, 2023 -### Major Changes +#### Major Changes - Updates the DCEGM tools to address the flaws identified in [issue #1062](https://github.com/econ-ark/HARK/issues/1062). PR: [1100](https://github.com/econ-ark/HARK/pull/1100). - Updates `IndexDstn`, introducing the option to use an existing RNG instead of creating a new one, and creating and storing all the conditional distributions at initialization. [1104](https://github.com/econ-ark/HARK/pull/1104) @@ -62,7 +75,7 @@ Release Date: February 16, 2023 - Reorganizes `HARK.distribution`. All distributions now inherit all features from `scipy.stats`. New `ContinuousFrozenDistribution` and `DiscreteFrozenDistribution` to use `scipy.stats` distributions not yet implemented in HARK. New `Distribution.discretize(N, method = "***")` replaces `Distribution.approx(N)`. New `DiscreteDistribution.limit` attribute describes continuous origin and discretization method. [#1197](https://github.com/econ-ark/HARK/pull/1197). - Creates new class of _labeled_ models under `ConsLabeledModel` that use xarray for more expressive modeling of underlying mathematical and economics variables. [#1177](https://github.com/econ-ark/HARK/pull/1177) -### Minor Changes +#### Minor Changes - Updates the lognormal-income-process constructor from `ConsIndShockModel.py` to use `IndexDistribution`. [#1024](https://github.com/econ-ark/HARK/pull/1024), [#1115](https://github.com/econ-ark/HARK/pull/1115) - Allows for age-varying unemployment probabilities and replacement incomes with the lognormal income process constructor. [#1112](https://github.com/econ-ark/HARK/pull/1112) From 366578fe262bd56497ab3993404d8e948b49c72a Mon Sep 17 00:00:00 2001 From: "Matthew N. White" Date: Wed, 28 Feb 2024 10:59:33 -0500 Subject: [PATCH 3/4] Change repr test to look at describe instead. --- HARK/tests/test_core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/HARK/tests/test_core.py b/HARK/tests/test_core.py index 0cda93381..8dacf071b 100644 --- a/HARK/tests/test_core.py +++ b/HARK/tests/test_core.py @@ -109,8 +109,8 @@ def test_solve(self): self.assertEqual(len(self.agent.solution), 4) self.assertTrue(isinstance(self.agent.solution[0], MetricObject)) - def test___repr__(self): - self.assertTrue("Parameters" in self.agent.__repr__()) + def test_describe(self): + self.assertTrue("Parameters" in self.agent.describe()) def test___eq__(self): agent2 = AgentType(cycles=1) From ca038693725d8b52c1e24d77a7c4e1094df68301 Mon Sep 17 00:00:00 2001 From: "Matthew N. White" Date: Wed, 28 Feb 2024 11:39:26 -0500 Subject: [PATCH 4/4] Adjustments for 0.14.1 minor release --- Documentation/CHANGELOG.md | 4 ++-- HARK/__init__.py | 2 +- pyproject.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/CHANGELOG.md b/Documentation/CHANGELOG.md index 5f3482d89..4166ac4bf 100644 --- a/Documentation/CHANGELOG.md +++ b/Documentation/CHANGELOG.md @@ -8,9 +8,9 @@ For more information on HARK, see [our Github organization](https://github.com/e ## Changes -### 0.14.1 (IN DEVELOPMENT) +### 0.14.1 -Release date: ??? +Release date: February 28, 2024 #### Major Changes diff --git a/HARK/__init__.py b/HARK/__init__.py index ba1e4a763..bc0da6990 100644 --- a/HARK/__init__.py +++ b/HARK/__init__.py @@ -1,6 +1,6 @@ from .core import * -__version__ = "0.14.0" +__version__ = "0.14.1" """ Logging tools for HARK. diff --git a/pyproject.toml b/pyproject.toml index 94aa901c9..c8da30f69 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "econ-ark" -version = "0.14.0" +version = "0.14.1" authors = [{name = "Econ-ARK team", email = "econ-ark@jhuecon.org"}] classifiers = [ "Development Status :: 3 - Alpha",