-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
OUCyf
committed
Jul 18, 2023
1 parent
3958e55
commit b03546a
Showing
28 changed files
with
3,415 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[flake8] | ||
ignore = E203, E266, E501, W503, F403, F401, E402 | ||
max-line-length = 88 | ||
max-complexity = 60 | ||
select = B,C,E,F,W,T4,B9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: 2 | ||
updates: | ||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Publish to PyPI | ||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
pypi: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: ['3.9', '3.10', '3.11'] | ||
include: | ||
- os: ubuntu-latest | ||
cc: gcc | ||
cxx: g++ | ||
label: linux-64 | ||
- os: macos-latest | ||
cc: clang | ||
cxx: clang++ | ||
label: osx-64 | ||
- os: windows-latest | ||
cc: cl | ||
cxx: cl | ||
label: win-64 | ||
|
||
name: ${{ matrix.label }}-Python-${{ matrix.python-version }} | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Setup Poetry in Conda Environment | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: latest | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
|
||
- name: Cache Poetry Env | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: poetry-${{ runner.os }}-python${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install Poetry Dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction | ||
|
||
- name: Build and Publish | ||
run: | | ||
if [[ "${{ matrix.os }}" == "ubuntu-latest" && "${{ matrix.python-version }}" == "3.11" ]]; then | ||
poetry build | ||
elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then | ||
poetry build -f wheel | ||
elif [[ "${{ matrix.os }}" == "windows-latest" ]]; then | ||
poetry build -f wheel | ||
fi | ||
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN_SEISOPT }} | ||
poetry publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Publish to Test PyPI | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'test/**' | ||
|
||
jobs: | ||
testpypi: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: ['3.9', '3.10', '3.11'] | ||
include: | ||
- os: ubuntu-latest | ||
cc: gcc | ||
cxx: g++ | ||
label: linux-64 | ||
- os: macos-latest | ||
cc: clang | ||
cxx: clang++ | ||
label: osx-64 | ||
- os: windows-latest | ||
cc: cl | ||
cxx: cl | ||
label: win-64 | ||
|
||
name: ${{ matrix.label }}-Python-${{ matrix.python-version }} | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Setup Poetry in Conda Environment | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: latest | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
|
||
- name: Cache Poetry Env | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: poetry-${{ runner.os }}-python${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install Poetry Dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction | ||
|
||
- name: Build and Publish | ||
run: | | ||
if [[ "${{ matrix.os }}" == "ubuntu-latest" && "${{ matrix.python-version }}" == "3.11" ]]; then | ||
poetry build | ||
elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then | ||
poetry build -f wheel | ||
elif [[ "${{ matrix.os }}" == "windows-latest" ]]; then | ||
poetry build -f wheel | ||
fi | ||
poetry config repositories.test-pypi https://test.pypi.org/legacy/ | ||
poetry publish --repository test-pypi --username __token__ --password ${{ secrets.TEST_PYPI_TOKEN_SEISOPT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Sphinx | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
sphinx: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
- name: run doc | ||
run: | | ||
pip install poetry-core@https://github.com/python-poetry/poetry-core/archive/refs/tags/1.6.1.zip | ||
pip install numpy obspy scipy matplotlib | ||
pip install . --no-build-isolation | ||
pip install sphinx pydata-sphinx-theme sphinx-autoapi jupyter-sphinx sphinx-copybutton | ||
cd docs | ||
make html | ||
echo "yinfu.info" > _build/html/CNAME | ||
cd .. | ||
- name: push to github page | ||
if: ${{ !env.ACT }} | ||
uses: peaceiris/actions-gh-pages@v3.9.3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./docs/_build/html | ||
user_name: "github-actions[bot]" | ||
user_email: "github-actions[bot]@users.noreply.github.com" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: seisopt | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
code-coverage: | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up python | ||
id: setup-python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: latest | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
|
||
- name: Load Cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install Dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
|
||
- name: build and publish | ||
run: poetry build | ||
|
||
- name: Generate Coverage Report | ||
run: | | ||
pip install pytest | ||
pip install pytest-cov | ||
pytest --cov=./seisopt --cov-report=xml | ||
- name: Upload Coverage Reports to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN_SEISOPT }} | ||
env_vars: OS | ||
fail_ci_if_error: false | ||
verbose: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
# ShakeFlow | ||
.DS_Store | ||
.vscode/* | ||
setup.py | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.3.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- id: mixed-line-ending | ||
args: ['--fix=lf'] | ||
- repo: https://github.com/psf/black | ||
rev: 22.6.0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 3.8.3 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: | ||
- flake8-black | ||
- flake8-breakpoint | ||
- flake8-docstrings | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
name: isort (python) | ||
args: ["--profile", "black"] | ||
- id: isort | ||
name: isort (cython) | ||
types: [cython] | ||
- id: isort | ||
name: isort (pyi) | ||
types: [pyi] | ||
- repo: https://github.com/kynan/nbstripout | ||
rev: 0.6.1 | ||
hooks: | ||
- id: nbstripout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,12 @@ | ||
# seisopt | ||
Seismology optimize approaches | ||
|
||
[![Actions Status](https://github.com/shakeflow/seisopt/actions/workflows/workflow.yml/badge.svg)](https://github.com/shakeflow/seisopt/actions) | ||
[![coverage](https://codecov.io/gh/shakeflow/seisopt/branch/main/graph/badge.svg)](https://codecov.io/gh/shakeflow/seisopt) | ||
[![docs](https://img.shields.io/badge/docs-stable-blue.svg)](https://shakeflow.github.io/seisopt/) | ||
[![supported versions](https://img.shields.io/pypi/pyversions/seisopt.svg?label=python_versions)](https://pypi.python.org/pypi/seisopt) | ||
[![docs](https://badge.fury.io/py/seisopt.svg)](https://badge.fury.io/py/seisopt) | ||
|
||
|
||
Seismology optimize approaches. | ||
|
||
## License |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import numpy as np |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
coverage: | ||
status: | ||
project: off | ||
patch: off | ||
|
||
ignore: | ||
- "seisopt/tests/*" | ||
|
||
comment: true |
Oops, something went wrong.