Contributing to geocat-examples#


Thank you for considering making a contribution to geocat-examples! There are many ways to contribute to this project, including reporting bugs, requesting additional examples, improving our documentation, or contributing your own examples and we appreciate all of them.

If you have any questions, please feel free to reach out to us on GitHub Discussions. You can also reach us by email at

Where to start#

Look through our open issues and see if there is anything you would like to take on! We recommend working with core developers to implement new examples. We can help you get started and make sure your work is consistent with the rest of the project.

Also check out any beginner-friendly issues we have tagged with good first issue.

We do not officially “assign” issues to contributors, but if you are interested in working on an issue, please comment on the issue to let us know you are working on it. This will help us avoid duplicate work.

The code for geocat-examples is hosted on GitHub. If you do not have one, you will need to create a free GitHub account. The GitHub Quickstart Guide is a great place to get started with git and GitHub.

Reporting bugs#

Something not working as expected? We would love to hear about it! Please report any bugs you find by opening an issue on GitHub. See our bug report template to get started.

When reporting a bug, please include as much information as possible. This will help us reproduce the bug and fix it efficiently. For more information on how to write a good bug report, see this stackoverflow post on how to make a good bug report.

Requesting new examples#

Have an idea for a new example? Want to know how to do something in Python that you used to do in NCL? See our example request template to get started.

You can also use our Feature Request Form to submit a feature request.

Contributing new examples#

For ideas of examples to work on check the issues on the GeoCAT-Examples repository. Or, if you have an idea of your own, log a corresponding issue using the example request template.

Next, check to see if the data required for your example is available in the GeoCAT-datafiles repository. If not, check the contributing guidelines for how to add it.

After ensuring the necessary data is available, you can begin work on your example. A template example is available here.

Please consult the Development workflow overview for additional information on how to contribute your example and confirm the gallery builds with your example as expected.

Improving Documentation#

We are always looking for ways to improve our documentation. If you find something that is unclear or confusing, please let us know by opening an issue. To contribute to our documentation yourself, see the Documentation section of this guide.

Development workflow overview#

This is a brief overview of the development workflow we use for geocat-examples. A more detailed description of each step is provided in following sections.

Get set up to develop on your local machine

  1. Fork and clone the repository.

  2. Create a development environment.

  3. Create a branch for your changes.

  4. Install pre-commit hooks.

Make your changes

  1. Understanding the codebase.

  2. ‘Adding new examples’_.

  3. Generate and check the documentation.

Contribute your code

  1. Push your changes to your fork.

  2. Open a pull request.

  3. Address feedback.

  4. Wait for your pull request to be merged.

  5. Delete your branch.

Get set up to develop on your local machine#

Fork and clone the repository#

Get started by forking the NCAR/geocat-examples repository on GitHub. To do this, find the “Fork” button near the top of the page and click it. This will create a copy of the project under your personal github account.

Next, clone your forked copy to your local machine.

git clone

Enter the project folder and set the upstream remote to the NCAR/geocat-examples repository. This will allow you to keep your fork up to date with the main repository.

cd geocat-viz git remote add upstream

For more information, see the GitHub quickstart section on forking a repository.

Create a development environment#

To run and test any changes you make in geocat-examples, you will need to create a development environment. We recommend installing and using conda and/or mamba.

Use the following commands to create a new conda environment to develop geocat-examples in.

# Create a new conda environment
conda create -c conda-forge -n geocat-examples python=3.10

# Use the environment file to populate the environment with the required dependencies
conda env update -f conda_environment.yml

# Activate your new environment
conda activate geocat-examples

See the conda documentation for more information.

Create a branch for your changes#

We highly recommend creating a new branch on your fork for each new feature or bug that you work on.

To create and check out a new branch, use the following command:

git checkout -b <branch-name>

You can see a list of all branches in your local repository by running:

git branch

For more information on branching, check out this learn git branching interactive tool.

Install pre-commit hooks#

geocat-examples uses pre-commit hooks to ensure a standardized base-level code formatting and style.

The pre-commit package is installed by default when using the conda_environment.yml file. To set up the pre-commit hooks, run the following command from the root of the repository:

pre-commit install

Now, whenever you commit changes, the pre-commit hooks will run and may make small modifications to your code. If the pre-commit hooks make any changes, you will need to re-add the files and commit them again in order to successfully make the commit.

