1
+ New features
2
+ ------------
3
+
4
+ * implemented set_axes () method to replace one, several or all axes of an array (closes :issue:`67 `).
5
+ The method with_axes() is now deprecated (set_axes() must be used instead).
6
+
7
+ >>> arr = ndtest((2 , 3 ))
8
+ >>> arr
9
+ a\\b | b0 | b1 | b2
10
+ a0 | 0 | 1 | 2
11
+ a1 | 3 | 4 | 5
12
+ >>> row = Axis(' row' , [' r0' , ' r1' ])
13
+ >>> column = Axis(' column' , [' c0' , ' c1' , ' c2' ])
14
+
15
+ Replace one axis (second argument `new_axis` must be provided)
16
+
17
+ >>> arr.set_axes(x.a, row)
18
+ row\\b | b0 | b1 | b2
19
+ r0 | 0 | 1 | 2
20
+ r1 | 3 | 4 | 5
21
+
22
+ Replace several axes (keywords, list of tuple or dictionary)
23
+
24
+ >>> arr.set_axes(a=row, b=column)
25
+ or
26
+ >>> arr.set_axes([(x.a, row), (x.b, column)])
27
+ or
28
+ >>> arr.set_axes({x.a : row, x.b : column})
29
+ row\\column | c0 | c1 | c2
30
+ r0 | 0 | 1 | 2
31
+ r1 | 3 | 4 | 5
32
+
33
+ Replace all axes (list of axes or AxisCollection)
34
+
35
+ >>> arr.set_axes([row, column])
36
+ row\\column | c0 | c1 | c2
37
+ r0 | 0 | 1 | 2
38
+ r1 | 3 | 4 | 5
39
+ >>> arr2 = ndrange([row, column])
40
+ >>> arr.set_axes(arr2.axes)
41
+ row\\column | c0 | c1 | c2
42
+ r0 | 0 | 1 | 2
43
+ r1 | 3 | 4 | 5
44
+
45
+ * implemented from_string() method to create an array from a string:
46
+
47
+ >>> from_string(' ' ' age,nat\\ sex, M, F
48
+ ... 0, BE, 0, 1
49
+ ... 0, FO, 2, 3
50
+ ... 1, BE, 4, 5
51
+ ... 1, FO, 6, 7' ' ' )
52
+ age | nat\sex | M | F
53
+ 0 | BE | 0 | 1
54
+ 0 | FO | 2 | 3
55
+ 1 | BE | 4 | 5
56
+ 1 | FO | 6 | 7
57
+
58
+ * allowed to use a regular expression in split_axis method (closes :issue:`106 `):
59
+
60
+ >>> combined = ndrange(' a_b = a0b0..a1b2' )
61
+ >>> combined
62
+ a_b | a0b0 | a0b1 | a0b2 | a1b0 | a1b1 | a1b2
63
+ | 0 | 1 | 2 | 3 | 4 | 5
64
+ >>> combined.split_axis(x.a_b, regex=' (\w {2})(\w {2})' )
65
+ a\\b | b0 | b1 | b2
66
+ a0 | 0 | 1 | 2
67
+ a1 | 3 | 4 |
68
+
69
+ * allowed to create a group using the syntax axis[a_string]:
70
+
71
+ >>> year = Axis(' year' , ' 2001..2010' )
72
+ >>> year['2001:2004']
73
+ year[2001:2004]
74
+
75
+ * allowed the syntax axis[groups]:
76
+
77
+ >>> groups = year[2001:2004], year[2008,2009]
78
+ >>> groups
79
+ (year[2001 :2004 ], year[2008 , 2009 ])
80
+ >>> x.time[groups]
81
+ (x.time[2001 :2004 ], x.time[2008 , 2009 ])
82
+
83
+ Miscellaneous improvements
84
+ --------------------------
85
+
86
+ * added installation instructions (closes :issue:`101 `).
87
+
88
+ * viewer : make shortcuts work even when the focus is not on the array editor widget
89
+ (ie it is on the array list, or on the interactive console) (closes :issue:`102 `).
90
+
91
+ * allowed matrix multiplication (@ operator ) between arrays with dimension != 2 (closes :issue:`122 `).
92
+
93
+ * viewer : automatically display plots done in the viewer console in a separate window
94
+ (unless " %matplotlib inline" is used). Plots can be done via the array widget
95
+ (using shortcut CTRL+P or right click) or from the console:
96
+
97
+ >>> arr = ndtest((3 , 3 ))
98
+ >>> arr.plot()
99
+
100
+ Now both methods generate a plot in separate window.
101
+
102
+ * improved LArray.plot to get nicer plots by default.
103
+ The axes are transposed compared to what they used to, because the last axis is often used for time series.
104
+ Also it considers a 1D array like a single series, not N series of 1 point.
105
+
106
+ * added possibility to tag multiple groups with an axis in one shot (backward incompatible)
107
+
108
+ >>> year = Axis(' year' , ' 2001 .. 2010' )
109
+ >>> year.group(' 2001,2002;2003:2008;2009,2010' )
110
+ [[2001, 2002], slice(2003 , 2008 , None), [2009, 2010]]
111
+
112
+ * Axis.group is now deprecated (Syntax " age[10:19] >> 'teens'" must be used instead)
113
+ (closes :issue:`148 `).
114
+
115
+ Fixes
116
+ -----
117
+
118
+ * viewer: allow changing the number of displayed digits even for integer arrays as that makes sense when using
119
+ scientific notation (closes :issue:`100 `).
120
+
121
+ * viewer : fixed opening a viewer via view() edit() or compare() from within the viewer
122
+ (closes :issue:`109 `)
123
+
124
+ * viewer : fixed compare() colors when arrays have values which are very close but not exactly equal
125
+ (closes :issue:`123 `)
126
+
127
+ * viewer : fixed legend when plotting arbitrary rows (it always displayed the labels of the first rows)
128
+ (closes :issue:`136 `).
129
+
130
+ * fixed posargsort labels (closes :issue:`137 `).
0 commit comments