Commit a265e042 authored by Marius Kriegerowski's avatar Marius Kriegerowski Committed by Graeme Weatherill
Browse files

add pre-commit configuration, docs and gitlab-ci integration

parent 249d6358
Pipeline #23360 passed with stage
in 12 minutes and 28 seconds
......@@ -20,7 +20,7 @@ before_script:
formatting:
interruptible: true
script:
- make check
- pre-commit run --all-files
test:
interruptible: true
......
fail_fast: false
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
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black
args: [ --line-length=96 ]
- repo: https://github.com/pycqa/flake8
rev: 3.7.9
hooks:
- id: flake8
args: [--max-line-length=96]
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
args: [ --disable=E0611, -E, -j4 ]
types: [ python ]
SOURCES=shakyground2 tests *.py
LENGTH=96
check: $(SOURCES)
flake8 --max-line-length=$(LENGTH) $^
black --check --line-length $(LENGTH) $^
pylint -E $^
black: $(SOURCES)
black --line-length $(LENGTH) $^
......@@ -8,10 +8,10 @@ Install development and test dependencies with
pip3 install .[tests]
Before committing make check or correct your code style
Before committing make check or correct your code style. Style and consistency will be checked automatically using (pre-commit)[https://pre-commit.com/]. Install the required hooks as follows:
make check
pre-commit install
or
To manually trigger the installed hooks execute:
make black
pre-commit run --all-files
......@@ -2,7 +2,7 @@
from setuptools import setup, find_packages
test_requirements = ["pylint", "flake8", "black", "pytest"]
test_requirements = ["pylint", "pytest", "pre-commit"]
setup(
name="shakyground2",
......
This source diff could not be displayed because it is too large. You can view the blob instead.
{"Germany": [{"id": "Akkar2014LowStress", "model": "AkkarEtAlRhyp2014", "adjustment_factor": 0.75, "weight": 0.02331}, {"id": "Akkar2014AveStress", "model": "AkkarEtAlRhyp2014", "weight": 0.05994}, {"id": "Akkar2014HighStress", "model": "AkkarEtAlRhyp2014", "adjustment_factor": 1.25, "weight": 0.05994}, {"id": "Akkar2014VHighStress", "model": "AkkarEtAlRhyp2014", "adjustment_factor": 1.5, "weight": 0.02331}, {"id": "Bindi2014LowStress", "model": "BindiEtAl2014Rhyp", "adjustment_factor": 0.75, "weight": 0.02338}, {"id": "Bindi2014AveStress", "model": "BindiEtAl2014Rhyp", "weight": 0.06012}, {"id": "Bindi2014HighStress", "model": "BindiEtAl2014Rhyp", "adjustment_factor": 1.25, "weight": 0.06012}, {"id": "Bindi2014VHighStress", "model": "BindiEtAl2014Rhyp", "adjustment_factor": 1.5, "weight": 0.02338}, {"id": "Cauzzi2015LowStress", "model": "CauzziEtAl2014RhypoGermany", "adjustment_factor": 0.75, "weight": 0.02331}, {"id": "Cauzzi2015AveStress", "model": "CauzziEtAl2014RhypoGermany", "weight": 0.05994}, {"id": "Cauzzi2015HighStress", "model": "CauzziEtAl2014RhypoGermany", "adjustment_factor": 1.25, "weight": 0.05994}, {"id": "Cauzzi2015VHighStress", "model": "CauzziEtAl2014RhypoGermany", "adjustment_factor": 1.5, "weight": 0.02331}, {"id": "Derras2014LowStress", "model": "DerrasEtAl2014RhypoGermany", "adjustment_factor": 0.75, "weight": 0.035}, {"id": "Derras2014AveStress", "model": "DerrasEtAl2014RhypoGermany", "weight": 0.09}, {"id": "Derras2014HighStress", "model": "DerrasEtAl2014RhypoGermany", "adjustment_factor": 1.25, "weight": 0.09}, {"id": "Derras2014VHighStress", "model": "DerrasEtAl2014RhypoGermany", "adjustment_factor": 1.5, "weight": 0.035}, {"id": "Bindi2017LowStress", "model": "BindiEtAl2017Rhypo", "adjustment_factor": 0.75, "weight": 0.035}, {"id": "Bindi2017AveStress", "model": "BindiEtAl2017Rhypo", "weight": 0.09}, {"id": "Bindi2017HighStress", "model": "BindiEtAl2017Rhypo", "adjustment_factor": 1.25, "weight": 0.09}, {"id": "Bindi2017VHighStress", "model": "BindiEtAl2017Rhypo", "adjustment_factor": 1.5, "weight": 0.035}]}
\ No newline at end of file
{"Germany": [{"id": "Akkar2014LowStress", "model": "AkkarEtAlRhyp2014", "adjustment_factor": 0.75, "weight": 0.02331}, {"id": "Akkar2014AveStress", "model": "AkkarEtAlRhyp2014", "weight": 0.05994}, {"id": "Akkar2014HighStress", "model": "AkkarEtAlRhyp2014", "adjustment_factor": 1.25, "weight": 0.05994}, {"id": "Akkar2014VHighStress", "model": "AkkarEtAlRhyp2014", "adjustment_factor": 1.5, "weight": 0.02331}, {"id": "Bindi2014LowStress", "model": "BindiEtAl2014Rhyp", "adjustment_factor": 0.75, "weight": 0.02338}, {"id": "Bindi2014AveStress", "model": "BindiEtAl2014Rhyp", "weight": 0.06012}, {"id": "Bindi2014HighStress", "model": "BindiEtAl2014Rhyp", "adjustment_factor": 1.25, "weight": 0.06012}, {"id": "Bindi2014VHighStress", "model": "BindiEtAl2014Rhyp", "adjustment_factor": 1.5, "weight": 0.02338}, {"id": "Cauzzi2015LowStress", "model": "CauzziEtAl2014RhypoGermany", "adjustment_factor": 0.75, "weight": 0.02331}, {"id": "Cauzzi2015AveStress", "model": "CauzziEtAl2014RhypoGermany", "weight": 0.05994}, {"id": "Cauzzi2015HighStress", "model": "CauzziEtAl2014RhypoGermany", "adjustment_factor": 1.25, "weight": 0.05994}, {"id": "Cauzzi2015VHighStress", "model": "CauzziEtAl2014RhypoGermany", "adjustment_factor": 1.5, "weight": 0.02331}, {"id": "Derras2014LowStress", "model": "DerrasEtAl2014RhypoGermany", "adjustment_factor": 0.75, "weight": 0.035}, {"id": "Derras2014AveStress", "model": "DerrasEtAl2014RhypoGermany", "weight": 0.09}, {"id": "Derras2014HighStress", "model": "DerrasEtAl2014RhypoGermany", "adjustment_factor": 1.25, "weight": 0.09}, {"id": "Derras2014VHighStress", "model": "DerrasEtAl2014RhypoGermany", "adjustment_factor": 1.5, "weight": 0.035}, {"id": "Bindi2017LowStress", "model": "BindiEtAl2017Rhypo", "adjustment_factor": 0.75, "weight": 0.035}, {"id": "Bindi2017AveStress", "model": "BindiEtAl2017Rhypo", "weight": 0.09}, {"id": "Bindi2017HighStress", "model": "BindiEtAl2017Rhypo", "adjustment_factor": 1.25, "weight": 0.09}, {"id": "Bindi2017VHighStress", "model": "BindiEtAl2017Rhypo", "adjustment_factor": 1.5, "weight": 0.035}]}
{"GLOBAL STABLE": [{"id": "GlobalCratonLowStressLowSite", "model": "ESHM20Craton", "epsilon": -1.732051, "site_epsilon": -1.732051, "weight": 0.027889}, {"id": "GlobalCratonLowStressAveSite", "model": "ESHM20Craton", "epsilon": -1.732051, "weight": 0.111222}, {"id": "GlobalCratonLowStressHighSite", "model": "ESHM20Craton", "epsilon": -1.732051, "site_epsilon": 1.732051, "weight": 0.027889}, {"id": "GlobalCratonAveStressLowSite", "model": "ESHM20Craton", "site_epsilon": -1.732051, "weight": 0.111222}, {"id": "GlobalCratonAveStressAveSite", "model": "ESHM20Craton", "weight": 0.443556}, {"id": "GlobalCratonAveStressHighSite", "model": "ESHM20Craton", "site_epsilon": 1.732051, "weight": 0.111222}, {"id": "GlobalCratonHighStressLowSite", "model": "ESHM20Craton", "epsilon": 1.732051, "site_epsilon": -1.732051, "weight": 0.027889}, {"id": "GlobalCratonHighStressAveSite", "model": "ESHM20Craton", "epsilon": 1.732051, "weight": 0.111222}, {"id": "GlobalCratonHighStressHighSite", "model": "ESHM20Craton", "epsilon": 1.732051, "site_epsilon": 1.732051, "weight": 0.027889}]}
\ No newline at end of file
{"GLOBAL STABLE": [{"id": "GlobalCratonLowStressLowSite", "model": "ESHM20Craton", "epsilon": -1.732051, "site_epsilon": -1.732051, "weight": 0.027889}, {"id": "GlobalCratonLowStressAveSite", "model": "ESHM20Craton", "epsilon": -1.732051, "weight": 0.111222}, {"id": "GlobalCratonLowStressHighSite", "model": "ESHM20Craton", "epsilon": -1.732051, "site_epsilon": 1.732051, "weight": 0.027889}, {"id": "GlobalCratonAveStressLowSite", "model": "ESHM20Craton", "site_epsilon": -1.732051, "weight": 0.111222}, {"id": "GlobalCratonAveStressAveSite", "model": "ESHM20Craton", "weight": 0.443556}, {"id": "GlobalCratonAveStressHighSite", "model": "ESHM20Craton", "site_epsilon": 1.732051, "weight": 0.111222}, {"id": "GlobalCratonHighStressLowSite", "model": "ESHM20Craton", "epsilon": 1.732051, "site_epsilon": -1.732051, "weight": 0.027889}, {"id": "GlobalCratonHighStressAveSite", "model": "ESHM20Craton", "epsilon": 1.732051, "weight": 0.111222}, {"id": "GlobalCratonHighStressHighSite", "model": "ESHM20Craton", "epsilon": 1.732051, "site_epsilon": 1.732051, "weight": 0.027889}]}
{"GLOBAL VOLCANIC": [{"id": "Faccioli2010", "model": "FaccioliEtAl2010", "weight": 1.0}]}
\ No newline at end of file
{"GLOBAL VOLCANIC": [{"id": "Faccioli2010", "model": "FaccioliEtAl2010", "weight": 1.0}]}
{"Zone 1 Left": [{"id": "Bo14", "model": "BooreEtAl2014", "weight": 0.75}, {"id": "Bi14HighStress", "model": "BindiEtAl2014Rjb", "adjustment_factor": 1.25, "weight": 0.25}], "Zone 1 Right": [{"id": "C03", "model": "Campbell2003", "weight": 0.4}, {"id": "ESHM20CratonHighStress", "model": "ESHM20Craton", "epsilon": 1.0, "weight": 0.6}], "Zone 1 Deep": [{"id": "BCHydroSlabErgodic", "model": "AbrahamsonEtAl2015SSlab", "ergodic": false, "weight": 0.5}, {"id": "Zhao2016Slab", "model": "ZhaoEtAl2016SSlab", "weight": 0.5}]}
\ No newline at end of file
{"Zone 1 Left": [{"id": "Bo14", "model": "BooreEtAl2014", "weight": 0.75}, {"id": "Bi14HighStress", "model": "BindiEtAl2014Rjb", "adjustment_factor": 1.25, "weight": 0.25}], "Zone 1 Right": [{"id": "C03", "model": "Campbell2003", "weight": 0.4}, {"id": "ESHM20CratonHighStress", "model": "ESHM20Craton", "epsilon": 1.0, "weight": 0.6}], "Zone 1 Deep": [{"id": "BCHydroSlabErgodic", "model": "AbrahamsonEtAl2015SSlab", "ergodic": false, "weight": 0.5}, {"id": "Zhao2016Slab", "model": "ZhaoEtAl2016SSlab", "weight": 0.5}]}
{"Zone 2 Left": [{"id": "C15", "model": "CauzziEtAl2014", "weight": 0.75}, {"id": "B14LowStress", "model": "BindiEtAl2014Rjb", "adjustment_factor": 0.8, "weight": 0.25}], "Zone 2 Right": [{"id": "P11", "model": "PezeshkEtAl2011", "weight": 0.6}, {"id": "ESHM20CratonLowStress", "model": "ESHM20Craton", "epsilon": -1.0, "weight": 0.4}]}
\ No newline at end of file
{"Zone 2 Left": [{"id": "C15", "model": "CauzziEtAl2014", "weight": 0.75}, {"id": "B14LowStress", "model": "BindiEtAl2014Rjb", "adjustment_factor": 0.8, "weight": 0.25}], "Zone 2 Right": [{"id": "P11", "model": "PezeshkEtAl2011", "weight": 0.6}, {"id": "ESHM20CratonLowStress", "model": "ESHM20Craton", "epsilon": -1.0, "weight": 0.4}]}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment