Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC: AI generated examples for ma.reshape #26830

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
merged 1 commit into from
Jul 22, 2024

Conversation

otieno-juma
Copy link
Contributor

I used AI Llama 3 to help create these.
@bmwoodruff and I reviewed them.
[skip actions] [skip azp] [skip cirrus]

reshape fuction pic

@eagunn
Copy link
Contributor

eagunn commented Jul 4, 2024

@otieno-juma Compared to your example code for #26827, I had a much harder time parsing this example code. I think it is because you do not assign the results of the reshape to a variable and then explicitly have that variable print out. That is, your examples looks like:

    >>> a = np.ma.array([1, 2, 3, 4])
    >>> np.ma.reshape(a, (2, 2))
    masked_array(
      data=[[1, 2],
            [3, 4]],
      mask=False,
      fill_value=999999)

and I think they would be easier to understand if they looked like:

    >>> a = np.ma.array([1, 2, 3, 4])
    >>> x = np.ma.reshape(a, (2, 2))
    >>> x
    masked_array(
      data=[[1, 2],
            [3, 4]],
      mask=False,
      fill_value=999999)

@otieno-juma
Copy link
Contributor Author

Thank you very much, @eagunn, for the feedback. We will improve our prompts to enhance those edges.

@rgommers rgommers marked this pull request as draft July 7, 2024 07:59
@rgommers
Copy link
Member

rgommers commented Jul 7, 2024

Converting to draft pending review of the first such PR: gh-26827.

@charris
Copy link
Member

charris commented Jul 19, 2024

@otieno-juma Could you rebase this and the other pending PRs?

I used AI Llama 3 to help create these.
@bmwoodruff and I reviewed them.
[skip azp] [skip cirrus]
@otieno-juma otieno-juma force-pushed the ai-examples-ma-reshape branch from 9f2db64 to 267e44c Compare July 22, 2024 13:35
@otieno-juma
Copy link
Contributor Author

@bmwoodruff, All the checks have passed. could you please review it?

@bmwoodruff
Copy link
Member

I ran the tests locally on my machine. Looks good. @charris, this should be ready for you to review. @otieno-juma , you can remove the draft status.

@otieno-juma otieno-juma marked this pull request as ready for review July 22, 2024 16:04
@charris charris merged commit 28505a9 into numpy:main Jul 22, 2024
66 checks passed
@charris
Copy link
Member

charris commented Jul 22, 2024

Thanks @otieno-juma . Was there a response to @eagunn ? I didn't have a problem parsing the result, just wondering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants