Skip to content

Add change log for version 0.21 #145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

alixdamman
Copy link
Collaborator

Based on Git logs.

Copy link
Contributor

@gdementen gdementen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to be missing two improvements:

  • tag multiple groups with an axis in one shot (backward incompatible)

  • improved LArray.plot to get nicer plots by default.
    The axes are transposed compared to what they used to, because the last axis is often used for time series. Also it considers a 1D array like a single series, not N series of 1 point.

New features
------------

* implemented replaced_axes() method to replace one, several or all axes of an array
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo... replaced -> replace


* readme.rst + doc : add installation instructions (closes :issue:`101`).

* allowed to use regex in split_axis method (closes :issue:`106`):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"regex" -> "a regular expression"?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could also be considered a new feature...

a0 | 0 | 1 | 2
a1 | 3 | 4 | 5

* allowed multiplication (__matmul__ or @ operator) between matrices with dimension != 2 (closes :issue:`122`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allowed matrix multiplication (@ operator) between arrays with dimension != 2?


* implemented Axis.by() which is equivalent to axis[:].by()

* viewer : automatically display plots done in the viewer console in a separate window
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clarify "using plot methods"? (and possibly add an example)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"using plot methods" ? Example ?

Copy link
Contributor

@gdementen gdementen Mar 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by "using plot methods" I mean using array.plot() or array.plot.XXX() (by opposition to using Ctrl-P or the array widget context menu to create the plot)

Concerning the example, something like:

>>> a = ndtest((2, 3))
>>> a.plot()

* viewer: allow changing the number of displayed digits even for integer arrays as that makes sense when using
scientific notation (closes :issue:`100`).

* viewer : make shortcuts work even when the focus is not on the array editor widget
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't consider this a bug fixed, but an improvement, but well this is subjective :)

Miscellaneous improvements
--------------------------

* readme.rst + doc : add installation instructions (closes :issue:`101`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • not sure mentioning "readme.rst + doc" is worth it.
  • add -> added to be consistent with the rest.

nat\sex | M | F
BE | 0 | 1
FO | 2 | 3
>>> from_string('''age,nat\\sex, M, F
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't a single example enough to get the point across? Unsure whether we need the 3D or 2D one.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll keep only for 3D


* allowed multiplication (__matmul__ or @ operator) between matrices with dimension != 2 (closes :issue:`122`).

* implemented Axis.by() which is equivalent to axis[:].by()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a new feature, right?

------------

* implemented replaced_axes() method to replace one, several or all axes of an array
(instead of using the workaround a.with_axes(a.axes.replace(...)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably should mention somewhere that with_axes is deprecated.


* implemented replaced_axes() method to replace one, several or all axes of an array
(instead of using the workaround a.with_axes(a.axes.replace(...)))
(closes :issue:`67`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, to replace some axes but not all, one had to use a.with_axes(a.axes.replace(...))

@alixdamman
Copy link
Collaborator Author

? tag multiple groups with an axis in one shot (backward incompatible) ?
Couldn't find the associated commit.

@gdementen
Copy link
Contributor

concerning "tag multiple groups": 70cffbb Gaëtan de Menten [email protected] on 2017-01-24 at 16:50

@alixdamman alixdamman force-pushed the add_change_log_version_0_21 branch from 1a1152d to 5f62f04 Compare March 13, 2017 15:50
a1 | 3 | 4 | 5
>>> row = Axis('row', ['r0', 'r1'])
>>> column = Axis('column', ['c0', 'c1', 'c2'])
Replace one axis (second argument `new_axis` must be provided)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better with some blank lines in there like in a real doctest?

row\\column | c0 | c1 | c2
r0 | 0 | 1 | 2
r1 | 3 | 4 | 5
>>> arr.set_axes({x.a: row, x.b: column})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if the later two syntaxes shouldn't be put behind a "equivalent syntaxes" comment so that we can remove the result and make the changelog shorter to not loose our users interest right at the first change :)

* added possibility to tag multiple groups with an axis in one shot (backward incompatible)

>>> year = Axis('year', '2001 .. 2010')
>>> year.group('2001,2002;2003:2008;2009,2010')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should deprecate .group (see #148), and the commit actually included two distinct changes:

  • interpret string syntax in axis[a_string], which means you can do:
>>> year = Axis('year', '2001..2010')
>>> year['2001:2004']
year[2001:2004]
  • change the axis of multiple groups via a single axis[groups]
>>> groups = year[2001:2004], year[2008,2009]
>>> groups
(year[2001:2004], year[2008, 2009])
>>> x.time[groups]
(x.time[2001:2004], x.time[2008, 2009])

However (and this is a bit silly that I did not make it work -- but to my defense, I did not expect you to merge that PR), what you used as an example is broken at this point, because the result is not a valid index in an array:

>>> year['2001:2004;2008;2009']
year[slice(2001, 2004, None), [2008, 2009]]
>>> arr = ndrange(year)
>>> arr.sum(year['2001:2004;2008,2009'])
TypeError                                 Traceback (most recent call last)
...
TypeError: unhashable type: 'slice'
>>> # this works though
... arr.sum(tuple(year['2001:2004;2008,2009']))
year | 2001:2004 | 2008,2009
     |         6 |        15

larray/core.py Outdated
@@ -3976,14 +3976,16 @@ def replace_axes(self, axes_to_replace=None, new_axis=None, **kwargs):
a1 | 3 | 4 | 5
>>> row = Axis('row', ['r0', 'r1'])
>>> column = Axis('column', ['c0', 'c1', 'c2'])

Replace one axis (expect 2 arguments)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you sync this line with the corresponding one in the release notes?

The axes are transposed compared to what they used to, because the last axis is often used for time series.
Also it considers a 1D array like a single series, not N series of 1 point.

* added possibility to tag multiple groups with an axis in one shot (backward incompatible)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this paragraph should be killed

@alixdamman alixdamman force-pushed the add_change_log_version_0_21 branch from 72a33d6 to 9cebd44 Compare March 15, 2017 08:32
@gdementen
Copy link
Contributor

LGTM

@gdementen gdementen merged commit f0fa4aa into larray-project:master Mar 15, 2017
@alixdamman alixdamman deleted the add_change_log_version_0_21 branch March 15, 2017 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants