Skip to content

Commit

Permalink
Merge remote-tracking branch 'liam2/master' into defaut_values
Browse files Browse the repository at this point in the history
# Conflicts:
#	liam2/tests/functional/simulation.yml
  • Loading branch information
benjello committed Nov 16, 2015
2 parents 687a48f + bfcae0a commit 3e8083c
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 17 deletions.
8 changes: 8 additions & 0 deletions doc/usersguide/source/changes.rst
Expand Up @@ -3,6 +3,14 @@
Change log
##########

Version 0.10.5
==============

Released on 2015-11-13.

.. include:: changes/version_0_10_5.rst.inc


Version 0.10.4
==============

Expand Down
5 changes: 5 additions & 0 deletions 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).
2 changes: 1 addition & 1 deletion doc/usersguide/source/conf.py
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions liam2/entities.py
Expand Up @@ -71,6 +71,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, default_value=None):
Expand Down
2 changes: 1 addition & 1 deletion liam2/main.py
Expand Up @@ -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):
Expand Down
37 changes: 23 additions & 14 deletions liam2/tests/functional/simulation.yml
Expand Up @@ -1813,6 +1813,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)
Expand Down Expand Up @@ -2618,34 +2626,35 @@ 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_lag_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,
test_default_value,
]
- household: [composition,
# test_align_link,
test_align_link,
# dump_csv_h,
]

Expand All @@ -2664,7 +2673,7 @@ simulation:
# autodiff: True

random_seed: 0
periods: 1
periods: 2
logging:
level: processes
# timings: False
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -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,
Expand Down

0 comments on commit 3e8083c

Please sign in to comment.