Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.

Commit cf1c06f

Browse files
author
Kevin Paul
authored
Merge pull request #108 from NCAR/devel
Merge for release v0.3.0
2 parents c51a4af + 496f3c0 commit cf1c06f

File tree

190 files changed

+31689
-13449
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+31689
-13449
lines changed

.github/workflows/linting.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Linting
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
pull_request:
8+
branches:
9+
- '*'
10+
11+
jobs:
12+
linting:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: actions/setup-python@v2
17+
- uses: pre-commit/[email protected]

.github/workflows/pypipublish.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Upload Python Package to PyPI
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Set up Python
13+
uses: actions/setup-python@v2
14+
- name: Install dependencies
15+
run: |
16+
python -m pip install --upgrade pip
17+
pip install setuptools setuptools-scm wheel twine
18+
- name: Build and publish
19+
env:
20+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
21+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
22+
run: |
23+
python setup.py sdist bdist_wheel
24+
twine upload dist/*

.github/workflows/tests.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
pull_request:
8+
branches:
9+
- '*'
10+
workflow_dispatch: # allows you to trigger manually
11+
12+
jobs:
13+
build:
14+
name: python-${{ matrix.python }}
15+
runs-on: ubuntu-latest
16+
defaults:
17+
run:
18+
shell: bash -l {0}
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
python: ['3.6', '3.7', '3.8']
23+
env:
24+
PYTHON: ${{ matrix.python }}
25+
OMPI_MCA_rmaps_base_oversubscribe: '1'
26+
OMPI_ALLOW_RUN_AS_ROOT: '1'
27+
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: '1'
28+
steps:
29+
- uses: actions/checkout@v2
30+
- name: Cache conda
31+
uses: actions/cache@v2
32+
env:
33+
# Increase this value to reset cache if ci/environment.yml has not changed
34+
CACHE_NUMBER: 0
35+
with:
36+
path: ~/conda_pkgs_dir
37+
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/environment.yml') }}
38+
- name: Setup miniconda
39+
uses: goanpeca/setup-miniconda@v1
40+
with:
41+
activate-environment: pyconform # Defined in ci/environment.yml
42+
auto-update-conda: false
43+
python-version: ${{ matrix.python }}
44+
environment-file: ci/environment.yml
45+
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
46+
- name: Install package
47+
run: python -m pip install --no-deps .
48+
- name: Check Installation
49+
run: |
50+
conda list
51+
pip list
52+
- name: Run Tests
53+
run: ci/runtests.sh
54+
- name: Upload code coverage to Codecov
55+
uses: codecov/codecov-action@v1
56+
with:
57+
file: ./coverage.xml
58+
flags: unittests
59+
env_vars: PYTHON,MPI
60+
name: codecov-umbrella
61+
fail_ci_if_error: false

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
*.spec
22
*.pyc
33
*.nc
4+
.cache
5+
.pytest_cache
46
.DS_Store
57
temp
68
build
79
dist
810
PyConform.egg-info
911
.idea/
1012
.vscode/
13+
__pycache__
14+
.coverage*
15+
coverage.xml

.pre-commit-config.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
exclude: '(docs\/|examples\/)'
2+
3+
repos:
4+
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
6+
rev: v3.2.0
7+
hooks:
8+
- id: trailing-whitespace
9+
- id: end-of-file-fixer
10+
- id: check-docstring-first
11+
- id: check-json
12+
- id: check-yaml
13+
14+
- repo: https://github.com/ambv/black
15+
rev: 20.8b1
16+
hooks:
17+
- id: black
18+
19+
- repo: https://github.com/keewis/blackdoc
20+
rev: v0.1.2
21+
hooks:
22+
- id: blackdoc
23+
24+
- repo: https://gitlab.com/pycqa/flake8
25+
rev: 3.8.3
26+
hooks:
27+
- id: flake8
28+
29+
- repo: https://github.com/asottile/seed-isort-config
30+
rev: v2.2.0
31+
hooks:
32+
- id: seed-isort-config
33+
args: [--exclude=docs/*|examples/*]
34+
35+
- repo: https://github.com/pre-commit/mirrors-isort
36+
rev: v5.5.3
37+
hooks:
38+
- id: isort

CHANGES.rst renamed to CHANGELOG.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PyConform ChangeLog
22
===================
33

4-
Copyright 2017-2018, University Corporation for Atmospheric Research
4+
Copyright 2017-2020, University Corporation for Atmospheric Research
55
See the LICENSE.rst file for details
66

77
VERSION 0.0.1
@@ -36,4 +36,9 @@ VERSION 0.2.1
3636
VERSION 0.2.2
3737
-------------
3838
- New user-defined function API
39-
39+
40+
VERSION 0.3.0
41+
-------------
42+
- Code ported to Python 3.6+ (No longer supports Python 2.7)
43+
- Update to testing suite (using PyTest) and adding GitHub Actions
44+
- General modernization of the package repository

CODE_OF_CONDUCT.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Examples of behaviors that contribute to a positive environment include:
1414
* Communicate openly with respect for others, critiquing ideas rather than individuals and gracefully accepting criticism
1515
* Acknowledging the contributions of others
1616
* Avoid personal attacks directed toward other participants
17-
* Be mindful of your surroundings and of your fellow participants
17+
* Be mindful of your surroundings and of your fellow participants
1818
* Alert UCAR staff and suppliers/vendors if you notice a dangerous situation or someone in distress
1919
* Respect the rules and policies of the project and venue
2020

@@ -26,7 +26,7 @@ Examples of unacceptable behavior include, but are not limited to:
2626
* Personal attacks directed at other guests, members, participants, etc.
2727
* Publishing others' private information, such as a physical or electronic address, without explicit permission
2828
* Alarming, intimidating, threatening, or hostile comments or conduct
29-
* Inappropriate use of nudity and/or sexual images
29+
* Inappropriate use of nudity and/or sexual images
3030
* Threatening or stalking anyone, including a participant
3131
* Other conduct which could reasonably be considered inappropriate in a professional setting
3232

@@ -50,7 +50,7 @@ Project administrators are also expected to keep this Code of Conduct updated wi
5050

5151
## Reporting
5252
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](#consequences) section below.
53-
However, making a report to a project administrator is not considered an 'official report' to UCAR.
53+
However, making a report to a project administrator is not considered an 'official report' to UCAR.
5454

5555
Instances of unacceptable behavior may also be reported directly to UCAR pursuant to [UCAR's Harassment Reporting and Complaint Procedure](https://www2.fin.ucar.edu/procedures/hr/harassment-reporting-and-complaint-procedure), or anonymously through [UCAR's EthicsPoint Hotline](https://www2.fin.ucar.edu/ethics/anonymous-reporting).
5656

LICENSE.rst

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,47 +5,47 @@ UNIVERSITY CORPORATION FOR ATMOSPHERIC RESEARCH
55
Contributor License Agreement
66
-----------------------------
77

8-
This Contributor License Agreement ("Agreement") is a legal agreement between you (in your capacity as an individual and
9-
as an agent for your company, institution or other entity) (collectively, "you" or "your" or "Licensee") and the University
8+
This Contributor License Agreement ("Agreement") is a legal agreement between you (in your capacity as an individual and
9+
as an agent for your company, institution or other entity) (collectively, "you" or "your" or "Licensee") and the University
1010
Corporation for Atmospheric Research ("UCAR").
1111

12-
1. **License Grant to Technology.** UCAR grants to Licensee a restricted, royalty-free, perpetual, nonexclusive,
13-
nontransferable, noncommercial license to copy, modify, enhance, improve and use the NCAR PyConform code set for
14-
transformation and standardization of NetCDF datasets into the approved formats for publication (**Technology**)
15-
for research purposes and for collaborating with UCAR only; provided, however, that Licensee does not commercialize,
16-
sell, license, distribute, or transfer the Technology, or any work that contains the Technology. Licensee may freely
17-
use the data and results from the Technology. Licensee shall note in all publications of data or results that this
18-
Technology is provided by UCAR and the NCAR Computational and Information Systems Laboratory. Licensee must reproduce
19-
all copyright notices and other proprietary notices on any copies of the Technology, and Licensee shall not remove any
12+
1. **License Grant to Technology.** UCAR grants to Licensee a restricted, royalty-free, perpetual, nonexclusive,
13+
nontransferable, noncommercial license to copy, modify, enhance, improve and use the NCAR PyConform code set for
14+
transformation and standardization of NetCDF datasets into the approved formats for publication (**Technology**)
15+
for research purposes and for collaborating with UCAR only; provided, however, that Licensee does not commercialize,
16+
sell, license, distribute, or transfer the Technology, or any work that contains the Technology. Licensee may freely
17+
use the data and results from the Technology. Licensee shall note in all publications of data or results that this
18+
Technology is provided by UCAR and the NCAR Computational and Information Systems Laboratory. Licensee must reproduce
19+
all copyright notices and other proprietary notices on any copies of the Technology, and Licensee shall not remove any
2020
copyright information appearing in or on the Technology files.
21-
2. **Ownership of Technology.** UCAR owns and retains all title, copyright, and other proprietary interests in the
21+
2. **Ownership of Technology.** UCAR owns and retains all title, copyright, and other proprietary interests in the
2222
Technology, including any copies thereof. No ownership rights of any kind are transferred to you.
23-
3. **Licensee Contributions.** Licensee shall submit contributions to the Technology to UCAR through the collaboration
24-
tools provided by UCAR. "Contribution" shall mean any independent original work of authorship, including any enhancements,
25-
improvements, modifications, additions, bug fixes, patches, or upgrades to the Technology that is intentionally submitted
26-
by you to UCAR for inclusion in the Technology. You are the owner of your Contributions, but you acknowledge that UCAR
23+
3. **Licensee Contributions.** Licensee shall submit contributions to the Technology to UCAR through the collaboration
24+
tools provided by UCAR. "Contribution" shall mean any independent original work of authorship, including any enhancements,
25+
improvements, modifications, additions, bug fixes, patches, or upgrades to the Technology that is intentionally submitted
26+
by you to UCAR for inclusion in the Technology. You are the owner of your Contributions, but you acknowledge that UCAR
2727
retains ownership of the Technology.
28-
4. **License Grant to Licensee Contributions.** You hereby grant to UCAR, and to any recipients of the Technology distributed
29-
by UCAR, a perpetual, worldwide, non-exclusive, royalty-free, irrevocable license to reproduce, incorporate freely into the
30-
Technology, sublicense, display, and distribute your Contributions. You represent that you are legally entitled to grant the
28+
4. **License Grant to Licensee Contributions.** You hereby grant to UCAR, and to any recipients of the Technology distributed
29+
by UCAR, a perpetual, worldwide, non-exclusive, royalty-free, irrevocable license to reproduce, incorporate freely into the
30+
Technology, sublicense, display, and distribute your Contributions. You represent that you are legally entitled to grant the
3131
above license. If your employer(s) has rights to intellectual property that you create that includes your Contributions, you
3232
acknowledge that you are allowed to make Contributions on behalf of that employer.
3333
5. **Disclaimer of Warranty/Noninfringement.** THE TECHNOLOGY IS SUPPLIED **AS IS** WITHOUT WARRANTY OF ANY KIND. UCAR DISCLAIMS
34-
ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF NONINFRINGEMENT, ORIGINALITY,
35-
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE WITH REGARD TO THE TECHNOLOGY PROVIDED HEREUNDER. UCAR MAKES NO
36-
REPRESENTATIONS THAT THE USE, OPERATION, SALE, PERFORMANCE, MODIFICATION, REPRODUCTION, DISPLAY OF THE TECHNOLOGY WILL
34+
ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF NONINFRINGEMENT, ORIGINALITY,
35+
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE WITH REGARD TO THE TECHNOLOGY PROVIDED HEREUNDER. UCAR MAKES NO
36+
REPRESENTATIONS THAT THE USE, OPERATION, SALE, PERFORMANCE, MODIFICATION, REPRODUCTION, DISPLAY OF THE TECHNOLOGY WILL
3737
NOT INFRINGE UPON ANY PROPRIETARY RIGHTS OF ANY THIRD PARTY.
38-
6. **Limitation of Liability.** IN NO EVENT SHALL UCAR BE LIABLE TO LICENSEE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL
39-
OR CONSEQUENTIAL DAMAGES, INCLUDING LOST OR ANTICIPATED PROFITS OR REVENUE INCURRED BY LICENSEE OR ANY THIRD PARTY, WHETHER
40-
IN AN ACTION IN CONTRACT OR TORT, EVEN IF UCAR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES IN THE PERFORMANCE OF
41-
THIS LICENSE, OR RELATED TO THE TECHNOLOGY. LICENSEE ALSO ACKNOWLEDGES THAT ANY BREACH OF ITS OBLIGATIONS WITH RESPECT TO
42-
PROPRIETARY RIGHTS WILL CAUSE UCAR IRREPARABLE INJURY FOR WHICH THERE ARE INADEQUATE REMEDIES AT LAW. AS SUCH, UCAR SHALL
38+
6. **Limitation of Liability.** IN NO EVENT SHALL UCAR BE LIABLE TO LICENSEE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL
39+
OR CONSEQUENTIAL DAMAGES, INCLUDING LOST OR ANTICIPATED PROFITS OR REVENUE INCURRED BY LICENSEE OR ANY THIRD PARTY, WHETHER
40+
IN AN ACTION IN CONTRACT OR TORT, EVEN IF UCAR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES IN THE PERFORMANCE OF
41+
THIS LICENSE, OR RELATED TO THE TECHNOLOGY. LICENSEE ALSO ACKNOWLEDGES THAT ANY BREACH OF ITS OBLIGATIONS WITH RESPECT TO
42+
PROPRIETARY RIGHTS WILL CAUSE UCAR IRREPARABLE INJURY FOR WHICH THERE ARE INADEQUATE REMEDIES AT LAW. AS SUCH, UCAR SHALL
4343
BE ENTITLED TO EQUITABLE RELIEF IN ADDITION TO ALL OTHER REMEDIES AVAILABLE TO IT.
44-
7. **High Risk Activities.** The Technology is research-based, not fault-tolerant, and is not designed, manufactured or
45-
intended for use in any operational activities including activities or hazardous environments requiring fail-safe
46-
performance, such as in aircraft navigation or communication systems, air traffic control, weapons systems, nuclear
47-
power plants or critical 24/7 operations, in which the failure of the Technology could lead directly to death, personal
48-
injury, or severe physical or environmental damage (**High Risk Activities**). Accordingly, UCAR specifically disclaims
49-
any express or implied warranties of fitness for High Risk Activities. You agree that UCAR shall not be liable for any
44+
7. **High Risk Activities.** The Technology is research-based, not fault-tolerant, and is not designed, manufactured or
45+
intended for use in any operational activities including activities or hazardous environments requiring fail-safe
46+
performance, such as in aircraft navigation or communication systems, air traffic control, weapons systems, nuclear
47+
power plants or critical 24/7 operations, in which the failure of the Technology could lead directly to death, personal
48+
injury, or severe physical or environmental damage (**High Risk Activities**). Accordingly, UCAR specifically disclaims
49+
any express or implied warranties of fitness for High Risk Activities. You agree that UCAR shall not be liable for any
5050
claims or damages arising from High Risk Activities.
5151
8. **Controlling Law.** This Agreement shall be governed by the laws of the State of Colorado and of the United States.

MANIFEST.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
include CHANGELOG.rst
2+
include CODE_OF_CONDUCT.md
3+
include LICENSE.rst
4+
include README.rst
5+
include requirements.txt
6+
7+
recursive-include pyconform *.py
8+
recursive-exclude * __pycache__
9+
recursive-exclude * *.py[co]
10+
prune ci*

README.rst

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3895009.svg
22
:target: https://doi.org/10.5281/zenodo.3895009
33

4+
.. image:: https://codecov.io/gh/NCAR/PyConform/branch/master/graph/badge.svg
5+
:target: https://codecov.io/gh/NCAR/PyConform
6+
7+
.. image:: https://github.com/NCAR/PyConform/workflows/Tests/badge.svg
8+
:target: https://github.com/NCAR/PyConform/actions?query=workflow%3ATests
9+
10+
.. image:: https://github.com/NCAR/PyConform/workflows/Linting/badge.svg
11+
:target: https://github.com/NCAR/PyConform/actions?query=workflow%3ALinting
12+
413
PyConform
514
=========
615

716
A package for transforming a NetCDF dataset into a defined format
817
suitable for publication according to a defined publication standard.
918

1019
:AUTHORS: Sheri Mickelson, Kevin Paul
11-
:COPYRIGHT: 2017, University Corporation for Atmospheric Research
20+
:COPYRIGHT: 2020, University Corporation for Atmospheric Research
1221
:LICENSE: See the LICENSE.rst file for details
1322

1423
Send questions and comments to Kevin Paul ([email protected]) or
@@ -81,9 +90,11 @@ Dependencies
8190
The PyConform package directly depends upon 4 main external packages:
8291

8392
* ASAPTools (>=0.6)
84-
* netCDF4-python
8593
* cf-units
8694
* dreqpy
95+
* netCDF4-python
96+
* ply
97+
* python-dateutil
8798

8899
These dependencies imply the dependencies:
89100

@@ -146,27 +157,3 @@ user installs, and therefore only needs to be added to the PYTHONPATH once.
146157
The documentation_ for PyConform is hosted on GitHub Pages.
147158

148159
.. _documentation: https://ncar.github.io/pyconform
149-
150-
151-
Before Using the PyConform Package
152-
----------------------------------
153-
154-
Before the PyConform package can be used, you must make sure that the
155-
site-packages directory containing the 'pyconform' source directory is in
156-
your PYTHONPATH. Depending on the PREFIX used during installation, this
157-
path should look like be::
158-
159-
$PREFIX/lib/python2.7/site-packages
160-
161-
depending on the version of Python that you
162-
are using to install the package.
163-
164-
To use the PyConform scripts (e.g., ...), you must add the
165-
script binary directory to your PATH. Depending on the PREFIX used during
166-
installation, this path will be::
167-
168-
$PREFIX/bin/
169-
170-
Once the script binary directory has been added to your PATH and the
171-
site-packages directory has been added to your PYTHONPATH, you may use the
172-
PyConform package without issue.

ci/environment.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: pyconform
2+
channels:
3+
- conda-forge
4+
- defaults
5+
dependencies:
6+
- bumpversion
7+
- coverage
8+
- mpi4py
9+
- netcdf4
10+
- numpy
11+
- pip
12+
- ply
13+
- pynio
14+
- pyngl
15+
- pytest
16+
- pytest-cov
17+
- python-dateutil
18+
- pip:
19+
- asaptools
20+
- cf_units
21+
- dreqPy

ci/runtests.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -eo pipefail
5+
6+
coverage run -m pytest tests/
7+
coverage xml

0 commit comments

Comments
 (0)