Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
arkottke committed Jun 30, 2023
2 parents 6ef2d0d + 32d9a46 commit 23d8b00
Show file tree
Hide file tree
Showing 26 changed files with 7,580 additions and 469 deletions.
2 changes: 2 additions & 0 deletions .git-blame-ignore-rev
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Migrate code style to Black
cae0ab0ac9be3878d844502c1ccc2d422599d190
13 changes: 13 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Lint

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: psf/black@stable
with:
args: ". --check"
51 changes: 51 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Python application

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, ]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements_dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
if [ -f requirements_dev.txt ]; then pip install -r requirements_dev.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: Install
run: |
pip install -e .
- name: Test with pytest
run: |
make test
coverage xml
- name: Run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@master
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.xml
31 changes: 31 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
release:
types: [created]

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.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
31 changes: 20 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
- repo: git://github.com/pre-commit/mirrors-yapf
sha: v0.16.0
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: yapf
- repo: git://github.com/pre-commit/pre-commit-hooks
sha: 5bf6c09bfa1297d3692cadd621ef95f1284e33c0
- id: trailing-whitespace
- id: check-json
- id: check-yaml
- id: end-of-file-fixer
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.10.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: flake8
exclude: docs/conf.py
- id: check-yaml
- id: check-merge-conflict
- id: reorder-python-imports
- repo: https://github.com/psf/black
rev: 23.3.0 # Replace by any tag/version: https://github.com/psf/black/tags
hooks:
- id: black
language_version: python3 # Should be a command that runs python3.6+
# - repo: https://github.com/pycqa/pydocstyle
# rev: 5.1.1 # pick a git hash / tag to point to
# hooks:
# - id: pydocstyle
# exclude: test_*
5 changes: 0 additions & 5 deletions .stickler.yml

This file was deleted.

23 changes: 11 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
language: python
cache: pip
python:
- '3.7'
install:
- pip install -r requirements_dev.txt
- python setup.py install
script:
- make test
after_success:
- coveralls
before_install:
- sudo apt-get update
- pip install -r requirements_dev.txt
- python setup.py install
- coverage xml
- python-codacy-coverage -r coverage.xml
deploy:
provider: pypi
user: arkottke
Expand All @@ -13,10 +19,3 @@ deploy:
tags: true
distributions: sdist bdist_wheel
repo: arkottke/pyrotd
python: '3.6'
language: python
python:
- '2.7'
- '3.6'
script:
- pytest -v --cov-report term --cov=pyrotd
17 changes: 17 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
History
=======

0.6.0 (2023-06-19)
------------------
- Added optimization based on Stewart et al. (2017) algorithm
- Added support for computing rotated PGA, PGV, and PGD

0.5.4 (2018-07-27)
------------------
- Added MANIFEST.in

0.5.3 (2018-07-27)
------------------
- Fix packaging issues

0.5.2 (2018-03-26)
------------------
- Bump version for PyPi conflict

0.5.1 (2018-03-23)
------------------
- Added tests/ directory
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 Albert Kottke

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include LICENSE
include README.rst
include HISTORY.rst
include requirements.txt
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ lint:
flake8 pyrotd tests

test:
python setup.py test
py.test --cov-report html --cov=pyrotd tests/

coverage:
coverage run --source pyrotd.py setup.py test
Expand Down
53 changes: 25 additions & 28 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,35 +1,10 @@
pyRotd
======
pyrotd
======

.. image:: https://img.shields.io/pypi/v/pyrotd.svg
:target: https://pypi.python.org/pypi/pyrotd
:alt: PyPi Cheese Shop

.. image:: https://img.shields.io/travis/arkottke/pyrotd.svg
:target: https://travis-ci.org/arkottke/pyrotd
:alt: Build Status

.. image:: https://readthedocs.org/projects/pyrotd/badge/?version=latest&style=flat
:target: https://pyrotd.readthedocs.org
:alt: Documentation Status

.. image:: https://coveralls.io/repos/github/arkottke/pyrotd/badge.svg?branch=master
:target: https://coveralls.io/github/arkottke/pyrotd?branch=master
:alt: Test Coverage

.. image:: https://img.shields.io/badge/license-MIT-blue.svg
:target: https://github.com/arkottke/pyrotd/blob/master/LICENSE
:alt: License

.. image:: https://zenodo.org/badge/2800441.svg
:target: https://zenodo.org/badge/latestdoi/2800441
|PyPi Cheese Shop| |Documentation| |Build Status| |Code Quality| |Test Coverage| |License| |DOI|

Acceleration response spectrum calculations implemented in Python.

* Free software: MIT license
* Documentation: https://pyrotd.readthedocs.org.

Introduction
------------

Expand Down Expand Up @@ -73,4 +48,26 @@ Rotated spectral accelerations may be computed for a pair of time series::

A more detailed example is in `this`_ Jupyter Notebook.

.. _this: https://github.com/arkottke/pyrotd/blob/master/example.ipynb
.. _this: https://github.com/arkottke/pyrotd/blob/master/examples/example-2.ipynb

Citation
--------

Please cite this software using the DOI_.

.. _DOI: https://zenodo.org/badge/latestdoi/2800441

.. |PyPi Cheese Shop| image:: https://img.shields.io/pypi/v/pyrotd.svg
:target: https://img.shields.io/pypi/v/pyrotd.svg
.. |Documentation| image:: https://readthedocs.org/projects/pyrotd/badge/?version=latest
:target: https://pyrotd.readthedocs.io/?badge=latest
.. |Build Status| image:: https://travis-ci.org/arkottke/pyrotd.svg?branch=master
:target: https://travis-ci.org/arkottke/pyrotd
.. |Code Quality| image:: https://api.codacy.com/project/badge/Grade/d449720a4b92474da6b18e040d6729f5
:target: https://www.codacy.com/manual/arkottke/pyrotd
.. |Test Coverage| image:: https://api.codacy.com/project/badge/Coverage/d449720a4b92474da6b18e040d6729f5
:target: https://www.codacy.com/manual/arkottke/pyrotd
.. |License| image:: https://img.shields.io/badge/license-MIT-blue.svg
.. |DOI| image:: https://zenodo.org/badge/2800441.svg
:target: https://zenodo.org/badge/latestdoi/2800441

0 comments on commit 23d8b00

Please sign in to comment.