Skip to content

AI code policy, and AI-assissted function rewrites#764

Merged
jkirk5 merged 10 commits intoOpenMDAO:mainfrom
jkirk5:AI
May 29, 2025
Merged

AI code policy, and AI-assissted function rewrites#764
jkirk5 merged 10 commits intoOpenMDAO:mainfrom
jkirk5:AI

Conversation

@jkirk5
Copy link
Copy Markdown
Contributor

@jkirk5 jkirk5 commented May 12, 2025

Summary

Adds documentation page on our AI use policy.

Used AI (through cursor, which does not disclose models used) to resolve 2 TODOs in engine_deck.py by modifying existing code. extend_array() and _hybrid_throttle_norm() are the two functions with AI-written code.

Some additional manual cleanup, review, and formatting of that file, including updated docstrings to reflect new code.

Related Issues

  • Resolves #

Backwards incompatibilities

None

New Dependencies

None

Copy link
Copy Markdown
Member

@hschilling hschilling left a comment

Choose a reason for hiding this comment

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

We can always change it but it is important to get our best effort policy out there sooner rather than later.

Comment thread aviary/docs/developer_guide/ai_policy.md

## 1. Disclose any use of AI

Any use of AI tools should be clearly disclosed. It is helpful to separate AI-generated code into their own commits, but is not always possible. Mention that AI was used in the commit messages. Give additional details in your pull request descriptions about how AI was used. Include a brief explanation of what you used the AI for (debugging, generating new code, etc.), which model you used, and which files were affected.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am not sure the AI code included in this PR complies with #1.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Cursor doesn't disclose which model(s?) it uses, so I don't actually have that information

Comment thread aviary/docs/developer_guide/ai_policy.md
Comment thread aviary/docs/developer_guide/ai_policy.md Outdated
Copy link
Copy Markdown
Contributor

@ehariton ehariton left a comment

Choose a reason for hiding this comment

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

If we want to disclose use of AI, we should add a checkbox and and prompt on the PR page.

Was AI Used In this PR Y/N

  • Was AI Used to Generate Data Y/N
  • Did you use AI to generate unit tests Y/N
  • What unit tests cover this code?
  • Did you use AI to generate documentation Y/N

@xjjiang
Copy link
Copy Markdown
Contributor

xjjiang commented May 23, 2025

Given a component, can AI help summarize its functionality? Can AI create necessary unit tests or at least give a list of necessary unit tests?

@jkirk5
Copy link
Copy Markdown
Contributor Author

jkirk5 commented May 27, 2025

Given a component, can AI help summarize its functionality? Can AI create necessary unit tests or at least give a list of necessary unit tests?

AI is decent at summarizing code, so it may be useful as a starting place for writing docstrings. AI should not be used for writing unittests (policy item 3), since we need to be careful about which cases we run and have good values for our "truth" data

@jkirk5 jkirk5 merged commit 5619cc6 into OpenMDAO:main May 29, 2025
6 checks passed
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.

5 participants