From 32bd84d587318e65a735e852716acb9e77c4e3aa Mon Sep 17 00:00:00 2001 From: Philippe Blayo Date: Tue, 13 Nov 2018 18:01:36 +0100 Subject: [PATCH 1/3] Migrate yaml tests to new API format --- .../tests/local_benefit.yaml | 46 ++++++++++--------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/openfisca_extension_template/tests/local_benefit.yaml b/openfisca_extension_template/tests/local_benefit.yaml index dfff2c4..bf56aa3 100644 --- a/openfisca_extension_template/tests/local_benefit.yaml +++ b/openfisca_extension_template/tests/local_benefit.yaml @@ -1,29 +1,33 @@ - name: "A couple with 2 children gets 200€" period: 2016-01 - households: - parents: ["parent1", "parent2"] - children: ["child1", "child2"] - persons: - - id: "parent1" - age: 35 - - id: "parent2" - age: 35 - - id: "child1" - age: 8 - - id: "child2" - age: 4 - output_variables: + input: + households: + household: + parents: ["parent1", "parent2"] + children: ["child1", "child2"] + persons: + parent1: + age: 35 + parent2: + age: 35 + child1: + age: 8 + child2: + age: 4 + output: local_town_child_allowance: 200 - name: "A couple with no child gets nothing" period: 2016-01 - households: - parents: ["parent1", "parent2"] - persons: - - id: "parent1" - age: 35 - - id: "parent2" - age: 35 - output_variables: + input: + households: + household: + parents: ["parent1", "parent2"] + persons: + parent1: + age: 35 + parent2: + age: 35 + output: local_town_child_allowance: 0 From 116f3452cf4013b10f9c7b96f1dfd5a05befbd36 Mon Sep 17 00:00:00 2001 From: Florian Pagnoux Date: Wed, 28 Nov 2018 00:42:55 -0500 Subject: [PATCH 2/3] Bump version number --- CHANGELOG.md | 6 ++++++ setup.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2aa6dc..71fe824 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +### 1.2.0 - [#18](https://github.com/openfisca/extension-template/pull/18) + +* Technical change +* Details: + - Adapt to Core v25 + ### 1.1.7 - [#16](https://github.com/openfisca/extension-template/pull/16) * Technical change diff --git a/setup.py b/setup.py index 516bde6..efd8a3d 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name="OpenFisca-Extension-Template", - version="1.1.7", + version="1.2.0", author="OpenFisca Team", author_email = 'contact@openfisca.org', classifiers=[ From 3c1aa8ebc9cca8002ee5f72a1a03cc2036394a69 Mon Sep 17 00:00:00 2001 From: Florian Pagnoux Date: Wed, 28 Nov 2018 00:43:00 -0500 Subject: [PATCH 3/3] Upgrade country template --- CHANGELOG.md | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++- setup.py | 2 +- 2 files changed, 69 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71fe824..41e0ee1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,74 @@ * Technical change * Details: - - Adapt to Core v25 + - Adapt to OpenFisca Core v25 + - Change the syntax of OpenFisca YAML tests + +For instance, a test that was using the `input_variables` and the `output_variables` keywords like: + +```yaml +- name: Basic income + period: 2016-12 + input_variables: + salary: 1200 + output_variables: + basic_income: 600 +``` + +becomes: + +```yaml +- name: Basic income + period: 2016-12 + input: + salary: 1200 + output: + basic_income: 600 +``` + +A test that was fully specifying its entities like: + +```yaml +- name: "A couple with 2 children gets 200€" + period: 2016-01 + households: + parents: ["parent1", "parent2"] + children: ["child1", "child2"] + persons: + - id: "parent1" + age: 35 + - id: "parent2" + age: 35 + - id: "child1" + age: 8 + - id: "child2" + age: 4 + output_variables: + local_town_child_allowance: 200 +``` + +becomes: + +```yaml +- name: "A couple with 2 children gets 200€" + period: 2016-01 + input: + households: + household: + parents: ["parent1", "parent2"] + children: ["child1", "child2"] + persons: + parent1: + age: 35 + parent2: + age: 35 + child1: + age: 8 + child2: + age: 4 + output: + local_town_child_allowance: 200 +``` ### 1.1.7 - [#16](https://github.com/openfisca/extension-template/pull/16) diff --git a/setup.py b/setup.py index efd8a3d..ce3d87a 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ ("share/openfisca/openfisca-extension-template", ["CHANGELOG.md", "LICENSE", "README.md"]), ], install_requires = [ - "OpenFisca-Country-Template >= 3, < 4", + "OpenFisca-Country-Template >= 3.6.0, < 4", ], extras_require = { "dev": [