Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/pip/jupyter-server-2.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
vot4anto authored Oct 16, 2024
2 parents 266efdb + 1efceec commit 4115f48
Show file tree
Hide file tree
Showing 468 changed files with 465,193 additions and 57,256 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/failure_workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Failure on Workflow

on:
workflow_run:
workflows:
- "Windows Test"
- "test and make pages"
types:
- completed

jobs:
on-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ github.event.workflow_run.conclusion }}
notification_title: " ${{github.event.workflow_run.name}} - ${{github.event.workflow_run.conclusion}} on ${{github.event.workflow_run.head_branch}} - <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View Failure>"
message_format: ":fire: *${{github.event.workflow_run.name}}* ${{github.event.workflow_run.conclusion}} in <${{github.server_url}}/${{github.repository}}/${{github.event.workflow_run.head_branch}}|${{github.repository}}>"
footer: "Linked Repo <${{github.server_url}}/${{github.repository}}|${{github.repository}}> | <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View Failure>"
env:
SLACK_WEBHOOK_URL: ${{ secrets.MONITORING_SLACK }}
44 changes: 26 additions & 18 deletions .github/workflows/test_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,45 @@ name: test and make pages

on:
push:
branches: [ master ]
branches: [ test ]
pull_request:
branches: [ master ]
schedule:
- cron: "0 2 * * *"
workflow_dispatch:

jobs:

test:
name: hazard test
runs-on: ubuntu-latest
env:
MPLBACKEND: 'Agg'

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
git clone --depth=1 https://github.com/gem/oq-engine.git
pip -q install -r oq-engine/requirements-py38-linux64.txt
pip -q install -e oq-engine
cd oq-engine
python3 install.py devel
cd ..
source ~/openquake/bin/activate
pip list
pip install -e .
pip install pytest
- name: Run test with pytest
run: |
source ~/openquake/bin/activate
oq engine --upgrade-db
oq --version
sleep 3
cd openquake
oq dbserver start
pytest -vsx cat ghm man mbt sub wkf smt
export MPLBACKEND=Agg
pytest -vsx --color=yes cat ghm man mbt sub wkf smt
pages:
name: pages
runs-on: ubuntu-latest
Expand All @@ -44,23 +49,26 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
python-version: "3.10"
- name: Install OpenQuake dependencies
run: |
sudo apt-get install pandoc
python -m pip install --upgrade pip
git clone --depth=1 https://github.com/gem/oq-engine.git
pip -q install -r oq-engine/requirements-py38-linux64.txt
pip -q install -e oq-engine
cd oq-engine
python3 install.py devel
sleep 3
source ~/openquake/bin/activate
pip install sphinx
pip install recommonmark
pip install sphinx_rtd_theme
pip install nbsphinx
- name: Make html pages
run: |
source ~/openquake/bin/activate
cd docsrc ; sphinx-apidoc -o contents/ ../openquake ; make html
touch _build/html/.nojekyll
Expand Down
81 changes: 57 additions & 24 deletions .github/workflows/test_win64.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,67 @@
name: Installation and test on Windows

---
name: Windows Test
on:
push:
branches:
- 'ae-310action'
- test
pull_request:
branches: [ master ]
schedule:
- cron: "0 4 * * *"
workflow_dispatch:
jobs:

test:
name: Windows Installation
runs-on: windows-latest

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022, windows-2019]
steps:
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- uses: actions/checkout@v3
- name: Run scripts to install on windows
run: |
Write-Host "Git branch for Run action "${Env:GIT_BRANCH}
#
$curDir = Get-Location
Write-Host "Current Working Directory: $curDir"
Get-ChildItem -Path .\windows –recurse
.\windows\install_oqmbtk.ps1
cd $env:USERPROFILE
cd mbtk
dir
cd oq-mbtk\openquake
pytest -vs cat ghm man mbt sub wkf smt
- uses: actions/checkout@v4
- name: Installation of GMT from standalone
run: |
Invoke-WebRequest -Uri "https://github.com/GenericMappingTools/gmt/releases/download/6.4.0/gmt-6.4.0-win64.exe" -OutFile $HOME\gmt.exe
cd $HOME
$Install = Get-ChildItem -Filter gmt*.exe
Start-Process -FilePath $Install.Fullname -ArgumentList "/S" -Wait
$Env:PATH += ";C:\programs\gmt6\bin"
Write-Host ${env:PATH}
- name: Run scripts to install on windows
run: |
Write-Host "Set LIBRARY PATH for GMT"
$Env:GMT_LIBRARY_PATH="C:\programs\gmt6\bin"
Write-Host "Git branch for Run action "${Env:GIT_BRANCH}
#
$curDir = Get-Location
Write-Host "Current Working Directory: $curDir"
Get-ChildItem -Path .\windows –recurse
Write-Host "Install oqmbtk on branch ${{ github.ref_name }}"
.\windows\install_oqmbtk.ps1 -mbtk_branch ${{ github.ref_name }}
$MYPATH = $HOME + "\mbtk"
Write-Host "Print USERPROFILE folder: $env:USERPROFILE"
Write-Host "Print MYPATH folder: $MYPATH"
$Env:PATH += ";$MYPATH"
$Env:PATH += ";$MYPATH\python3\Scripts"
$Env:PYTHONUTF8=1
#Added to disable TCL
$Env:MPLBACKEND="AGG"
$Env:PY_PIP=$MYPATH += '\Scripts'
$Env:PY_PIP=$MYPATH += '\python3\Scripts'
$Env:PY_HOME=$MYPATH
$Env:PY_LIBS="$MYPATH\python3\Lib;$MYPATH\python3\Lib\site-package"
Write-Host "MYPATH Directory: $MYPATH"
Start-Job -ScriptBlock{& 'oq.exe' engine --upgrade-db}
oq.exe --version
Write-Host "Print all environments variables to check"
dir env:
Write-Host "Print all pypip packages"
pip list
$MBTK = $HOME + "\mbtk"
Write-Host "MBTK Directory: $MBTK"
Set-Location -Path $MBTK
$curDir = Get-Location
Write-Host "Current Working Directory: $curDir"
cd oq-mbtk\openquake
Write-Host "Install pytest and run tests"
pip install pytest==8.1.2
pytest -vs --color=yes --durations=10 cat ghm man mbt sub wkf smt
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
_dev_notebooks/


# Byte-compiled / optimized / DLL files
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![test and make pages](https://github.com/GEMScienceTools/oq-mbtk/actions/workflows/test_deploy.yaml/badge.svg)](https://github.com/GEMScienceTools/oq-mbtk/actions/workflows/test_deploy.yaml)

# OpenQuake Model Building Toolkit
The OpenQuake Model Building Toolkit (OQ-MBTK) is a container for various packages each one with specific modelling or analyses capabilities. The project started with the `mbt` package which provides tools for the construction of components of a PSHA earthquake occurrence model.
The OpenQuake Model Building Toolkit (OQ-MBTK) is a container for various packages each one with specific modelling or analysis capabilities. The project started with the `mbt` package which provides tools for the construction of components of a PSHA earthquake occurrence model. The repo now contains a module for processing catalogues (`cat`), one supports workflows creating an earthquake occurrence model for the OQ Engine (`mbt` and `wkf`), one for the construction of the ground-motion characterisation (`smt`), one for the modelling of subduction sources and the classification of an earthquake catalogue by tectonic region (`sub`) and FERMI, a tool for the construction of occurrence models for fault systems (`fnm`).

Documentation accessible at [https://gemsciencetools.github.io/oq-mbtk/index.html](https://gemsciencetools.github.io/oq-mbtk/index.html)
34 changes: 0 additions & 34 deletions bin/sub_create_sections_from_slab.py

This file was deleted.

Loading

0 comments on commit 4115f48

Please sign in to comment.