Skip to content

Commit

Permalink
Merge pull request #56 from austinorr/rc-0.2.0
Browse files Browse the repository at this point in the history
Rc 0.2.0
  • Loading branch information
austinorr authored Jun 21, 2022
2 parents 8bdc5cb + ec75d0a commit 051fb11
Show file tree
Hide file tree
Showing 32 changed files with 253 additions and 412 deletions.
1 change: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
[run]
source = cloudside
branch = True
include = cloudside/*.py
omit =
cloudside/tests/*

Expand Down
4 changes: 3 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
root = true

[*]
insert_final_newline = true

[*.py]
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8
end_of_line = lf

[*.bat]
indent_style = tab
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ jobs:
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Black Code Formatter
uses: lgeiger/[email protected]
with:
args: ". --check"
- uses: actions/checkout@v1
- name: Black Code Formatter
uses: lgeiger/[email protected]
with:
args: ". --check"
32 changes: 0 additions & 32 deletions .github/workflows/check-test-coverage.yml

This file was deleted.

104 changes: 104 additions & 0 deletions .github/workflows/lint_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Lint, Test, and Cover

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev]
- 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 --exclude .git,docs/*
# 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: Blacken
run: black . --check

test-install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install Cloudside
run: |
python -m pip install --upgrade pip
pip install .
- name: Check basic functionality
run: |
cloudside get-asos KPDX 2020-01-01 2020-02-01 [email protected]
test-python:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
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
pip install .[dev]
- name: Test with pytest
run: |
pytest -v
test-python-mpl:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev]
- name: Test with pytest and check images
run: |
pytest --mpl
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Generate coverage report
run: |
python -m pip install --upgrade pip
pip install .[dev]
coverage run -m pytest --doctest-modules --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
path_to_write_report: ./codecov_report.gz
36 changes: 17 additions & 19 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,25 @@ name: Upload Python Package to PyPI

on:
release:
types: [created]
types: [published]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PMH_PYPI_USER }}
TWINE_PASSWORD: ${{ secrets.PMH_PYPI_PASS }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PMH_PYPI_USER }}
TWINE_PASSWORD: ${{ secrets.PMH_PYPI_PASS }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
33 changes: 0 additions & 33 deletions .github/workflows/python-runlinter.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/python-runtests-basic.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/python-runtests-img-comp.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .travis.yml

This file was deleted.

16 changes: 10 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ Basically I wanted a library that could do something like this:
.. code:: python
import cloudside
data = cloudside.asos.get_data('KPDX', '2012-12-01', '2015-05-01, 'me@mydomain.com')
fig = cloudside.viz.rose(data)
data = cloudside.asos.get_data('KPDX', '2012-12-01', '2015-05-01', '[email protected]')
fig, rose_data = cloudside.viz.rose(data, magcol="wind_speed", dircol="wind_direction")
.. image:: docs/img/rose.png
:width: 400
:alt: KPDX Rose Plot

And so ``cloudside`` does that.
After installation, you can also directly use it from the command line ::
Expand All @@ -41,13 +45,13 @@ You can also fetch data from Portland's Hydra Network of rain gauges:
or from the command line ::

$ cloudside get-hydra Beaumont

Bigger Example
--------------

.. code:: python
import pandas
import pandas
import cloudside
def summarizer(g):
Expand All @@ -68,8 +72,8 @@ Bigger Example
.assign(antecedent_hours=lambda df: (df['start'] - df['end'].shift()).dt.total_seconds() / 3600)
.assign(ends_on_weekday=lambda df: df['end'].dt.weekday < 5)
)
data = cloudside.asos.get_data('KPDX', '2012-12-01', '2015-05-01, 'me@mydomain.com')
data = cloudside.asos.get_data('KPDX', '2012-12-01', '2015-05-01', '[email protected]')
storms = cloudside.storms.parse_record(data, intereventHours=6, outputfreqMinutes=5, precipcol='precip_inches')
storm_stats = storm_totaller(storms)
with pandas.ExcelWriter('output.xlsx') as xl:
Expand Down
Loading

0 comments on commit 051fb11

Please sign in to comment.