Skip to content

Commit

Permalink
Fixed ruff issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
arkottke committed Jul 2, 2024
1 parent 9a7d946 commit 3a91626
Show file tree
Hide file tree
Showing 39 changed files with 795 additions and 2,165 deletions.
90 changes: 45 additions & 45 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,49 @@ name: Python application
on: [push, pull_request]

jobs:
build:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]

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

steps:
- uses: actions/checkout@main
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@main
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@main
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@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.xml
steps:
- uses: actions/checkout@main
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@main
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@main
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@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.xml
59 changes: 29 additions & 30 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,35 @@
name: Upload Python Package

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

jobs:
deploy:
deploy:
runs-on: ubuntu-latest

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@main
- name: Set up Python
uses: actions/setup-python@main
with:
python-version: '3.x'
- name: Install dependencies
run: >-
python -m
pip install
build
wheel
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution package to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
steps:
- uses: actions/checkout@main
- name: Set up Python
uses: actions/setup-python@main
with:
python-version: "3.x"
- name: Install dependencies
run: >-
python -m
pip install
build
wheel
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution package to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
30 changes: 15 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
language: python
cache: pip
python:
- '3.7'
- "3.7"
install:
- pip install -r requirements_dev.txt
- python setup.py install
- pip install -r requirements_dev.txt
- python setup.py install
script:
- make test
- make test
after_success:
- coverage xml
- python-codacy-coverage -r coverage.xml
- coverage xml
- python-codacy-coverage -r coverage.xml
deploy:
provider: pypi
user: arkottke
password:
secure: FfmTw7ima0b3hjHe3tamYGzYvdPAY2qDiLcwJezfT7422ECARQolcC0Zl6QTAyGJWlYHwDb77F1R/QoZf9DMViN8uOXItV3IHP2nAkr+MxcAdcrHaUJyxQ45jC297siA8YxK9MrTQOGgVL2Hdu7UOOF85BUT6D9JIx9vcgH0jUg=
skip_existing: true
distributions: sdist bdist_wheel
on:
repo: arkottke/pystrata
tags: true
provider: pypi
user: arkottke
password:
secure: FfmTw7ima0b3hjHe3tamYGzYvdPAY2qDiLcwJezfT7422ECARQolcC0Zl6QTAyGJWlYHwDb77F1R/QoZf9DMViN8uOXItV3IHP2nAkr+MxcAdcrHaUJyxQ45jC297siA8YxK9MrTQOGgVL2Hdu7UOOF85BUT6D9JIx9vcgH0jUg=
skip_existing: true
distributions: sdist bdist_wheel
on:
repo: arkottke/pystrata
tags: true
4 changes: 2 additions & 2 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Development Lead

- Albert Kottke \<<[email protected]>\>
- Albert Kottke \<<[email protected]>\>

## Contributors

- Maxim Millen
- Maxim Millen
57 changes: 29 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,35 @@ Docs](https://img.shields.io/readthedocs/pystrata)](https://pystrata.readthedocs
Site response analyses implemented in Python. This Python packages aims
to implement many of the features found in
[Strata](https://github.com/arkottke/strata). These features include:
- Input motion characterization:
- Time series
- Random vibration theory
- Wave propagation or site amplification:
- linear
- equivalent-linear
- equivalent-linear with frequency dependent properties
- quarter wavelength
- Nonlinear curve models:
- Predictive models:
- Darendeli (2001)
- Menq (2004)
- Kishida (2012)
- Curves:
- Vucetic & Dobry (1991)
- EPRI (1993)
- GEI (1983)
- GeoMatrix (1990)
- Idriss (1990)
- Imperial Valley Soils
- Iwasaki
- Peninsular Range
- Seed & Idriss
- Site and soil property uncertainty:
- Toro (1994) Vs correlation model
- G/Gmax and D uncertainty:
- Darendeli (2001)
- EPRI SPID (2013)

- Input motion characterization:
- Time series
- Random vibration theory
- Wave propagation or site amplification:
- linear
- equivalent-linear
- equivalent-linear with frequency dependent properties
- quarter wavelength
- Nonlinear curve models:
- Predictive models:
- Darendeli (2001)
- Menq (2004)
- Kishida (2012)
- Curves:
- Vucetic & Dobry (1991)
- EPRI (1993)
- GEI (1983)
- GeoMatrix (1990)
- Idriss (1990)
- Imperial Valley Soils
- Iwasaki
- Peninsular Range
- Seed & Idriss
- Site and soil property uncertainty:
- Toro (1994) Vs correlation model
- G/Gmax and D uncertainty:
- Darendeli (2001)
- EPRI SPID (2013)

Development of this software is on-going and any contributions are
encouraged. Previously named `pysra`, but renamed after some sage and
Expand Down
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# pyStrata documentation build configuration file, created by
# sphinx-quickstart on Mon Nov 2 15:41:52 2015.
Expand Down
3 changes: 2 additions & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ The examples included here are used to demonstrate the capabilities of
15. List of provided nonlinear curves.

To be added:
- Impact of peak factor on site reponse transfer function

- Impact of peak factor on site reponse transfer function
2 changes: 1 addition & 1 deletion examples/data/NIS090.AT2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PEER NGA STRONG MOTION DATABASE RECORD
KOBE 01/16/95 2046, NISHI-AKASHI, 090 (CUE)
KOBE 01/16/95 2046, NISHI-AKASHI, 090 (CUE)
ACCELERATION TIME HISTORY IN UNITS OF G
4096 0.0100 NPTS, DT
0.233833E-06 0.299033E-06 0.515835E-06 0.667785E-06 0.490847E-06
Expand Down
Loading

0 comments on commit 3a91626

Please sign in to comment.