Skip to content

Commit

Permalink
Merge branch 'ARM-DOE:main' into icartt-write
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobrien91 authored Aug 29, 2024
2 parents ad88fe2 + eed7afd commit 65d44e6
Show file tree
Hide file tree
Showing 198 changed files with 5,690 additions and 1,528 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
actions:
patterns:
- "*"
2 changes: 1 addition & 1 deletion .github/workflows/antivirus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
name: AV scan
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Git AV Scan
uses: djdefi/gitavscan@main
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Install dependencies
- name: Setup Conda Environment
Expand All @@ -44,7 +44,7 @@ jobs:
AIRNOW_API: ${{ secrets.AIRNOW_API }}
# Push the book's HTML to github-pages
- name: GitHub Pages action
uses: peaceiris/actions-gh-pages@v3.8.0
uses: peaceiris/actions-gh-pages@v4.0.0
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Run Unit Tests CI

on:
schedule:
# Runs at 09Z (2am CDT)
- cron: "0 9 * * *"
push:
branches: [ main ]
pull_request:
Expand Down Expand Up @@ -38,7 +41,7 @@ jobs:
platform: [x64]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Conda Environment
uses: mamba-org/setup-micromamba@v1
Expand All @@ -64,10 +67,12 @@ jobs:
python -m pytest -v --mpl --cov=./ --cov-report=xml
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v2.1.0
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ jobs:

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

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -57,7 +57,7 @@ jobs:
# 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
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -71,4 +71,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v3
33 changes: 33 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: linting

on:
push:
pull_request:
workflow_dispatch:

jobs:
pre-job:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
concurrent_skipping: 'same_content'
skip_after_successful_duplicate: 'false'
do_not_skip: '["workflow_dispatch", "schedule"]'
linting:
needs: pre-job
runs-on: ubuntu-latest
if: ${{ needs.pre-job.outputs.should_skip != 'true' }}
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: pre-commit/[email protected]
14 changes: 7 additions & 7 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest
if: github.repository == 'ARM-DOE/ACT'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: 3.11
Expand All @@ -36,7 +36,7 @@ jobs:
else
echo "✅ Looks good"
fi
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: releases
path: dist
Expand All @@ -45,11 +45,11 @@ jobs:
needs: build-artifacts
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: "3.x"
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: releases
path: dist
Expand All @@ -62,12 +62,12 @@ jobs:
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: releases
path: dist
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@v1.8.10
uses: pypa/gh-action-pypi-publish@v1.9.0
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
Expand Down
13 changes: 4 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ repos:
- id: check-docstring-first
- id: check-json
- id: check-yaml
- id: double-quote-string-fixer
- id: debug-statements
- id: mixed-line-ending

Expand All @@ -24,12 +23,8 @@ repos:
- id: black
- id: black-jupyter

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.239'
hooks:
- id: flake8

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
- id: ruff
args: [ "--fix" ]
33 changes: 8 additions & 25 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -247,39 +247,22 @@ An example:
Code Style
----------

ACT follows PEP8 coding standards. To make sure your code follows the
PEP8 style, you can use a variety of tools that can check for you. Two
popular PEP8 check modules are flake8 and pylint. (Note: ACT's continuous
integration uses flake8).
Py-ART uses pre-commit for linting, which applies a variety of pep8 and other
code style rules.

For more on pep8 style:

- https://www.python.org/dev/peps/pep-0008/

To install flake8::
To install pre-commit hooks for the Py-ART repo::

conda install -c conda-forge flake8
pre-commit install

To use flake8::
Afterwards, pre-commit will run on every commit to the repository. It will
re-format files as neccessary.

flake8 path/to/code/to/check.py

To install pylint::

conda install pylint

To use pylint::

pylint path/to/code/to/check.py

Both of these tools are highly configurable to suit a user's taste. Refer to
the tools documentation for details on this process.

- https://flake8.pycqa.org/en/latest/
- https://www.pylint.org/

Naming Convenction
----------------------------------------
Naming Convention
-----------------

Discovery
~~~~~~~~~
Expand Down
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ include LICENSE.txt

recursive-exclude * __pycache__
recursive-exclude * *.py[co]
recursive-include act/plotting *.txt
recursive-include act/tests *

recursive-include act/plotting *.txt
recursive-include tests *.py *.png
recursive-include docs *.rst conf.py Makefile make.bat

include versioneer.py
Expand Down
27 changes: 12 additions & 15 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ Atmospheric data Community Toolkit (ACT)

|AnacondaCloud| |CodeCovStatus| |Build| |Docs|

|CondaDownloads| |Zenodo| |ARM|
|CondaDownloads| |PyPiDownloads| |Zenodo| |ARM|

.. |AnacondaCloud| image:: https://anaconda.org/conda-forge/act-atmos/badges/version.svg
:target: https://anaconda.org/conda-forge/act-atmos

.. |CondaDownloads| image:: https://anaconda.org/conda-forge/act-atmos/badges/downloads.svg
:target: https://anaconda.org/conda-forge/act-atmos/files

.. |PyPiDownloads| image:: https://img.shields.io/pypi/dm/act_atmos.svg
:target: https://pypi.org/project/act-atmos/

.. |Zenodo| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3855537.svg
:target: https://doi.org/10.5281/zenodo.3855537

Expand All @@ -38,16 +41,14 @@ Please report any issues or feature requests by sumitting an `Issue <https://git
Version 2.0
~~~~~~~~~~~

ACT will soon have a version 2.0 release. This release will contain many function
ACT now has a version 2.0 release. This release contains many function
naming changes such as IO and Discovery module function naming changes. To
prepare for this release, a `v2.0 <https://arm-doe.github.io/ACT/userguide/GUIDE_V2.html>`_
has been provided that explains the changes and how to work with the new syntax.

To test out the release candidate 2.0.0-rc.0 of ACT, use::

pip install git+https://github.com/ARM-DOE/[email protected]
The new release is available on both PyPI and conda-forge.

Please report any bugs of the release candidate to the Issue Tracker mentioned in
Please report any bugs of the 2.0 release to the Issue Tracker mentioned in
the Important Links section below.

Important Links
Expand Down Expand Up @@ -144,18 +145,14 @@ the source code or use git to checkout the repository::

git clone https://github.com/ARM-DOE/ACT.git

To install in your home directory, use::

python setup.py install --user
Once you have the directory locally, you can install ACT in
development mode using::

To install for all users on Unix/Linux::

python setup.py build
sudo python setup.py install
pip install -e .

Development install using pip from within the ACT directory::
If you want to install the repository directly, you can use::

pip install -e .
pip install git+https://github.com/ARM-DOE/ACT.git

Contributing
~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion act/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
register_matplotlib_converters()

# Import early so these classes are available to the object
from .qc import QCFilter, QCTests, clean
from .qc import QCFilter, QCTests, clean # noqa

# Import the lazy loaded modules
submodules = [
Expand Down
4 changes: 2 additions & 2 deletions act/corrections/mpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ def correct_mpl(
x_data = x_data - x_ap

# R-Squared Correction
co_data = co_data * height ** 2
x_data = x_data * height ** 2
co_data = co_data * height**2
x_data = x_data * height**2

# Overlap Correction
for j in range(ds[range_bins_var_name].size):
Expand Down
5 changes: 3 additions & 2 deletions act/discovery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@

__getattr__, __dir__, __all__ = lazy.attach(
__name__,
submodules=['arm', 'cropscape', 'airnow', 'noaapsl', 'neon', 'surfrad'],
submodules=['arm', 'asos', 'airnow', 'cropscape', 'improve', 'noaapsl', 'neon', 'surfrad'],
submod_attrs={
'arm': ['download_arm_data', 'get_arm_doi'],
'asos': ['get_asos_data'],
'airnow': ['get_airnow_bounded_obs', 'get_airnow_obs', 'get_airnow_forecast'],
'cropscape': ['get_crop_type'],
'improve': ['get_improve_data'],
'noaapsl': ['download_noaa_psl_data'],
'neon': ['get_neon_site_products', 'get_neon_product_avail', 'download_neon_data'],
'surfrad': ['download_surfrad_data']
'surfrad': ['download_surfrad_data'],
},
)
Loading

0 comments on commit 65d44e6

Please sign in to comment.