Skip to content

Commit

Permalink
Merge branch 'docs' of https://github.com/xumi1993/seispy into docs
Browse files Browse the repository at this point in the history
  • Loading branch information
xumi1993 committed May 27, 2024
2 parents 7744171 + 581838c commit 8362a8b
Show file tree
Hide file tree
Showing 11 changed files with 143 additions and 97 deletions.
64 changes: 57 additions & 7 deletions .github/workflows/doc_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,36 @@ name: Seispy docs

on:
push:
branches: [ docs ]
branches: [ docs, dev ]
pull_request:
branches: [ master ]


# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
deploy:
runs-on: macos-latest
build_deploy:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Set branch name
id: vars
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo ::set-output name=branch::${{ github.event.pull_request.head.ref }}
else
echo ::set-output name=branch::dev
fi
echo ${{ steps.vars.outputs.branch }}
- name: Cancel Previous Runs
uses: styfle/[email protected]

- name: Checkout
uses: actions/checkout@v2.4.0
- name: Checkout to docs branch
uses: actions/checkout@v4
with:
ref: docs

Expand All @@ -35,16 +45,56 @@ jobs:
environment-file: environment.yml
# miniforge-variant: Mambaforge
# use-mamba: true


- name: Checkout to source branch
uses: actions/checkout@v4
with:
ref: ${{ steps.vars.outputs.branch }}
path: seispy_source
fetch-depth: 0

- name: Install Seispy
run: |
cd seispy_source
pip install .
cd ..
- name: Build documentation
run: |
make html
- name: Checkout the gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages
# Checkout to this folder instead of the current one
path: deploy
# Download the entire history
fetch-depth: 0

- name: Copy documentation
run: |
cd seispy_source
if [[ ${{ steps.vars.outputs.branch }} == "dev" ]]; then
version=“$(python setup.py --version)_$(git rev-parse --short HEAD)”
else
version=$(python setup.py --version)
fi
cd ../deploy
touch .nojekyll
echo -e "\nRemoving old files from previous builds of ${version}:"
rm -rvf dev_* ${version}
echo -e "\nCopying new files from ${version}:"
cp -rvf ../build/html ${version}
rm -rfv latest
ln -sfv ${version} latest
cd ..
- name: Deploy documentation
uses: peaceiris/actions-gh-pages@068dc23d9710f1ba62e86896f84735d869951305
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/html
publish_dir: deploy
# Only keep the latest commit to avoid bloating the repository
force_orphan: true
cname: seispy.xumijian.me
Expand Down
4 changes: 1 addition & 3 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ channels:
- conda-forge
- nodefaults
dependencies:
- python=3.10
- seispy
- pip
- sphinx
- sphinx-copybutton
- sphinx-design
- myst-nb
- pydata-sphinx-theme=0.8.1
- furo
- obspy
- numpydoc
- pip:
Expand Down
46 changes: 25 additions & 21 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,21 @@

import os
import sys
sys.path.insert(0, os.path.abspath('./seispy/seispy'))
from importlib.metadata import version as get_version
# sys.path.insert(0, os.path.abspath('./seispy/seispy'))
# sys.path.insert(0, os.path.abspath('/Users/xumj/Codes/seispy/seispy'))


# -- Project information -----------------------------------------------------

project = 'seispy'
project = 'Seispy'
copyright = '2020, Mijian Xu'
author = 'Mijian Xu'

# The short X.Y version
version = ''
version = f"v{get_version('python-seispy')}"
# The full version, including alpha/beta/rc tags
release = 'latest'
release = version


# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -90,7 +91,7 @@
exclude_patterns = []

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# pygments_style = 'sphinx'

myst_heading_anchors = 3

Expand All @@ -101,16 +102,14 @@
#

html_baseurl = "seispy.xumijian.me"
# html_theme = 'classic'
html_theme = 'pydata_sphinx_theme'
html_theme = 'furo'
# html_theme = 'pydata_sphinx_theme'
# html_theme_path = [lsst_dd_rtd_theme.get_html_theme_path()]

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
Expand All @@ -126,19 +125,24 @@
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
html_theme_options = {
"icon_links": [
{
# Label for this link
"name": "GitHub",
# URL where the link will redirect
"url": "https://github.com/xumi1993/seispy", # required
# Icon class (if "type": "fontawesome"), or path to local image (if "type": "local")
"icon": "fab fa-github-square",
# Whether icon should be a FontAwesome class, or a local file
# "type": "fontawesome OR local", # Default is fontawesome
}
]
# "icon_links": [
# {
# # Label for this link
# "name": "GitHub",
# # URL where the link will redirect
# "url": "https://github.com/xumi1993/seispy", # required
# # Icon class (if "type": "fontawesome"), or path to local image (if "type": "local")
# "icon": "fab fa-github-square",
# # Whether icon should be a FontAwesome class, or a local file
# # "type": "fontawesome OR local", # Default is fontawesome
# }
# ],
"light_css_variables": {
"color-brand-primary": "#0080C4",
"color-brand-content": "#0080C4",
},
}