To manually run the pre-commit hooks, use the following command:

pre-commit run --all-files

You can skip the pre-commit hooks by adding the --no-verify flag to your commit command like this:

git commit -m "your commit message" --no-verify

For more information on pre-commit hooks, see the pre-commit documentation.

Make your changes#

After you’re all set up to develop geocat-examples, you can start making your changes. This section describes where, how, and what to change to add your contributions to the geocat-examples codebase.

Understanding the codebase#

The geocat-examples top-level directory is organized as follows:

├── docs
├── Gallery
  • The docs directory contains the sphinx documentation for geocat-examples.

  • The Gallery directory, contains the code for the examples as python scripts. This is the place to add new examples. * Examples are organized in subdirectories based upon categories from `NCL

    • Scripts should are named based upon the original NCL examples (i.e. example_1.ncl becomes

When making changes to the examples gallery, please add a summary to the release notes.

  • docs/release-notes.rst: This file documents changes to the codebase that we add to in the same PR as the code changes.


geocat-examples uses sphinx and ReadTheDocs to build and host the documentation.

Editing other documentation files#

We welcome changes and improvements to all parts of our documentation (including this guide)! You can find these files in the docs directory.

These files are mainly written in reStructuredText, but additional file types such as .md and .ipynb are also used.

Important documentation files to know about include:

  • docs/index.rst: This file is the main page of the documentation. Files added to toctree blocks in this file will be included in the documentation as top-level subpages.

  • docs/contrib.rst: This file is the source for this guide!

  • docs/ This file contains the configuration for building the documentation.

See the sphinx documentation for more information about writing sphinx documentation.

Generate the documentation locally#

To generate the documentation locally, follow the steps below.

  1. Create and activate the geocat-examples conda environment using the conda_environment.yml file.

  2. Enter the docs directory.

  3. Run make html to build the documentation.

  4. Open docs/_build/html/gallery/index.html in your browser to view the documentation.

Check the documentation#

As well as checking local documentation generation, you should also check the preview documentation generated as part of a PR. To do this, scroll down to the “checks” section of the PR and click on the “Details” link next to the “docs/” check. This will take you to the corresponding build on ReadTheDocs, where you can view the documentation built from your PR and see any warnings or errors on your build.

Contribute your code#

Once you have prepared your changes and are ready for them to be reviewed by the GeoCAT team, you can open a pull request. This section describes how to open a pull request and what to expect after you open it.

Push your changes to your fork#

Once you have made your changes locally, you will need to push them to your branch on your fork on GitHub. To do this, use the following command:

git push

From here, you can request that your changes be merged into the main repository in the form of a pull request.

Open a pull request#

GitHub has extensive pull request guides and documentation that we recommend. This section describes the basics for our workflow.

From your branch on your fork, open the “Pull requests” tab and click the “New pull request” button. Make sure the “base repository” is “NCAR/geocat-examples” and the “base” branch is set to “main”, with the “head repository” and “compare” branch set to your fork and prepared branch, respectively.

From this page, you can see a view of the changes you have made in your branch.

We recommend adding a short, descriptive title to your pull request. The body of the pull request should autofill with our pull request template, which has it’s own set of directions. Please fill out the relevant sections of the template, including adding a more detailed description of your changes.

Once you have filled out the template, click the “Create pull request” button. This will open your pull request on the geocat-examples repository.

If you want to open a pull request but are not ready for it to be reviewed, you can open the pull request as a draft. This is also a good way to get feedback on your work that might not be ready to contribute yet.

Address feedback#

After you open your pull request, the GeoCAT team will review it and may provide feedback like asking for changes or suggesting improvements. You can address this feedback by making changes to your branch and pushing them to your fork. The pull request will automatically update with your changes.

The GeoCAT team appreciates your contributions and the interactive process of reviewing pull requests, and will do our best to review your pull request in a timely manner. It is totally normal to have to make several rounds of changes to your pull request before it is ready to be merged, especially if you are new to the project.

Once your pull request is approved by a core maintainer and passes the relevant checks, it will be merged into the main repository!

Delete your branch#

We recommend deleting your branch after your pull request is merged. This will help keep your fork clean and organized, but is not required.