Skip to content

Commit

Permalink
Merge pull request #91 from WikiWatershed/tt/github-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadain authored Dec 27, 2021
2 parents 18387f1 + c235e0e commit 0d95314
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This workflow will install Python dependencies, run tests and lint for Python 3.9
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Test

on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- 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
- name: Test with nosetests
run: |
nosetests --verbosity=2
2 changes: 1 addition & 1 deletion CreateVariableFiles.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os


variable_name = raw_input("Enter the name of the variable:")
variable_name = input("Enter the name of the variable:")

#write variable file
var_filename = "%s.py"%(variable_name)
Expand Down
3 changes: 2 additions & 1 deletion gwlfe/DailyArrayConverter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import random

import numpy as np
import numpy.ma as ma
# from numba import jit
from numpy import array
Expand Down Expand Up @@ -63,7 +64,7 @@


def mask_builder(DaysMonth):
ones = ravel(ones((12, 31))).astype("int")
ones = ravel(np.ones((12, 31))).astype("int")
slices = []
for i, month in enumerate(DaysMonth[0]):
slices.append(slice(31 * i, 31 * i + month))
Expand Down

0 comments on commit 0d95314

Please sign in to comment.