Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify boilerplate #697

Merged
merged 3 commits into from
Mar 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

### 14.1.1 - [#697](https://github.com/openfisca/openfisca-france/pull/697)

* Amélioration technique
* Utilise le module `core.model_api` plutôt que de réimporter un par un tous les objets Python nécessaires pour écrire une formule
- Aucun impact pour les ré-utilisateurs

## 14.1.0 - [#685](https://github.com/openfisca/openfisca-france/pull/685)

* Amélioration technique
Expand Down
71 changes: 1 addition & 70 deletions openfisca_france/model/base.py
Original file line number Diff line number Diff line change
@@ -1,77 +1,8 @@
# -*- coding: utf-8 -*-

from datetime import date

from openfisca_core.columns import (AgeCol, BoolCol, DateCol, EnumCol, FixedStrCol, FloatCol, IntCol,
PeriodSizeIndependentIntCol, StrCol)
from openfisca_core.enumerations import Enum
from openfisca_core.formulas import (ADD, calculate_output_add, calculate_output_divide,
dated_function, DIVIDE, missing_value, set_input_dispatch_by_period, set_input_divide_by_period)
from openfisca_core.variables import DatedVariable, Variable
from openfisca_core.base_functions import (
requested_period_added_value,
requested_period_default_value,
requested_period_last_or_next_value,
requested_period_last_value,
)
from openfisca_core.formula_helpers import apply_thresholds, switch
from openfisca_core.periods import MONTH, YEAR, ETERNITY

from openfisca_core.model_api import *
from openfisca_france.entities import Famille, FoyerFiscal, Individu, Menage


__all__ = [
'ADD',
'AgeCol',
'apply_thresholds',
'BoolCol',
'calculate_output_add',
'calculate_output_divide',
'CATEGORIE_SALARIE',
'CHEF',
'CONJ',
'CREF',
'date',
'DateCol',
'dated_function',
'DatedVariable',
'DIVIDE',
'ENFS',
'Enum',
'EnumCol',
'Famille',
'FixedStrCol',
'FloatCol',
'FoyerFiscal',
'Individu',
'IntCol',
'Menage',
'missing_value',
'PAC1',
'PAC2',
'PAC3',
'PART',
'PeriodSizeIndependentIntCol',
'PREF',
'QUIFAM',
'QUIFOY',
'QUIMEN',
'requested_period_added_value',
'requested_period_default_value',
'requested_period_last_or_next_value',
'requested_period_last_value',
'set_input_dispatch_by_period',
'set_input_divide_by_period',
'StrCol',
'switch',
'TAUX_DE_PRIME',
'Variable',
'VOUS',
'MONTH',
'YEAR',
'ETERNITY',
]

CATEGORIE_SALARIE = Enum([
'prive_non_cadre',
'prive_cadre',
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name = 'OpenFisca-France',
version = '14.1.0',
version = '14.1.1',
author = 'OpenFisca Team',
author_email = 'contact@openfisca.fr',
classifiers = [
Expand Down Expand Up @@ -45,7 +45,7 @@
'Babel >= 0.9.4',
'Biryani[datetimeconv] >= 0.10.4',
'numpy >= 1.11',
'OpenFisca-Core >= 6.0.0, < 7.0',
'OpenFisca-Core >= 6.1.0, < 7.0',
'PyYAML >= 3.10',
'requests >= 2.8',
],
Expand Down