Skip to content
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

Add sc.zeros_like and sc.ones_like functions #1864

Merged
merged 7 commits into from
Apr 26, 2021
Merged

Add sc.zeros_like and sc.ones_like functions #1864

merged 7 commits into from
Apr 26, 2021

Conversation

nvaytet
Copy link
Member

@nvaytet nvaytet commented Apr 23, 2021

No description provided.

@nvaytet nvaytet added the python label Apr 23, 2021
Copy link
Member

@SimonHeybrock SimonHeybrock left a comment

Choose a reason for hiding this comment

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

No tests? Also empty_like could be useful?

@nvaytet
Copy link
Member Author

nvaytet commented Apr 26, 2021

No tests? Also empty_like could be useful?

Yes, was not ready, forgot to mark as draft, sorry
Good idea with empty like.

@nvaytet nvaytet marked this pull request as draft April 26, 2021 07:00
@nvaytet nvaytet marked this pull request as ready for review April 26, 2021 11:01
Copy link
Member

@jl-wynen jl-wynen left a comment

Choose a reason for hiding this comment

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

it would be useful if the user could overwrite individual arguments. I often use np.zeros_like to get an array with the same dtype but different shape as something else. Since in scipp, we have more parameters, this might be even more useful to, e.g., change only the unit.

@SimonHeybrock
Copy link
Member

it would be useful if the user could overwrite individual arguments. I often use np.zeros_like to get an array with the same dtype but different shape as something else. Since in scipp, we have more parameters, this might be even more useful to, e.g., change only the unit.

Agree, but we can add that later.

@SimonHeybrock SimonHeybrock merged commit aa78d17 into main Apr 26, 2021
@SimonHeybrock SimonHeybrock deleted the ones_like branch April 26, 2021 13:20
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.

3 participants