{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Developer Docs (if you're going to contribute code)\n",
    "\n",
    "As an open source project, the OpenMDAO repository is hosted on [GitHub.com](https://github.com/OpenMDAO/OpenMDAO), which is your gateway to interacting with and contributing to the project.\n",
    "\n",
    "## Issues and POEMs\n",
    "\n",
    "The first step in contributing to OpenMDAO is to identify a feature or behavior that is not working as desired or could be improved.  The way to bring this to the attention of the development team is by submitting an [issue](https://github.com/OpenMDAO/OpenMDAO/issues/new/choose) on GitHub.  Here you will specify whether you think you have found a bug, are asking for a change in functionality or have an idea for a completely new feature.\n",
    "\n",
    "If the change being proposed is large or impacts the user interface, then you should go through the [POEM](https://github.com/OpenMDAO/POEMs#readme) process. A POEM is a \"Proposal for OpenMDAO Enhancement\".  The POEM process is a mechanism to ensure that significant changes to OpenMDAO are communicated to and vetted by the community before being incorporated.\n",
    "\n",
    "## Developer Install\n",
    "\n",
    "In order to contribute code to OpenMDAO, you will first need to [fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) the OpenMDAO repository on GitHub. This is because contributions must be in the form of a [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request).\n",
    "\n",
    "Once you have your own fork, you can use `git` to clone the repository on your PC or development platform of choice:\n",
    "\n",
    "`git clone http://github.com/your_name/OpenMDAO`\n",
    "\n",
    "Then use `pip` to install openmdao locally:\n",
    "\n",
    "`cd OpenMDAO`\n",
    "\n",
    "`pip install -e .`\n",
    "\n",
    "```{note}\n",
    "The `-e` option tells pip to install directly from your repository. This is very useful when you're developing because when you change the code or pull new commits down from GitHub, you don't necessarily need to re-run the `pip install`.\n",
    "```\n",
    "\n",
    "Your changes should be committed (preferably on a [branch](https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell)) and pushed up to your fork, from which you can then submit a pull request.\n",
    "\n",
    "## Signing and Verifying GitHub Commits\n",
    "\n",
    "To ensure that they come from a trusted source, only pull requests that consist of verified commits can be merged to the OpenMDAO `master` branch.\n",
    "\n",
    "- [Signing GitHub Commits](signing_commits.ipynb)\n",
    "\n",
    "## Testing\n",
    "\n",
    "Any new features, bug fixes or other changes to the code base must be accompanied by one or more tests to verify that the change has the intended functionality.  In addition, the existing test suite must be run to verify that there are no regressions or unintended consequences.\n",
    "\n",
    "- [Unit testing with 'testflo'](unit_testing.ipynb)\n",
    "- [Continuous Integration testing with GitHub Actions](ci_testing.ipynb)\n",
    "\n",
    "## Linting\n",
    "\n",
    "In addition to having tests that check for code and documentation formatting issues, the OpenMDAO project is configured to enable automatic linting when you do a git commit via a [pre-commit hook](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks).  Since continuous integration testing will also do this same linting check with the [ruff linter](https://docs.astral.sh/ruff/linter/), it can save time to catch these issues before before pushing your changes up to GitHub.\n",
    "\n",
    "To enable automatic ruff linting, make sure you have installed the `[test]` dependencies and then issue the `pre-commit install` command in your development environment. After doing this, the pre-commit hook will automatically run a ruff check whenever you make a commit. The hook can also be run manually on changed files using `pre-commit run` or on all files via `pre-commit run --all`.  You can also add your own pre-commit hooks. See the documentation [here](https://pre-commit.com/).\n",
    "\n",
    "## Building the Docs\n",
    "\n",
    "You can read the docs online, so it is not necessary to build them locally on your machine.\n",
    "But if you're going to build new features or add new examples, you'll want to build the docs locally, so that you can check them while you are writing them.\n",
    "\n",
    "- [Local Building of OpenMDAO Documentation](doc_build.ipynb)\n",
    "\n",
    "## Creating Your Own OpenMDAO Plugins\n",
    "\n",
    "- [How To Write OpenMDAO Plugins](writing_plugins.ipynb)\n",
    "\n",
    "\n",
    "## Documentation Style Guide\n",
    "\n",
    "This document exists to help OpenMDAO documentation writers follow appropriate guidelines,\n",
    "in terms of formatting and embedding code.\n",
    "\n",
    "- [OpenMDAO Docs Style Guide](doc_style_guide.ipynb)\n",
    "- [Sphinx and Decorated Methods](sphinx_decorators.ipynb)"
   ]
  }
 ],
 "metadata": {
  "celltoolbar": "Tags",
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.3"
  },
  "orphan": true
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