#
# html_sidebars = {}
html_favicon = os.path.abspath(os.path.join('.', '_static', 'seispy_100.png'))
Expand Down
2 changes: 1 addition & 1 deletion source/examples/ex-harmo.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Background
Harmonic decomposition is an effective technique to separate anisotropic and dipping components from radius and transverse RFs ([Bianchi et al., 2010](https://doi.org/10.1029/2009JB007061])). This technique not only used to estimate azimuthal crustal anisotropy and crustal layer dipping , but used to extract isotropic component of RF for 1D RF inversion. In the Seispy, the command `rfharmo` is accessible for computing the harmonic decomposition, plotting different components after the decomposition, and save the isotropic component to a local SAC file.

```Code
```
usage: Harmonic decomposition for extracting anisotropic and isotropic features from the radial and transverse RFs [-h] [-t tb/te] [-s dt] [-o outpath] [-e enf] [-p figure_path] rfpath
positional arguments:
Expand Down
18 changes: 0 additions & 18 deletions source/hk.rst

This file was deleted.

28 changes: 20 additions & 8 deletions source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@

# Seispy Documentation

[![License](https://img.shields.io/github/license/xumi1993/seispy)]()
[![](https://img.shields.io/github/last-commit/xumi1993/seispy)]()
[![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/xumi1993/seispy)]()
[![GitHub repo size](https://img.shields.io/github/repo-size/xumi1993/seispy)]()
[![DOI](https://zenodo.org/badge/41006349.svg)](https://zenodo.org/badge/latestdoi/41006349)
![License](https://img.shields.io/github/license/xumi1993/seispy)
![Last commit](https://img.shields.io/github/last-commit/xumi1993/seispy)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/xumi1993/seispy)
![GitHub repo size](https://img.shields.io/github/repo-size/xumi1993/seispy)

[![CRV test](https://github.com/xumi1993/seispy/actions/workflows/test.yml/badge.svg?branch=dev)](https://github.com/xumi1993/seispy/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/xumi1993/seispy/branch/dev/graph/badge.svg?token=XN3E3N6S3V)](https://codecov.io/gh/xumi1993/seispy)
Expand All @@ -26,8 +25,11 @@
[![PyPI](https://img.shields.io/pypi/v/python-seispy)](https://pypi.org/project/python-seispy/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/python-seispy)](https://pypi.org/project/python-seispy/)

[![GitHub stars](https://img.shields.io/github/stars/xumi1993/seispy?style=social)]()
[![](https://img.shields.io/github/forks/xumi1993/seispy?style=social)]()
[![Static Badge](https://img.shields.io/badge/DOI-10.1785%2F0220220288-pink)](https://doi.org/10.1785/0220220288)

[![GitHub stars](https://img.shields.io/github/stars/xumi1993/seispy?style=social)](https://github.com/xumi1993/seispy)
[![](https://img.shields.io/github/forks/xumi1993/seispy?style=social)](https://github.com/xumi1993/seispy)


Seispy is a graphical interface Python module for receiver function (RF) calculation and post-processing in seismological research. Automated workflows of RF calculations facilitate processing large volumes of different types of seismic data. The graphic user interface enables an intuitive and straightforward evaluation of RF quality control. Seispy contains the basic RF-based methods. Five main modules for the post-processing of RF are H-k stacking, crustal anisotropic estimation, harmonic decomposition, 2D and 3D common conversion point (CCP) stacking. The CCP staking in the different application scenarios can be handled by rich modules, such as time-to-depth conversion, 2D or 3D CCP stacking, and adaptive station or bin selection for CCP stacking profiles in a dense seismic array or a linear seismic array. As a Python module, functions in the Seispy can be called easily in python scripts for other purposes. The modular design allows new functionality to be added in a collaborative development environment. Seispy licensed under GPLv3 can be open accessed on [Github repository](https://github.com/xumi1993/seispy).

Expand Down Expand Up @@ -56,7 +58,8 @@ Further details are available in the [Installation Guide](installation).
Users using Seispy in their research please cite our peer-reviewed journal article in manuscripts

```{admonition} Reference
Mijian Xu, Jing He; Seispy: Python Module for Batch Calculation and Postprocessing of Receiver Functions. *Seismological Research Letters* 2022; doi: [https://doi.org/10.1785/0220220288](https://doi.org/10.1785/0220220288)
Mijian Xu, Jing He; Seispy: Python Module for Batch Calculation and Postprocessing of Receiver Functions. *Seismological Research Letters* 2022; [![Static Badge](https://img.shields.io/badge/DOI-10.1785%2F0220220288-pink)](https://doi.org/10.1785/0220220288)
```


Expand Down Expand Up @@ -115,6 +118,15 @@ notes/index
modules
:::

```{toctree}
:caption: Project Links
:hidden:
GitHub <https://github.com/xumi1993/seispy>
GitLab <https://gitlab.com/xumi1993/seispy>
Anaconda <https://anaconda.org/conda-forge/seispy>
PyPI <https://pypi.org/project/python-seispy/>
```

## References

Expand Down
4 changes: 1 addition & 3 deletions source/modules.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
Module Index
======
============

.. toctree::
:maxdepth: 2

rf
post
ccp
.. gui
.. seispy
8 changes: 8 additions & 0 deletions source/post.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Post-processing package
====================

seispy.core.depmodel module
---------------------------

.. automodule:: seispy.core.depmodel
:members:
:undoc-members:
:show-inheritance:

seispy.hk module
----------------

Expand Down
2 changes: 1 addition & 1 deletion source/usage/ccp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ The output structure would be saved as a ``.npy`` file, which can be read with `

.. note::

The layer_num was determined by field ``[depth]`` in parameter file.
The ``layer_num`` was determined by field ``[depth]`` in parameter file.

CCP Stack PRFs along a profile
================================
Expand Down
2 changes: 2 additions & 0 deletions source/usage/pickrf.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ When you have selected all PRFs, please click `finish` button to delete all 'poo
- Magnitude
- Gaussian factor

```{note}
This list file is **very important** for derived method such as H-k stacking and CCP stacking.
```

## Other functions

Expand Down
62 changes: 27 additions & 35 deletions source/usage/ps-depth.ipynb

Large diffs are not rendered by default.

0 comments on commit 8362a8b

Please sign in to comment.