Skip to content

Commit

Permalink
Merge branch 'ARM-DOE:main' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ajsockol authored Jan 30, 2024
2 parents 976002b + cb21eb1 commit 0641d93
Show file tree
Hide file tree
Showing 450 changed files with 29,298 additions and 10,893 deletions.
6 changes: 5 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
[run]
omit =./act/tests/*, ./act/*version*py
omit =
*tests*
act/*version*py
versioneer.py
setup.py
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
* ACT version:
* Python version:
* Operating System:

### Description

Describe what you were trying to get done.
Tell us what happened, what went wrong, and what you expected to happen.

### What I Did

```
Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.
```
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- Please remove check-list items that aren't relevant to your changes -->

- [ ] Closes #xxxx
- [ ] Tests added
- [ ] Documentation reflects changes
- [ ] PEP8 Standards or use of linter
- [ ] Xarray Dataset or DataArray variable naming follows 'ds' or 'da' naming
14 changes: 14 additions & 0 deletions .github/workflows/antivirus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
on:
pull_request:
types: [assigned, opened, synchronize, reopened, closed]

jobs:
gitavscan:
runs-on: ubuntu-latest
name: AV scan
steps:
- uses: actions/checkout@v3
- name: Git AV Scan
uses: djdefi/gitavscan@main
with:
full: '--full'
52 changes: 52 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: build-docs

on:
push:
branches:
- main
pull_request:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# This job installs dependencies, build the website, and pushes it to `gh-pages`
jobs:
deploy-website:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3

# Install dependencies
- name: Setup Conda Environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: docs/environment_docs.yml
environment-name: act-docs
cache-downloads: true

- name: Install ACT
run: |
pip install -e . --no-deps --force-reinstall
# Build the website
- name: Build the site
run: |
cd docs
make html
env:
ARM_USERNAME: ${{ secrets.ARM_USERNAME }}
ARM_PASSWORD: ${{ secrets.ARM_PASSWORD }}
AIRNOW_API: ${{ secrets.AIRNOW_API }}
# Push the book's HTML to github-pages
- name: GitHub Pages action
uses: peaceiris/[email protected]
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html
cname: https://arm-doe.github.io/ACT/
73 changes: 73 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Run Unit Tests CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

# Cancel concurrent runs
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
ARM_USERNAME: ${{ secrets.ARM_USERNAME }}
ARM_PASSWORD: ${{ secrets.ARM_PASSWORD }}
AIRNOW_API: ${{ secrets.AIRNOW_API }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_TOKEN: ${{ secrets.COVERLALLS_REPO_TOKEN }}

jobs:
build:
name: ${{ matrix.os }}-${{ matrix.python-version }}
if: github.repository == 'ARM-DOE/ACT'
runs-on: ${{ matrix.os }}-latest
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [macOS, ubuntu, Windows]
inlcude:
- os: macos-latest
PLAT: arm64
INTERFACE64: ""
platform: [x64]

steps:
- uses: actions/checkout@v3

- name: Setup Conda Environment
uses: mamba-org/setup-micromamba@v1
with:
create-args: python=${{ matrix.python-version }}
environment-file: ./continuous_integration/environment_actions.yml
environment-name: act_env

- name: Install ACT
run: |
python -m pip install -e . --no-deps --force-reinstall
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# Switching back to original flake
python -m flake8 --max-line-length=127 --ignore=F401,E402,W504,W605,F403
- name: Test with pytest
run: |
python -m pytest -v --mpl --cov=./ --cov-report=xml
- name: Upload code coverage to Codecov
uses: codecov/[email protected]
with:
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
74 changes: 74 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '42 7 * * 5'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
74 changes: 74 additions & 0 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Build and Upload ACT Release to PyPI
on:
release:
types:
- published

jobs:
build-artifacts:
runs-on: ubuntu-latest
if: github.repository == 'ARM-DOE/ACT'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: 3.11

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install setuptools setuptools-scm wheel twine check-manifest
- name: Build tarball and wheels
run: |
git clean -xdf
git restore -SW .
python -m build --sdist --wheel .
- name: Check built artifacts
run: |
python -m twine check dist/*
pwd
if [ -f dist/act-atmos-0.0.0.tar.gz ]; then
echo "❌ INVALID VERSION NUMBER"
exit 1
else
echo "✅ Looks good"
fi
- uses: actions/upload-artifact@v3
with:
name: releases
path: dist

test-built-dist:
needs: build-artifacts
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: "3.x"
- uses: actions/download-artifact@v3
with:
name: releases
path: dist
- name: List contents of built dist
run: |
ls -ltrh
ls -ltrh dist
upload-to-pypi:
needs: test-built-dist
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: releases
path: dist
- name: Publish package to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
verbose: true
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,23 @@ target/

# Files on local computer
*.xml

# Test files downloaded locally
**/bck_Radar_FMCW_Bright_Band/
**/bck_Radar_FMCW_Moment/
**/ctd_449RWP_Bright_Band/
**/ctd_449RWP_Sub-Hour_Temp/
**/ctd_449RWP_Sub-Hour_Wind/
**/ctd_449RWP_Wind/
**/ctd_915RWP_Sub-Hour_Temp/
**/ctd_915RWP_Sub-Hour_Wind/
**/ctd_915RWP_Temp/
**/ctd_915RWP_Wind/
**/ctd_GpsTrimble/
**/ctd_Pressure/
**/ctd_Radar_S-band_Bright_Band/
**/ctd_Radar_S-band_Moment/
**/kps_Radar_FMCW_Moment/
**/BARR_DP1.00002.001/
data/*ctd
act/tests/data/*stats*
35 changes: 35 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-docstring-first
- id: check-json
- id: check-yaml
- id: double-quote-string-fixer
- id: debug-statements
- id: mixed-line-ending

- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args:
- '--py38-plus'

- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
- id: black-jupyter

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
Loading

0 comments on commit 0641d93

Please sign in to comment.