Skip to content

Commit

Permalink
Merge pull request #104 from hvasbath/ampspecs2
Browse files Browse the repository at this point in the history
dev 1.2. rc1
  • Loading branch information
hvasbath authored Aug 21, 2022
2 parents ddd8f93 + 7d5dc4f commit 76e6314
Show file tree
Hide file tree
Showing 128 changed files with 19,019 additions and 16,162 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/build-wheels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build

on: [push, pull_request]

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macOS-11]
# Exclude windows-2019

steps:
- uses: actions/checkout@v3


- name: Build wheels
uses: pypa/[email protected]
# to supply options, put them in 'env', like:
env:
CIBW_ARCHS_MACOS: x86_64 universal2
CIBW_SKIP: "{pp*,*musllinux*}"

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
name: Upload PyPI
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'v'
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
# alternatively, to publish when a GitHub Release is created, use the following rule:
# if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v3
with:
# unpacks default artifact into dist/
# if `name: artifact` is omitted, the action will create extra parent dir
name: artifact
path: dist

- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
# To test: repository_url: https://test.pypi.org/legacy/
16 changes: 16 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Lint

on:
pull_request:
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: 3.8
- uses: pre-commit/[email protected]
35 changes: 31 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
src/info.py

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand All @@ -22,6 +20,9 @@ parts/
sdist/
var/
wheels/
wheelhouse/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
Expand All @@ -40,6 +41,7 @@ pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
Expand All @@ -57,6 +59,7 @@ coverage.xml
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
Expand All @@ -74,9 +77,20 @@ target/
# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# celery beat schedule file
celerybeat-schedule

Expand Down Expand Up @@ -104,6 +118,19 @@ venv.bak/

# mypy
.mypy_cache/

# Pycharm workspace
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# Custom
*.sublime-*
gh-pages
*swp
test/
beat.git/
.idea
.vscode
beat/info.py
*log.txt
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-added-large-files
- id: check-yaml
args: [--unsafe]
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/codespell-project/codespell
rev: v2.2.1
hooks:
- id: codespell
args: [--write-changes, "-L ure,nd,ue,parms,Ue,statics,indexs"]
- repo: https://github.com/psf/black
rev: 22.6.0
hooks:
- id: black
3 changes: 2 additions & 1 deletion AUTHORS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# The BEAT developers

This following list includes contributors who have directly touched code or documentation of BEAT.
This following list includes contributors who have directly touched code or documentation of BEAT.
It is not a complete list, in the sense that many others have influenced the development of BEAT through discussion, bug reports and more.

* Hannes Vasyura-Bathke
* Mahdi Hamidbeygi
* Andreas Steinberg
* Thiago Junqueira
* So-Young Baag
Expand Down
38 changes: 33 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,34 @@ All notable changes to BEAT will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).


## [1.2.0] 21 August 2022
Contributors: Mahdi Hamidbeygi @mahdihamidbeygi, Hannes Vasyura-Bathke @hvasbath

### Added
**Polarity**
- polarity module/composite/dataset-type for inference of wave onset polarities
- joint inference of P, Sh and Sv wave-polarities
- drawing of piercing points on fuzzyBB plot if polarity data exists
- drawing of fuzzyBBs for Sh and Sv waves
- add tutorial Example 8 for polarity inference

**Amplitude Spectra**
- added string-choice `domain` to WaveMaps to choose `time` or `frequency` domain for inference
- plotting: added spectra fits in waveform fits plot

**Continuous Integration (CI)**
- adapted installation scheme to fulfill PEP517 through pip and .toml
- providing beat binary packages on PyPi
- github actions workflow for code formatting and wheel building
- pre-commit and hooks for yaml, spellchecking, tailing whitespaces and eof

### Changed
- split plotting module into plotting directory with submodules
- plotting: stage_posteriors change hist color to grey if only single density is shown
- plotting: fuzzyBB dashed white and black line instead of red for MAP
- docs: updated (short) installation instructions to use the package manager pip instead of setup.py

## [1.1.1] 6th January 2022

