Skip to content

Enhance mask_indices and move_axis#622

Merged
robinwnv merged 3 commits intonv-legate:branch-22.10from
robinwnv:enhance_maskindices_moveaxis
Sep 30, 2022
Merged

Enhance mask_indices and move_axis#622
robinwnv merged 3 commits intonv-legate:branch-22.10from
robinwnv:enhance_maskindices_moveaxis

Conversation

@robinwnv
Copy link
Contributor

No description provided.

@robinwnv robinwnv added the category:task PR is a simple task and will not be included in release notes label Sep 29, 2022
@robinwnv robinwnv requested a review from bryevdv September 29, 2022 09:35
Copy link
Contributor

@bryevdv bryevdv left a comment

Choose a reason for hiding this comment

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

These changes are very nice, only a few small comments

Comment on lines +21 to +22
KS = [0, -1, 1, -2, 2]
FUNCTIONS = ["tril", "triu"]
Copy link
Contributor

Choose a reason for hiding this comment

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

prefer tuples unless mutability is an explicit need

Suggested change
KS = [0, -1, 1, -2, 2]
FUNCTIONS = ["tril", "triu"]
KS = (0, -1, 1, -2, 2)
FUNCTIONS = ("tril", "triu")

(here, and also several places below)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right. Tuple is better than list if the case is immutable. Fixed.

Comment on lines +59 to +63
EMPTY_ARRAYS = [
[],
[[]],
[[], []],
]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
EMPTY_ARRAYS = [
[],
[[]],
[[], []],
]
EMPTY_ARRAYS = (
[],
[[]],
[[], []],
)


msg = "'str' object is not callable"
with pytest.raises(TypeError, match=msg):
num.mask_indices(10, "abc")
Copy link
Contributor

Choose a reason for hiding this comment

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

This would be better split into two separate named tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

cn.moveaxis(self.x, None, 0)

with pytest.raises(TypeError, match=msg):
cn.moveaxis(self.x, 0, None)
Copy link
Contributor

Choose a reason for hiding this comment

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

split into separate tests for float and None

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@robinwnv robinwnv merged commit 26ef5b9 into nv-legate:branch-22.10 Sep 30, 2022
@robinwnv robinwnv deleted the enhance_maskindices_moveaxis branch March 14, 2023 08:45
manopapad pushed a commit that referenced this pull request Mar 5, 2025
…622)

Note: the test failures are not related to this change.

* Renamed:    .github/workflows/ci-gh-release.yml -> .github/workflows/ci-gh.yml. Also changed the build-type to ci.

* Use build_release_product to build ci package.

* Use make_release_env() for ci builds too.

* The nightly build now has build-type set to nightly instead of release.

* Updated versions.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:task PR is a simple task and will not be included in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants