From 49a24abb9b7afc1ee5187aa5c3f17b4733e3750e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20de=20Menten?= Date: Fri, 13 Nov 2015 09:11:14 +0100 Subject: [PATCH 1/4] * uncomment tests which I inadvertently commited as commented * comment test_array test which breaks other tests --- liam2/tests/functional/simulation.yml | 28 +++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/liam2/tests/functional/simulation.yml b/liam2/tests/functional/simulation.yml index d8a65bf1..b8186454 100644 --- a/liam2/tests/functional/simulation.yml +++ b/liam2/tests/functional/simulation.yml @@ -2599,33 +2599,33 @@ simulation: test_log_regr, # temporal -# test_lag, -# test_value_for_period, -# test_duration, + test_lag, + test_value_for_period, + test_duration, # links test_o2m, test_mixed_links, # output -# test_groupby, -# test_dump, -# test_csv, + test_groupby, + test_dump, + test_csv, -# imported_process, -# test_imported_process, + imported_process, + test_imported_process, # alignment -# test_align, -# test_align_abs, + test_align, + test_align_abs, # misc -# test_choice, + test_choice, show_weight, - test_array, +# test_array, ] - household: [composition, -# test_align_link, + test_align_link, # dump_csv_h, ] @@ -2644,7 +2644,7 @@ simulation: # autodiff: True random_seed: 0 - periods: 1 + periods: 2 logging: level: processes # timings: False From 72bc5247e7711a3e183ffb60bf49d6841c2b1f4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20de=20Menten?= Date: Fri, 13 Nov 2015 09:14:13 +0100 Subject: [PATCH 2/4] fixed using one2many in combination with lags of more than 1 period, or any past period in the interactive console on DiskBackedArrays --- liam2/entities.py | 3 +++ liam2/tests/functional/simulation.yml | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/liam2/entities.py b/liam2/entities.py index 112a7208..35f4e3bb 100644 --- a/liam2/entities.py +++ b/liam2/entities.py @@ -70,6 +70,9 @@ def __getitem__(self, item): def __getattr__(self, item): return getattr(self.arr, item) + def __len__(self): + return len(self.arr) + class Field(object): def __init__(self, name, dtype, input=True, output=True): diff --git a/liam2/tests/functional/simulation.yml b/liam2/tests/functional/simulation.yml index b8186454..eea91a40 100644 --- a/liam2/tests/functional/simulation.yml +++ b/liam2/tests/functional/simulation.yml @@ -1806,6 +1806,14 @@ entities: # FIXME: this fails (see issue #146) #- g: groupby(agegroup, gender, expr=count(lag(TERTIARY_EDU))) + test_lag_o2m: + # this mostly tests that DiskBackedArrays work as expected + - past_nch: lag(children.count(), 2) + # this does not test much but I cannot think of anything more + # precise that is guaranteed to be True + - assertTrue(all(past_nch >= -1)) + - assertTrue(all(past_nch < 50)) + test_value_for_period: # period is a constant - assertEqual(value_for_period(MINR, 2005), 13620.2) @@ -2605,6 +2613,7 @@ simulation: # links test_o2m, + test_lag_o2m, test_mixed_links, # output From 44bfaa96a95c64087a6b73ca78caa3baec66b5d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20de=20Menten?= Date: Fri, 13 Nov 2015 09:18:04 +0100 Subject: [PATCH 3/4] prepare for 0.10.5 --- doc/usersguide/source/changes.rst | 8 ++++++++ doc/usersguide/source/changes/version_0_10_5.rst.inc | 5 +++++ doc/usersguide/source/conf.py | 2 +- liam2/main.py | 2 +- setup.py | 2 +- 5 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 doc/usersguide/source/changes/version_0_10_5.rst.inc diff --git a/doc/usersguide/source/changes.rst b/doc/usersguide/source/changes.rst index ebd94c79..84188b5f 100644 --- a/doc/usersguide/source/changes.rst +++ b/doc/usersguide/source/changes.rst @@ -3,6 +3,14 @@ Change log ########## +Version 0.10.5 +============== + +In development. + +.. include:: changes/version_0_10_5.rst.inc + + Version 0.10.4 ============== diff --git a/doc/usersguide/source/changes/version_0_10_5.rst.inc b/doc/usersguide/source/changes/version_0_10_5.rst.inc new file mode 100644 index 00000000..0bf40e46 --- /dev/null +++ b/doc/usersguide/source/changes/version_0_10_5.rst.inc @@ -0,0 +1,5 @@ +Fixes +----- + +* fixed using one2many in combination with lags of more than 1 period (or any + past period in the interactive console). \ No newline at end of file diff --git a/doc/usersguide/source/conf.py b/doc/usersguide/source/conf.py index 7f63a702..46656922 100644 --- a/doc/usersguide/source/conf.py +++ b/doc/usersguide/source/conf.py @@ -60,7 +60,7 @@ # The short X.Y version. version = '0.10' # The full version, including alpha/beta/rc tags. -release = '0.10.4' +release = '0.10.5' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/liam2/main.py b/liam2/main.py index d804fab3..79c9230e 100644 --- a/liam2/main.py +++ b/liam2/main.py @@ -27,7 +27,7 @@ from utils import AutoFlushFile from view import viewhdf -__version__ = "0.10.4" +__version__ = "0.10.5" def write_traceback(ex_type, e, tb): diff --git a/setup.py b/setup.py index 32ece242..43dbef7a 100644 --- a/setup.py +++ b/setup.py @@ -177,7 +177,7 @@ def vitables_data_files(): setup( name="liam2", # cx_freeze wants only ints and dots - version=int_version('0.10.4'), + version=int_version('0.10.5'), description="LIAM2", cmdclass={"build_ext": MyBuildExt}, ext_modules=ext_modules, From bfcae0a5ae27b7625f4ab5bff7ec37393952842c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20de=20Menten?= Date: Fri, 13 Nov 2015 09:36:39 +0100 Subject: [PATCH 4/4] update release date in changes.rst --- doc/usersguide/source/changes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/usersguide/source/changes.rst b/doc/usersguide/source/changes.rst index 84188b5f..071a8cba 100644 --- a/doc/usersguide/source/changes.rst +++ b/doc/usersguide/source/changes.rst @@ -6,7 +6,7 @@ Change log Version 0.10.5 ============== -In development. +Released on 2015-11-13. .. include:: changes/version_0_10_5.rst.inc