### Added
Expand All @@ -17,7 +45,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
**Plotting**
- 3d_slip_distribution: allows plotting of selected segments, slip-deficit, coupling, slip_variation
- gnss_fits: added Variance Reduction histograms if nensemble > 1
- slip_distribution: common colorscale and spatial scale accross subfaults
- slip_distribution: common colorscale and spatial scale across subfaults
- moment_rate: adjusted size and formatting to be publication ready
- correlation_hist: plot source related correlations for nsources > 1, colorcoding

Expand All @@ -33,7 +61,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### General

Documentation moved to https://pyrocko.org/beat and is made version dependend.
Documentation moved to https://pyrocko.org/beat and is made version dependent.
E.g. https://pyrocko.org/beat/v1.0 to view older documentation versions.

### Added
Expand Down Expand Up @@ -72,7 +100,7 @@ E.g. https://pyrocko.org/beat/v1.0 to view older documentation versions.

**Plotting**
- slip_distribution allows for variable patch-size
- plot gnss_fits for horizontal and vertical GNSS components
- plot gnss_fits for horizontal and vertical GNSS components
- waveform misfits:
+ with plot_projection =individual allows to get individual source contributions for geometry mode
+ added time-shift histograms if these were sampled
Expand All @@ -94,7 +122,7 @@ E.g. https://pyrocko.org/beat/v1.0 to view older documentation versions.
- moved beat command level export to dataset composites export method
- MTQTSource input argument u removed in favor of w
- filterer attribute of Wavemap is now list of filters, allows chaining of filters
- beat import mode now cleanly referrs to the current project directory not anymore to the results directory to be imported from
- beat import mode now cleanly refers to the current project directory not anymore to the results directory to be imported from
- beat import got additional --import_from_mode to choose the mode of the results to import from (was previously mode)

## [v.1.0.0] 18.06.2019
Expand All @@ -104,7 +132,7 @@ Initial release:
- estimate non-linear parameters of elastic deformation sources
- finite fault inversion with distributed slip on uniformly discretized planar faults
- in layered/homogeneous elastic media
- supported datatypes:
- supported datatypes:
+ geodetic (InSAR, GNSS)
+ seismic (seismic waveforms)
- Bayesian Inference with hierarchical residual estimation
Expand Down
62 changes: 27 additions & 35 deletions README.rst → README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
.. image:: docs/_static/LOGO_BEAT.png?raw=true
:align: center
:alt: BEAT logo

