Skip to content

Conversation

@alixdamman
Copy link
Collaborator

fix #121 : Update docstring of set_labels.

fix #133 : Rename replace_axes as set_axes.

Add inplace flag to set_axes and rename methods

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.

the release notes in the other PR will need to be updated too

larray/core.py Outdated
BE | 0 | 1
FO | 2 | 3
>>> arr.rename({'nat': 'nat2', 'sex': 'sex2'})
nat2\\sex2 | 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.

duh? this is the same as the previous 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.

It was to test the inplace flag. I failded to properly clean the examples.

Copy link
Contributor

Choose a reason for hiding this comment

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

:)

"data shape %s" % (axes.shape, data.shape))

# Because __getattr__ and __setattr__ have been rewritten
# Because __getattr__ and __setattr__ have been overridden
Copy link
Contributor

Choose a reason for hiding this comment

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

even though it is indeed the case, __setattr__ should actually not be overridden (ever since we changed __getattr__ to return axes). It might be better to fix that in a separate PR though, because most (all?) object.__setattr__ could/should be replaced.

larray/core.py Outdated
>>> column = Axis('column', ['c0', 'c1', 'c2'])
>>> arr.replace_axes(x.a, row)
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.

the "expect 2 arguments" part is a bit strange. who should expect? the function or the user? => replace by somethng like:
Replace one axis (the second argument is required when using this syntax)

fix larray-project#133  :Rename replace_axes as set_axes.

Add inplace flag to set_axes and rename methods
@alixdamman alixdamman force-pushed the rename_replace_axes branch from a0bd8c8 to a139f99 Compare March 13, 2017 15:14
@gdementen
Copy link
Contributor

LGTM

@gdementen gdementen merged commit f837e2a into larray-project:master Mar 14, 2017
@alixdamman alixdamman deleted the rename_replace_axes branch March 14, 2017 11:41
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.

rename replace_axes to set_axes and update set_labels API? document that a single string is allowed in set_labels

2 participants