default_values#190
Conversation
|
|
There was a problem hiding this comment.
empty should accept an optional arg, and this line should use it instead
|
There are strange things in this proposition, but it's hard to tell what exactly without thinking hard about it and I am too tired to do it today and will probably not have time to do it for a few weeks. |
|
Thanks @gdementen, it is messy because it is mainly a merge with a few fix. I will try on my own for a moment. |
|
|
|
@gdementen : should I modify the get_missing_* by adding a default_values argument or should I add it only to ColumnArray.empty and the calls to this method in ColumnArray.from_table and ColumnArray.from_records ? |
|
@benjello I don't know. You should see what works best. I would find it elegant if we could suppress the concept of missing value, and only have default values which themselves default to the current values we use for missing values depending on the type of field. |
|
It is somehow what we have done in openfisca and it is actually useful. I Le jeu. 29 oct. 2015 09:03, Gaëtan de Menten notifications@github.com a
|
|
I won't get bored, but I am low on time... On the other hand I want to avoid slowing you down or discouraging you from contributing to LIAM2. |
|
We are all low on time ;-) Le jeu. 29 oct. 2015 09:17, Gaëtan de Menten notifications@github.com a
|
|
FWIW, np.full is numpy1.8+, so we'd need to bump the requirements in INSTALL. |
7a31efc to
4931d95
Compare
|
|
|
|
|
I introduced default_values everywhere the was a missing_* but still it the test do not pass. I confess I do not figure the entire process very well so i could use a hint about how to debug this kind of problem ;-) |
|
|
|
The line "defaulted_integer_variable: [99 99 99 ..., -1 -1 -1] done (0 ms elapsed)." makes me suspect the new borns do not use the default value, which means the thing is probably working as it should for the initial population but not for newborns. Did you implement it? |
|
Good catch @gdementen. Tests do pass now. I can add more tests if needed. |
|
|
|
I will not have time for a in-depth review & merge for a couple of weeks, but in the mean time, could you;
|
|
I wil try to find some time for that. |
Add changelog and documentation
3b05758 to
dab7c8b
Compare
|
|
There was a problem hiding this comment.
this is not True (or at least was not True -- and should not be). -1 for integer and 'nan' for float
There was a problem hiding this comment.
You do no speak about new(). In fact I think a separate paragraph and saying it applies to both new() and fields not present in the input bla bla... would be better, what do you think?
There was a problem hiding this comment.
You are right. Will do that.
On Thu, Nov 12, 2015 at 10:43 PM Gaëtan de Menten notifications@github.com
wrote:
In doc/usersguide/source/model.rst
#190 (comment):@@ -219,6 +219,10 @@ However, in practice, there are often some fields which are not present in the
input file. They will need to be calculated later by the model, and you need to
tell LIAM2 that the field is missing, by usinginitialdata: Falsein the
definition for that field (see the agegroup variable in the example below).
+The fields that are not present in the initial file can also be initialized to
+a specific value by using thedefault: some_default_value. If not present they
+are initialized to the default of the field type which are False for boolean and
+0 for integer and float (see the alive variable in the example below).You do no speak about new(). In fact I think a separate paragraph and
saying it applies to both new() and fields not present in the input bla
bla... would be better, what do you think?—
Reply to this email directly or view it on GitHub
https://github.com/liam2/liam2/pull/190/files#r44719011.
|
|
Move changes to versions_0_11.rst.inc
# Conflicts: # liam2/tests/functional/simulation.yml
|
|
|
|
761324f to
6be1af1
Compare
|
|
|
Merged! Thanks a lot! |
|
I hope you checked it carefully since I was not always confortable with what I was modifying. |
|
Don't worry, I did not merge it as-is. I did check & modify it. There is still a bug left, but I wanted to add a test case for it before fixing it. |
This a a non working tentative which tries to reimplement @AlexisEidelman default_value declaration
@gdementen if you have a bit of time to have look at it I would be very glad.
And if you think, that it I am in the wrong direction, please be blunt !
Thanks