possee-org / genai-numpy

MIT License
4 stars 6 forks source link

Task: Create an automatic commit message for an example #37

Closed bmwoodruff closed 2 weeks ago

bmwoodruff commented 2 weeks ago

Description:

I'd like to automate creating properly formatted (72 character max per line) commit messages, to accompany AI generated examples. Given a module and function, the commit message should be pretty standard, as currently our AI tool provides a justification for the created examples.

For example, given linalg and outer, along with the message

I decided to add these examples because they demonstrate the basic usage of the np.linalg.outer function and show how it handles positive and negative numbers. The first example is a simple demonstration of the outer product, while the second example shows that the function works correctly with negative numbers.

I stopped adding examples because the existing examples cover the basic usage of the function, and additional examples would likely be redundant or too specific. The function is relatively simple, and the existing examples provide a good understanding of its behavior. Adding more examples would not significantly improve the documentation.

I'd like to have it produce:

DOC: AI generated examples for np.linalg.outer

These examples were created by AI and tested against a dev build of
NumPy. AI's reasoning for these examples appears after the skip tags.

[skip actions] [skip azp] [skip cirrus]

I decided to add these examples because they demonstrate the basic usage
of the np.linalg.outer function and show how it handles positive and
negative numbers. The first example is a simple demonstration of the
outer product, while the second example shows that the function works
correctly with negative numbers.

I stopped adding examples because the existing examples cover the basic
usage of the function, and additional examples would likely be redundant
or too specific. The function is relatively simple, and the existing
examples provide a good understanding of its behavior. Adding more
examples would not significantly improve the documentation.

Acceptance Criteria:

bmwoodruff commented 2 weeks ago

The file is located at https://github.com/possee-org/genai-numpy/blob/main/tools/commit-message-creator.ipynb

bmwoodruff commented 2 weeks ago

Having made this, and used it for a while, I'm ready to dump it. I think short commits as you work, one for each function we make examples for, is fine. Then we just rebase and squash our commits onto another branch.

git checkout -b new-branch old-branch
git rebase -i main

Then change all the "pick" to "squash" except the first, and write a nice short clean summary commit message. This rebased branch is what we'll probably share with Chuck and submit as a PR (it's clean).

So while working, commit often and don't worry too much about long commit messages.

I do like one thing in the script above. It makes sure you can type however much you want, and then you can use the part that makes sure your line length never goes above 72.