Skip to content

Commit

Permalink
Fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
segsell committed Mar 28, 2024
1 parent 50e8811 commit fc3b7d4
Showing 1 changed file with 45 additions and 39 deletions.
84 changes: 45 additions & 39 deletions docs/source/development/how-to.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,46 +10,47 @@ To get acquainted with the code base, you can check out our
[issue tracker](https://github.com/OpenSourceEconomics/estimagic/issues) for some
immediate and clearly defined tasks.

1. Assuming you have settled on contributing a small fix to the project, please read the
{ref}`style_guide` on the next page before you continue.
Assuming you have settled on contributing a small fix to the project, please read the
{ref}`style_guide` on the next page before you continue.

1. Next, clone the [repository](https://github.com/OpenSourceEconomics/estimagic/) to
your local machine. This will create a copy of the repository where you have local
write access. Your fix will be implemented in your copy. After that, you will open a
Pull Request (PR). With a PR you propose your changes to be merged into the project.
If you plan to become a regular contributor, we can give you push access to
unprotected branches, which makes the process more convenient for you.
Next, clone the [repository](https://github.com/OpenSourceEconomics/estimagic/) to your
local machine. This will create a copy of the repository where you have local write
access. Your fix will be implemented in your copy. After that, you will open a Pull
Request (PR). With a PR you propose your changes to be merged into the project. If you
plan to become a regular contributor, we can give you push access to unprotected
branches, which makes the process more convenient for you.

Here is a step-by-step guide on how to implement your changes via a PR while adhering to
estimagic's style guide.
Below is a step-by-step guide on how to implement your changes via a PR while adhering
to estimagic's style guide.

1. Clone the repository to your disk. Set up the project environment with conda. This
will automatically install your local version of estimagic in editable mode.

On your computer, open the terminal in the root of your local estimagic repo and enter
the following commands:
On your computer, open the terminal in the root of your local estimagic repo and
enter the following commands:

```bash
$ conda env create -f environment.yml
```
```bash
$ conda env create -f environment.yml
```

```bash
$ conda activate estimagic
```
```bash
$ conda activate estimagic
```

```bash
$ pip install -e .
```
```bash
$ pip install -e .
```

1. Implement the fix or new feature. To stage your changes for commit, type

```bash
$ git add FILE

To learn more about git and how to add/commit your local changes, have a look at the materials [here](https://effective-programming-practices.vercel.app/git/staging/objectives_materials.html).

$ git add src/estimagic/YOUR_FILE.py
```

To learn more about git and how to add/commit your local changes, have a look at the
materials
[here](https://effective-programming-practices.vercel.app/git/staging/objectives_materials.html).

1. We validate contributions in two ways. First, we use a comprehensive test suite to
check if your changes are compatible with estimagic. Second, we use
[pre-commit hooks](https://effective-programming-practices.vercel.app/git/pre_commits/objectives_materials.html)
Expand All @@ -69,24 +70,28 @@ $ pip install -e .
$ pre-commit install
```

Having pre-commit installed, linters are executed before each commit and the commit
is rejected if any of the checks fails. You can also run the linters manually via
With pre-commit installed, linters are executed before each commit and the commit is
rejected if any of the checks fails. Note that some linters fix errors directly by
automatically modifying the code. Restage the respective files via
`git add src/estimagic/YOUR_FILE.py`.

You can also run the linters manually via

```bash
$ pre-commit run -a
```

1. If you have made changes to the estimagic documentation, check if the it builds
correctly. To do so, go to the root directory of your local estimagic repo and
navigate to the `docs` folder. There, you need to create the `estimagic-rtd`
navigate to the `docs` folder. There, you need to create the `estimagic-docs`
environment and activate it

```bash
$ conda env create -f environment-rtd.yml
$ conda env create -f rtd_environment.yml
```

```bash
$ conda activate estimagic-rtd`
$ conda activate estimagic-docs`
```

Still in the `docs` folder, now build the sphinx documentation pages by typing
Expand All @@ -110,16 +115,17 @@ $ pip install -e .
$ google-chrome build/html/explanations/optimization/why_optimization_is_hard.html
```

5) If all tests and pre-commit hooks have passed locally, you are ready to push your
changes to a new branch on the remote estimagic repository. Go to estimagic's Github
page. A banner will be displayed asking you whether you would like to create a pull
request. Click on the link and follow the instructions of the PR template. Fill out
the PR form to inform everyone what you have been working on, what you have been
trying to accomplish, and what you have done to achieve that.
1. If all tests and pre-commit hooks have passed locally, you are ready to push your
changes to a new branch on the remote estimagic repository.

Go to estimagic's Github page. A banner will be displayed asking you whether you
would like to create a pull request. Click on the link and follow the instructions of
the PR template. Fill out the PR form to inform everyone what you have been working
on, what you have been trying to accomplish, and what you have done to achieve that.
Opening a PR starts a complete run of the test suite on a Continuous Integration (CI)
server. The status of the CI run is shown on your PR page. If necessary, make
modifications to your code and reiterate until the tests pass on the remote machine.
Opening a PR starts a complete run of the test suite on a Continuous Integration (CI)
server. The status of the CI run is shown on your PR page. If necessary, make
modifications to your code and reiterate until the tests pass on the remote machine.
1. Ask one of the main contributors to review your changes. If they have any remarks or
suggestions, address them and commit your modifications.
Expand Down

0 comments on commit fc3b7d4

Please sign in to comment.