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 variables vocabulary and syntax #355

Closed
cbenz opened this issue Oct 23, 2015 · 12 comments
Closed

Simplify variables vocabulary and syntax #355

cbenz opened this issue Oct 23, 2015 · 12 comments
Assignees

Comments

@cbenz
Copy link
Member

cbenz commented Oct 23, 2015

Following #348 discussion, here are some ideas.

Merge @reference_formula decorator with SimpleFormulaColumn metaclass.

Before:

# Input variable
reference_input_variable(
    name = "age",
    column = IntCol,
    entity_class = Individus,
    )

# Variable with formula
@reference_formula
class irpp(SimpleFormulaColumn):
    column = FloatCol
    entity_class = FoyersFiscaux

    def function(self, simulation, period):
        return period, x

After:

# Input variable
class age(Variable):
    column = IntCol
    entity_class = Individus

# Variable with formula
class irpp(Variable):
    column = FloatCol
    entity_class = FoyersFiscaux

    def function(self, simulation, period):
        return period, x
@cbenz cbenz self-assigned this Oct 23, 2015
@cbenz cbenz added this to the v1.0 milestone Oct 23, 2015
@benjello
Copy link
Member

It is clean and i follow you on that side. But didn't you loose the information by removing the reference_formula decorator ? No side-effect on reforms ?

@cbenz
Copy link
Member Author

cbenz commented Oct 23, 2015

No problem, sorry I didn't explain.

The Variable inherited class would be different in openfisca-france and extensions:

  • In OpenFisca-France:

    from .formulas import Variable
    
    class irpp(Variable):
        column = FloatCol
        entity_class = FoyersFiscaux
    
        def function(self, simulation, period):
            return period, x
  • In an extension:

    Extension = extensions.make_extension(...)
    
    class irpp(Extension.Variable):
        column = FloatCol
        entity_class = FoyersFiscaux
    
        def function(self, simulation, period):
            return period, x

@benjello
Copy link
Member

Ok then.

@fpagnoux
Copy link
Member

fpagnoux commented Dec 1, 2015

Any news on this topic ? I can help this week if needed :)

@cbenz
Copy link
Member Author

cbenz commented Dec 4, 2015

We forget to handle a case when a reform updates a variable giving the reference = attribute: 1503255 and test b84c00e

@cbenz
Copy link
Member Author

cbenz commented Dec 7, 2015

Tests still don't pass with https://github.com/openfisca/openfisca-france-indirect-taxation

@cbenz
Copy link
Member Author

cbenz commented Dec 7, 2015

Merged in master of all projects, pushed, Travis tests ongoing (but all were OK on my machine).

In case of emergency please just do git reset --hard <ref> where <ref> is the last commit before merge.

@cbenz
Copy link
Member Author

cbenz commented Dec 7, 2015

Good work everyone!

@cbenz
Copy link
Member Author

cbenz commented Dec 8, 2015

Not closing issue because of openfisca/openfisca-france#350, openfisca/openfisca-france#369 and #365

@cbenz cbenz changed the title Simplify variables terms and syntax Simplify variables vocabulary and syntax Dec 21, 2015
@benjello
Copy link
Member

benjello commented Jul 7, 2016

@fpagnoux @cbenz : should we close this issue ?

@fpagnoux
Copy link
Member

fpagnoux commented Jul 7, 2016

I would say yes.

@fpagnoux
Copy link
Member

fpagnoux commented Jul 7, 2016

And this one as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants