Skip to content

Commit 8236001

Browse files
authored
Merge pull request #14 from mkstratos/master
2 parents 43e3117 + 16fc51b commit 8236001

Some content is hidden

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

43 files changed

+398
-306
lines changed

.git-blame-ignore-revs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
0e03e4395fae0aa0b6ab475feb054e53135f2352
1+
0e03e4395fae0aa0b6ab475feb054e53135f2352
2+
09fe85c8c46dceb03d9dfa4a0d6453e308c02712

.github/workflows/pre-commit.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Pre-Commit
5+
6+
on:
7+
push:
8+
branches: [ "master" ]
9+
pull_request:
10+
branches: [ "master" ]
11+
12+
jobs:
13+
14+
pre-commit:
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 2
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
- name: Set up python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: 3.11
24+
- name: Runs pre-commit
25+
run: |
26+
pip install pre-commit
27+
pre-commit run -a
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Python package
5+
6+
on:
7+
push:
8+
branches: [ "master" ]
9+
pull_request:
10+
branches: [ "master" ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
python-version: ["3.9", "3.10", "3.11", "3.12"]
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Install dependencies
28+
run: |
29+
python3 -m pip install --upgrade pip
30+
python3 -m pip install pytest
31+
python3 -m pip install -e .\[dev\]
32+
- name: Test with pytest
33+
run: |
34+
pytest -vvv
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package
10+
11+
on:
12+
release:
13+
types: [published]
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
deploy:
20+
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Set up Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: '3.x'
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install build
33+
- name: Build package
34+
run: python -m build
35+
- name: Publish package
36+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
37+
with:
38+
user: __token__
39+
password: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test/*_test
44
test/*_test_*
5+
test/data
56

67
#####=== Vim ===#####
78
[._]*.s[a-w][a-z]
@@ -67,4 +68,3 @@ docs/_build/
6768

6869
# PyBuilder
6970
target/
70-

.pre-commit-config.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.0.1
4+
hooks:
5+
- id: end-of-file-fixer
6+
- id: trailing-whitespace
7+
- id: check-toml
8+
- repo: https://github.com/psf/black
9+
rev: 22.3.0
10+
hooks:
11+
- id: black
12+
- repo: https://github.com/pycqa/isort
13+
rev: 5.13.2
14+
hooks:
15+
- id: isort
16+
- repo: https://github.com/astral-sh/ruff-pre-commit
17+
# Ruff version.
18+
rev: v0.3.7
19+
hooks:
20+
# Run the linter.
21+
- id: ruff

LICENSE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,3 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
2525
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
2626
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28-

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ Want to send us a private message?
2020
* github: @mkstratos
2121
* email: <a href="mailto:[email protected]">kelleherme [at] ornl.gov</a>
2222

23-
**Joseph H. Kennedy**
23+
**Joseph H. Kennedy**
2424
* github: @jhkennedy
2525
* email: <a href="mailto:[email protected]">kennedyjh [at] ornl.gov</a>

evv4esm/__main__.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,16 @@
2828
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2929
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3030

31+
import argparse
3132
import os
3233
import sys
3334
import time
34-
import argparse
3535

36-
import evv4esm
3736
import livvkit
3837
from livvkit.util import options
3938

39+
import evv4esm
40+
4041

4142
def parse_args(args=None):
4243
parser = argparse.ArgumentParser(
@@ -110,27 +111,26 @@ def main(cl_args=None):
110111
cl_args = sys.argv[1:]
111112
args = parse_args(cl_args)
112113

113-
print("--------------------------------------------------------------------")
114-
print(" ______ __ __ __ __ ")
115-
print(" | ____| \ \ / / \ \ / / ")
116-
print(" | |__ \ \ / / \ \ / / ")
117-
print(" | __| \ \/ / \ \/ / ")
118-
print(" | |____ \ / \ / ")
119-
print(" |______| \/ \/ ")
120-
print(" ")
121-
print(" Extended Verification and Validation for Earth System Models ")
122-
print("--------------------------------------------------------------------")
114+
print(r"--------------------------------------------------------------------")
115+
print(r" ______ __ __ __ __ ")
116+
print(r" | ____| \ \ / / \ \ / / ")
117+
print(r" | |__ \ \ / / \ \ / / ")
118+
print(r" | __| \ \/ / \ \/ / ")
119+
print(r" | |____ \ / \ / ")
120+
print(r" |______| \/ \/ ")
121+
print(r" ")
122+
print(r" Extended Verification and Validation for Earth System Models ")
123+
print(r"--------------------------------------------------------------------")
123124
print("")
124125
print(" Current run: " + livvkit.timestamp)
125126
print(" User: " + livvkit.user)
126127
print(" OS Type: " + livvkit.os_type)
127128
print(" Machine: " + livvkit.machine)
128129
print(" " + livvkit.comment)
129130

131+
from livvkit import elements, scheduler
130132
from livvkit.components import validation
131-
from livvkit import scheduler
132133
from livvkit.util import functions
133-
from livvkit import elements
134134

135135
livvkit.pool_size = args.pool_size
136136
if args.extensions:

evv4esm/ensembles/e3sm.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,15 @@
3030

3131
"""E3SM specific ensemble functions."""
3232

33-
import six
34-
33+
import glob
3534
import os
3635
import re
37-
import glob
38-
3936
from collections import OrderedDict
4037
from functools import partial
4138

4239
import numpy as np
4340
import pandas as pd
41+
import six
4442
from netCDF4 import Dataset
4543

4644

0 commit comments

Comments
 (0)