Hello all,
We are pleased to announce that version 0.33 of LArray is now available.
Major changes since the last 0.32 version are:
o CheckedSession is intended to be inherited by user defined classes in which the variables of a model are declared. By declaring variables, users will be able to take benefit of the auto-completion feature on session members in PyCharm (auto-completion is the feature in which development tools like PyCharm try to predict the variable or function a user intends to enter after only a few characters have been typed). All user defined classes inheriting from CheckedSession will have access to the same methods as Session objects.
CheckedSessions provide an elegant way to structure your model in functions (in particular, by limiting the number of / eliminating the global variables).
class Demography(CheckedSession):
# (convention is to declare parameters (read-only objects) in capital letters)
# Declare 'VARIANT' parameter as of type string.
# 'VARIANT' will be initialized when a 'Demography' session will be created
VARIANT: str
# declare variables with an initialization value.
# Their type is deduced from their initialization value.
COUNTRY = Axis('country=Belgium,France,Germany')
GENDER = Axis('gender=Male,Female')
TIME = Axis('time=2013..2017')
population = zeros([COUNTRY, GENDER, TIME], dtype=int)
births = zeros([COUNTRY, GENDER, TIME], dtype=int)
# declare 'deaths' with constrained axes and dtype.
# Its type (Array), axes and dtype are not modifiable.
# It will be initialized with 0
deaths: CheckedArray([COUNTRY, GENDER, TIME], int) = 0
d = Demography(VARIANT='baseline')
The complete description of changes including examples can be found at:
http://larray.readthedocs.io/en/stable/changes.html#version-0-33
As always, *any* feedback is very welcome, preferably on the larray-users
mailing list: larray...@googlegroups.com (you need to register to be able to post).