Bayesian Earthquake Analysis Tool
---------------------------------
![BEAT logo](https://pyrocko.org/beat/docs/current/_images/LOGO_BEAT.png)

# Bayesian Earthquake Analysis Tool

If you came looking for the beat package calculating internet time you can find it [here](https://github.com/tonyskapunk/beat).

Based on pyrocko, theano and pymc3

6 January 2022
A new version 1.1.1 is released vastly improving resolution based fault discretization. Minor changes.
Checkout the `changelog <https://github.com/hvasbath/beat/blob/master/CHANGELOG.md>`__ for all the details.
New `tutorial <https://pyrocko.org/beat/docs/current/examples/FFI_static_resolution.html>`_ on resolution based discretization of the fault surface.
Checkout the [changelog](https://github.com/hvasbath/beat/blob/master/CHANGELOG.md) for all the details.
New [tutorial](https://pyrocko.org/beat/docs/current/examples/FFI_static_resolution.html) on resolution based discretization of the fault surface.

12 April 2021
A new version 1.1.0 is released adding support for multi-segmented fault setups and tensile dislocations.
Checkout the `changelog <https://github.com/hvasbath/beat/blob/master/CHANGELOG.md>`__ for all the details.
Checkout the [changelog](https://github.com/hvasbath/beat/blob/master/CHANGELOG.md) for all the details.

Documentation of the current version moved to the pyrocko server can be found here:
https://pyrocko.org/beat/

New `tutorial <https://pyrocko.org/beat/docs/current/examples/Rectangular_tensile.html>`_ on tensile dislocation modeling.
New [tutorial](https://pyrocko.org/beat/docs/current/examples/Rectangular_tensile.html) on tensile dislocation modeling.

**HELP wanted!**
**HELP wanted!**

The new release contains a lot of undocumented features a list of these can be found here:
https://github.com/hvasbath/beat/issues/69
Expand All @@ -33,8 +33,7 @@ you in writing parts of the documentation for a particular feature-if you want t

The legacy documentation of beat v1.0. can be found under: https://hvasbath.github.io/beat/

License
=======
## License
GNU General Public License, Version 3, 29 June 2007

Copyright © 2017 Hannes Vasyura-Bathke
Expand All @@ -44,38 +43,33 @@ BEAT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.


Citation
========
## Citation
If your work results in an publication where you used BEAT we kindly ask you to consider citing the BEAT software package and the related article.:

> Vasyura-Bathke, Hannes; Dettmer, Jan; Steinberg, Andreas; Heimann, Sebastian; Isken, Marius; Zielke, Olaf; Mai, Paul Martin; Sudhaus, Henriette; Jónsson, Sigurjón: The Bayesian Earthquake Analysis Tool. Seismological Research Letters. https://doi.org/10.1785/0220190075
> Vasyura-Bathke, Hannes; Dettmer, Jan; Steinberg, Andreas; Heimann, Sebastian; Isken, Marius; Zielke, Olaf; Mai, Paul Martin; Sudhaus, Henriette; Jónsson, Sigurjón (2019): BEAT - Bayesian Earthquake Analysis Tool. V. 1.0. GFZ Data Services. http://doi.org/10.5880/fidgeo.2019.024

Tutorials
=========
## Tutorials
Step by step points on how to use the tool for several scenarios can be found here:
`Examples <https://hvasbath.github.io/beat/examples/index.html>`__
[Examples](https://hvasbath.github.io/beat/examples/index.html)

Data import
===========
Geodetic
^^^^^^^^
## Data import
### Geodetic
We recommend to prepare the SAR data (subsampling, data covariance estimation) using KITE (www.pyrocko.org).
kite supports import of ISCE, GAMMA, ROI_Pac and GMTSAR processed interferograms. BEAT then supports import of the native KITE format.

Seismic
^^^^^^^
To see a list of the supported data types please see: `Trace Handeling <https://pyrocko.org/docs/current/library/examples/trace_handling.html>`__
### Seismic
To see a list of the supported data types please see: [Trace Handling](https://pyrocko.org/docs/current/library/examples/trace_handling.html)
In addition to these an ascii text file with the station information is needed of the format::

#network_name.station_name.location_name latitude[deg] longitude[deg] elevation[m] depth[m]
IU.TSUM.10 -19.20220 17.58380 1260.0 0.0
IU.TSUM.10 -19.20220 17.58380 1260.0 0.0
BHE 90 0 1 # channel name azimuth[deg] dip[deg] gain \n
BHN 0 0 1
BHZ 0 -90 1
IU.RCBR.00 -5.82740 -35.90140 291.0 109.0
IU.RCBR.00 -5.82740 -35.90140 291.0 109.0
BH1 48 0 1
BH2 138 0 1
BHZ 0 -90 1
Expand All @@ -92,14 +86,13 @@ containing a list of 2 lists:
1. list of "pyrocko.trace.Trace" objects alternating for (Z / T / R) rotated traces.
2. list of "pyrocko.model.Station" objects in the same order like the data traces.

We invite the users to propose data formats or outputs of specific programs that they would
like to see implemented.
We invite the users to propose data formats or outputs of specific programs that they would
like to see implemented.

Support
=======
## Support
For substantial issues please use and check the "issues" tab here in the repository.
For common issues please check out the BEAT FAQ `here <https://hvasbath.github.io/beat/faq.html>`__ .
For smaller issues or short clarifications there is a support chat `here <https://hive.pyrocko.org/pyrocko-support/channels/beat>`__ . This is provided by the pyrocko project and is accessible after a short account creation.
For common issues please check out the BEAT [FAQ](https://hvasbath.github.io/beat/faq.html).
For smaller issues or short clarifications there is a support [chat](https://hive.pyrocko.org/pyrocko-support/channels/beat). This is provided by the pyrocko project and is accessible after a short account creation.

Finally, there is the option to write an email to:

Expand All @@ -109,6 +102,5 @@ [email protected]
Andreas Steinberg
[email protected]

Contributions
=============
## Contributions
This is an open source project and contributions to the repository are welcome!
3 changes: 2 additions & 1 deletion beat/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from .info import * # noqa
__version__ = version # noqa

__version__ = version # noqa
Loading

0 comments on commit 76e6314

Please sign in to comment.