Skip to content

Commit

Permalink
Merge branch 'main' into polar_8
Browse files Browse the repository at this point in the history
  • Loading branch information
erogluorhan authored Nov 9, 2023
2 parents 2b498da + e7041c4 commit bd733b6
Show file tree
Hide file tree
Showing 24 changed files with 511 additions and 1,424 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
build-and-run:
name: Build Sphinx Docs (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 60
defaults:
run:
shell: bash -l {0}
Expand All @@ -21,22 +22,26 @@ jobs:
fail-fast: false
matrix:
os: [ "ubuntu-latest"]
python-version: [ "3.8", "3.9", "3.10" ]
python-version: [ "3.9", "3.10", "3.11" ]
include:
- os: "macos-latest"
python-version: "3.8"
python-version: "3.9"
- os: "macos-latest"
python-version: "3.10"
python-version: "3.11"

steps:
- name: checkout
uses: actions/checkout@v3
- name: Set environment variables
run: |
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: setup micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-name: geocat-examples
environment-file: conda_environment.yml
cache-environment: true
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{matrix.python-version}}-${{env.TODAY}}"
create-args: >-
python=${{matrix.python-version}}
- name: make html
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/docs/_build/
/docs/gallery/
/docs/gallery-geocat-comp/
/Gallery/CSV/*.csv
*.ncl
.vscode/
Expand Down
82 changes: 82 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Code of Conduct

## Our Pledge

We, as contributors, creators, stewards, and maintainers (participants), of GeoCAT-examples pledge to make participation in our
project and community a safe, productive, welcoming and inclusive experience for everyone. All participants are required
to abide by this Code of Conduct. This includes respectful treatment of everyone regardless of age, body size, disability,
ethnicity, gender identity or expression, level of experience, nationality, political affiliation, veteran status, pregnancy,
genetic information, physical appearance, race, religion, or sexual orientation, as well as any other characteristic protected
under applicable US federal or state law.

## Our Standards

Examples of behaviors that contribute to a positive environment include:

- All participants are treated with respect and consideration, valuing a diversity of views and opinions
- Be considerate, respectful, and collaborative
- Communicate openly with respect for others, critiquing ideas rather than individuals and gracefully accepting criticism
- Acknowledging the contributions of others
- Avoid personal attacks directed toward other participants
- Be mindful of your surroundings and of your fellow participants
- Alert project administrators if you notice a dangerous situation or someone in distress
- Respect the rules and policies of the project and venue

Examples of unacceptable behavior include, but are not limited to:

- Harassment, intimidation, or discrimination in any form
- Physical, verbal, or written abuse by anyone to anyone, including repeated use of pronouns other than those requested
- Unwelcome sexual attention or advances
- Personal attacks directed at other guests, members, participants, etc.
- Publishing others’ private information, such as a physical or electronic address, without explicit permission
- Alarming, intimidating, threatening, or hostile comments or conduct
- Inappropriate use of nudity and/or sexual images
- Threatening or stalking anyone, including a participant
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Scope

This Code of Conduct applies to all spaces managed by GeoCAT whether they be physical, online or face-to-face.
This includes project code, code repository, associated web pages, documentation, mailing lists, project websites
and wiki pages, issue tracker, meetings, telecons, events, project social media accounts, and any other forums
created by the project team which the community uses for communication. In addition, violations of this Code of
Conduct outside these spaces may affect a person's ability to participate within them. Representation of a project
may be further defined and clarified by project maintainers.

## Community Responsibilities

Everyone in the community is empowered to respond to people who are showing unacceptable behavior. They can talk to
them privately or publicly. Anyone requested to stop unacceptable behavior is expected to comply immediately. If the
behavior continues concerns may be brought to the project administrators or to any other party listed in the Reporting
section below.

## Project Administrator Responsibilities

Project administrators are responsible for clarifying the standards of acceptable behavior and are encouraged to model
appropriate behavior and provide support when people in the community point out inappropriate behavior. Project
administrator(s) are normally the ones that would be tasked to carry out the actions in the Consequences section below.

## Reporting

Instances of unacceptable behavior can be brought to the attention of the project administrator(s) who may take any action
as outlined in the Consequences section below. However, making a report to a project administrator is not considered an
‘official report’ to UCAR.

## Consequences

Upon receipt of a complaint, the project administrator(s) may take any action deemed necessary and appropriate under the
circumstances. Such action can include things such as: removing, editing, or rejecting comments, commits, code, wiki edits,
email, issues, and other contributions that are not aligned to this Code of Conduct, or banning temporarily or permanently
any contributor for other behaviors that are deemed inappropriate, threatening, offensive, or harmful. Project administrators
also have the right to report violations to UCAR HR and/or UCAR’s Office of Diversity, Equity and Inclusion (ODEI), as well
as a participant’s home institution and/or law enforcement. In the event an incident is reported to UCAR, UCAR will follow
its Harassment Reporting and Complaint Procedure.

## Attribution

This Code of Conduct was originally adapted from the Contributor Covenant, version 1.4. We then aligned it with the UCAR
Participant Code of Conduct, which also borrows from the American Geophysical Union (AGU) Code of Conduct. The UCAR Participant
Code of Conduct applies to both UCAR employees as well as participants in activities run by UCAR. The original version of this
for all software projects that have strong management from UCAR or UCAR staff is available on the UCAR website at
[https://doi.org/10.5065/6w2c-a132](https://doi.org/10.5065/6w2c-a132). The date that it was adopted by this project was 2
October 2023. When responding to complaints, UCAR HR and ODEI will do so based on the latest published version.
74 changes: 1 addition & 73 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,73 +1 @@
Please first refer to [GeoCAT Contributor's Guide](https://geocat.ucar.edu/pages/contributing.html) for overall
contribution guidelines (such as detailed description of GeoCAT structure, forking, repository cloning,
branching, etc.). Once you determine that a function should be contributed under this repo, please refer to the
following contribution guidelines:


# Adding new plotting scripts to the Geocat-examples repo

1. Please check the followings to ensure that the example you are about to work on has not been ported yet:

- [GeoCAT-Examples Gallery](https://geocat-examples.readthedocs.io/en/latest/) or
the `Gallery` as well as `GeoCAT-comp-examples` directories of this repo,

- The list of [Issues](https://github.com/NCAR/GeoCAT-examples/issues) for this repo to see if any of
the existing to-do items are something you might be interested in working on.

- If so, please comment (or self-assign the issue if you have permissions to do so) indicating that
you intend to work on it.

- Otherwise, you may create and self-assign an issue that describes need for the plot you are planning
to contribute.

- For reference, NCL scripts can be seen as well: [NCL applications](http://ncl.ucar.edu/Applications/).

2. Determine if any critical computational functions are missing.

- If so, please submit a new issue (or comment on an existing issue) on this repository's GitHub page
containing the script name and explanation of the need for computational function(s).

3. Determine if any data files needed by your script are available in the
[GeoCAT-datafiles](https://github.com/NCAR/GeoCAT-datafiles) repo:

- If not,

- Submit a new issue (or comment on an existing issue) on this repository's GitHub page containing
the name of the missing datafile(s), or

- Check [GeoCAT-datafiles contributing documentation](https://github.com/NCAR/geocat-datafiles/blob/contribuotr_updates/CONTRIBUTING.md)
to see if you can contribute to the [GeoCAT-datafiles](https://github.com/NCAR/geocat-datafiles) by
uploading your own file.

4. Create a new Python script:

- [template_script.py](https://github.com/NCAR/GeoCAT-examples/blob/master/template_script.py)
(at the root of this repo) could be a great starting point for a new script, so you may want to
consider copying that to `NCL_new_script_1.py` instead of starting from scratch.

- If this script originates from an NCL example, use the original NCL script's basename,
but prepended with "NCL_". For example: `new_script_1.ncl` becomes `NCL_new_script_1.py`.

5. When you complete an example script, please try building the
[Sphinx](https://www.sphinx-doc.org/en/master/)-generated documentation (i.e. html files)
from this repo by running the following commands from within the `/docs` directory:

```bash
make html
```

- This is particularly important to see the final look of a plotting example on
[GeoCAT-Examples Gallery](https://geocat-examples.readthedocs.io) as varying IDEs or local development set up of
developers preferences would generate different plotting results from each other.

- Note: Please follow the [installation instructions](https://github.com/NCAR/geocat-examples/INSTALLATION.md)
beforehand to ensure an accurate conda environment is installed and activated for GeoCAT-examples, including
[Sphinx](https://www.sphinx-doc.org/en/master/).

- The generated HTML file can be viewed under `$GEOCAT_EXAMPLES/_build/html/gallery/` to ensure that
any output (text or graphical) matches what you expected. The complete list of the plotting examples can be
viewed by running the following command as well:

```bash
open _build/html/gallery/index.html
```
The contributor's guide for GeoCAT-examples can be found in our [online documentation](https://geocat-examples.readthedocs.io/en/latest/contrib.html).
2 changes: 1 addition & 1 deletion Gallery/Animations/NCL_animate_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ def animate(i):
anim = animation.FuncAnimation(fig, animate, frames=30, interval=200)

# Uncomment this line to save the created animation
anim.save('animate_1.gif', writer='pillow', fps=5)
#anim.save('animate_1.gif', writer='pillow', fps=5)
96 changes: 0 additions & 96 deletions Gallery/Topography/NCL_topo_1.py

This file was deleted.

6 changes: 4 additions & 2 deletions Gallery/Vectors/NCL_vector_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@

# Generate axes using Cartopy projection
ax = plt.axes(projection=ccrs.PlateCarree())
z = gv.set_vector_density(ds, 0.017)
z = gv.set_vector_density(ds, 10)

# Draw vector plot
# Notes

# 1. We are using `set_vector_density` on line 47 as a replacement for NCL's vcMinDistanceF
# 1. We are using the geocat-viz `set_vector_density` on line 47 as a replacement for NCL's vcMinDistanceF.
# Note that it uses a minimum distance threshold specified as a integer in degrees rather than the NCL normalized device coordinates.
#
# 2. There is no matplotlib equivalent to "CurlyVector"
Q = plt.quiver(z['lon'],
z['lat'],
Expand Down
22 changes: 0 additions & 22 deletions GeoCAT-comp-examples/README.rst

This file was deleted.

6 changes: 0 additions & 6 deletions GeoCAT-comp-examples/comp_only/README.rst

This file was deleted.

Loading

0 comments on commit bd733b6

Please sign in to comment.