Skip to content

Commit 8c49f6c

Browse files
authored
Merge pull request #730 from MiraGeoscience/release/0.12.0-dev.1
[GEOPY-2095] Release/0.12.0
2 parents d39dd3d + aeafcc1 commit 8c49f6c

File tree

314 files changed

+18191
-61024
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

314 files changed

+18191
-61024
lines changed

.flake8

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
[flake8]
2-
ignore = E203, E266, E501, W503
2+
ignore =
3+
E203,
4+
E266,
5+
E501,
6+
W503,
7+
# TODO: reduce complexity and restore this rule (Function is too complex)
8+
C901,
9+
10+
311
max-line-length = 80
412
max-complexity = 16
513
select = B,C,E,F,W,T4,B9
14+
per-file-ignores =
15+
geoapps/clustering/driver.py: E402

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
*.pt filter=lfs diff=lfs merge=lfs -text
12
*.geoh5 filter=lfs diff=lfs merge=lfs -text
3+
*.h5 filter=lfs diff=lfs merge=lfs -text
4+
*.min.js filter=lfs diff=lfs merge=lfs -text
25
*.ipynb filter=lfs diff=lfs merge=lfs -text

.github/workflows/issue_to_jira.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
# Additional fields in JSON format
2929
fields: '{"components": [{"name": "geoapps"}]}'
3030
- name: Post JIRA link
31-
uses: peter-evans/create-or-update-comment@v3
31+
uses: peter-evans/create-or-update-comment@v4
3232
with:
3333
# The number of the issue or pull request in which to create a comment.
3434
issue-number: ${{ github.event.issue.number }}

.github/workflows/pr_add_jira_summary.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@ jobs:
1919
PR_TITLE: ${{ github.event.pull_request.title }}
2020
run: >
2121
echo $HEAD_REF $PR_TITLE
22-
| echo "issue_key=$(grep -os "\b\(GA\|GEOPY\)-[0-9]\+" | head -n1)" >> $GITHUB_OUTPUT
22+
| echo "issue_key=$(
23+
grep -osi "\b\(GA\|GEOPY\|DEVOPS\)[ #-]*[0-9]\+"
24+
| head -n1
25+
| sed -E "s/([A-Z]+)[-# ]*([0-9]+)/\1-\2/i"
26+
| tr [:lower:] [:upper:]
27+
)"
28+
>> $GITHUB_OUTPUT
2329
- name: Get JIRA summary
2430
id: get_jira_summary
2531
if: ${{ steps.find_jira_key.outputs.issue_key }}
@@ -31,18 +37,26 @@ jobs:
3137
-H "Authorization: Basic $JIRA_BASIC_AUTH"
3238
-H "Content-Type: application/json"
3339
"$JIRA_BASE_URL/rest/api/2/issue/${{ steps.find_jira_key.outputs.issue_key }}"
34-
| echo "summary=$(jq -r '.fields.summary')" >> $GITHUB_OUTPUT
40+
| echo "summary=$(jq -r '.fields.summary // empty')" >> $GITHUB_OUTPUT
41+
- name: Extract PR title
42+
id: get_pr_title
43+
env:
44+
PR_TITLE: ${{ github.event.pull_request.title }}
45+
run: |
46+
echo "text=$(echo $PR_TITLE | sed -E "s/^\s*[?[A-Z]+[-# ]*[0-9]+]?[-: ]*(.*)/\1/i")" >> $GITHUB_OUTPUT
3547
- name: Add comment
3648
if: ${{ steps.find_jira_key.outputs.issue_key }}
3749
env:
3850
ISSUE_SUMMARY: ${{ steps.get_jira_summary.outputs.summary }}
51+
TITLE_TEXT: ${{ steps.get_pr_title.outputs.text }}
3952
PR_BODY: ${{ github.event.pull_request.body }}
4053
run: >
4154
jq
4255
--arg ISSUE_ID "${{ steps.find_jira_key.outputs.issue_key }}"
4356
--arg ISSUE_SUMMARY "$(cat <<< $ISSUE_SUMMARY)"
57+
--arg TITLE_TEXT "$(cat <<< ${TITLE_TEXT:-$ISSUE_SUMMARY})"
4458
--arg PR_BODY "$(cat <<< $PR_BODY)"
45-
-c '."body"="**" + $ISSUE_ID + " - " + $ISSUE_SUMMARY + "**\n" + $PR_BODY' <<< {}
59+
-c '{"title": ($ISSUE_ID + ": " + $TITLE_TEXT), "body": ("**" + $ISSUE_ID + " - " + $ISSUE_SUMMARY + "**\n" + $PR_BODY)}' <<< {}
4660
| curl -sS -X POST -d @-
4761
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}"
4862
-H "Content-Type: application/json"

.github/workflows/pytest-unix-os.yaml renamed to .github/workflows/pytest-unix-os.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: pytest on Unix OS
22

33
on:
44
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
56
branches:
67
- develop
78
- main
@@ -20,25 +21,24 @@ concurrency:
2021
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
2122
cancel-in-progress: true
2223

23-
env:
24-
source_dir: geoapps
25-
2624
jobs:
2725
pytest:
2826
name: pytest (Unix)
27+
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
2928
strategy:
3029
fail-fast: false
3130
matrix:
32-
python_ver: ['3.9', '3.10']
31+
python_ver: ['3.10']
3332
os: [ubuntu-latest]
3433
runs-on: ${{ matrix.os }}
3534
defaults:
3635
run:
3736
shell: bash -l {0}
3837
env:
3938
PYTHONUTF8: 1
40-
CONDA_LOCK_ENV_FILE: environments/conda-py-${{ matrix.python_ver }}-${{ startsWith(matrix.os, 'macos') && 'osx' || 'linux' }}-64-dev.lock.yml
41-
PIP_EXTRA_INDEX_URL: https://test.pypi.org/simple/
39+
CONDA_CHANNEL_PRIORITY: strict
40+
PIP_NO_DEPS: 1 # all dependencies are installed from conda
41+
CONDA_LOCK_ENV_FILE: environments/py-${{ matrix.python_ver }}-${{ startsWith(matrix.os, 'macos') && 'osx' || 'linux' }}-64-dev.conda.lock.yml
4242
steps:
4343
- uses: actions/checkout@v4
4444
with:
@@ -50,5 +50,4 @@ jobs:
5050
environment-name: test_env
5151
cache-downloads: true
5252
- name: pytest
53-
run: |
54-
pytest --cov=${source_dir} --cov-report=xml --cov-branch
53+
run: pytest --cov --cov-report=xml

.github/workflows/pytest-windows.yaml renamed to .github/workflows/pytest-windows.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: pytest on Windows
22

33
on:
44
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
56
branches:
67
- develop
78
- main
@@ -20,24 +21,23 @@ concurrency:
2021
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
2122
cancel-in-progress: true
2223

23-
env:
24-
source_dir: geoapps
25-
2624
jobs:
2725
pytest:
2826
name: pytest (Windows)
27+
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
2928
strategy:
3029
fail-fast: false
3130
matrix:
32-
python_ver: ['3.9', '3.10']
31+
python_ver: ['3.10']
3332
defaults:
3433
run:
3534
shell: powershell
3635
runs-on: windows-latest
3736
env:
3837
PYTHONUTF8: 1
39-
CONDA_LOCK_ENV_FILE: environments/conda-py-${{ matrix.python_ver }}-win-64-dev.lock.yml
40-
PIP_EXTRA_INDEX_URL: https://test.pypi.org/simple/
38+
CONDA_CHANNEL_PRIORITY: strict
39+
PIP_NO_DEPS: 1 # all dependencies are installed from conda
40+
CONDA_LOCK_ENV_FILE: environments/py-${{ matrix.python_ver }}-win-64-dev.conda.lock.yml
4141
steps:
4242
- uses: actions/checkout@v4
4343
with:
@@ -50,10 +50,11 @@ jobs:
5050
init-shell: powershell
5151
cache-downloads: true
5252
- name: pytest
53-
run: |
54-
pytest --cov=${source_dir} --cov-report=xml --cov-branch
53+
run: pytest --cov --cov-report=xml
5554
- name: Codecov
56-
if: ${{ success() && matrix.python_ver == '3.9' }}
57-
uses: codecov/codecov-action@v3
55+
if: ${{ success() && matrix.python_ver == '3.10' }}
56+
uses: codecov/codecov-action@v4
5857
with:
5958
name: GitHub
59+
fail_ci_if_error: true
60+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/static-analysis.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: static analysis
22

33
on:
44
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
56
branches:
67
- develop
78
- main
@@ -26,14 +27,16 @@ env:
2627
jobs:
2728
pylint:
2829
name: pylint
30+
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
2931
runs-on: ubuntu-latest
3032
defaults:
3133
run:
3234
shell: bash -l {0}
3335
env:
3436
PYTHONUTF8: 1
35-
CONDA_LOCK_ENV_FILE: environments/conda-py-3.9-linux-64-dev.lock.yml
36-
PIP_EXTRA_INDEX_URL: https://test.pypi.org/simple/
37+
CONDA_CHANNEL_PRIORITY: strict
38+
PIP_NO_DEPS: 1 # all dependencies are installed from conda
39+
CONDA_LOCK_ENV_FILE: environments/py-3.10-linux-64-dev.conda.lock.yml
3740
steps:
3841
- uses: actions/checkout@v4
3942
- name: Setup conda env

.idea/copyright/Mira_Geoscience___MIT.xml

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/copyright/profiles_settings.xml

Lines changed: 17 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/scopes/mira_sources.xml

Lines changed: 0 additions & 3 deletions
This file was deleted.

.idea/scopes/sources.xml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.pre-commit-config.yaml

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
default_language_version:
33
python: python3
4-
exclude: (^docs/(conf.py|_ext/)|^geoapps/simpeg(PF|EM1D)/|^geoapps-assets/)
5-
default_stages: [commit,push]
4+
exclude: (^docs/(conf.py|_ext/))
5+
default_stages: [pre-commit,pre-push]
66
fail_fast: false
77

88
ci:
@@ -11,42 +11,46 @@ ci:
1111
autoupdate_schedule: monthly
1212

1313
repos:
14-
- repo: https://github.com/psf/black
15-
rev: 23.10.0
14+
- repo: https://github.com/hadialqattan/pycln
15+
rev: v2.5.0
1616
hooks:
17-
- id: black
18-
- repo: https://github.com/PyCQA/isort
19-
rev: 5.12.0
17+
- id: pycln
18+
args: [--config=pyproject.toml]
19+
- repo: https://github.com/astral-sh/ruff-pre-commit
20+
rev: v0.9.1
2021
hooks:
21-
- id: isort
22-
additional_dependencies: [tomli] # to read config from pyproject.toml
23-
- repo: https://github.com/humitos/mirrors-autoflake
24-
rev: v1.1
25-
hooks:
26-
- id: autoflake
27-
#- repo: https://github.com/PyCQA/flake8
28-
# rev: 6.1.0
29-
# hooks:
30-
# - id: flake8
31-
- repo: https://github.com/asottile/pyupgrade
32-
rev: v3.15.0
33-
hooks:
34-
- id: pyupgrade
35-
args: [--py39-plus]
36-
#- repo: https://github.com/pre-commit/mirrors-mypy
37-
# rev: v1.6.1
22+
- id: ruff
23+
args:
24+
- --fix
25+
- --exit-non-zero-on-fix
26+
# - --unsafe-fixes
27+
exclude_types: [jupyter]
28+
- id: ruff-format
29+
exclude_types: [jupyter]
30+
#- repo: https://github.com/pre-commit/mirrors-mypy # TODO: fix mypy errors
31+
# rev: v1.10.0
3832
# hooks:
3933
# - id: mypy
4034
# additional_dependencies: [
35+
# numpy==1.26.*,
4136
# types-toml,
4237
# types-PyYAML,
43-
# tomli # to read config from pyproject.toml
38+
# tomli # to read config from pyproject.toml
4439
# ]
40+
# exclude: ^(docs|geoapps-assets)/
4541
- repo: https://github.com/codingjoe/relint
46-
rev: 3.1.0
42+
rev: 3.3.1
4743
hooks:
4844
- id: relint
4945
args: [-W] # to fail on warnings
46+
- repo: https://github.com/MiraGeoscience/pre-commit-hooks
47+
rev: v1.1.0
48+
hooks:
49+
- id: check-copyright
50+
files: (^package\.rst|^LICENSE|^README(|-dev)\.rst|\.py|\.pyi)$
51+
exclude: (^\.|^docs/)
52+
- id: prepare-commit-msg
53+
- id: check-commit-msg
5054
- repo: local
5155
hooks:
5256
- id: pylint
@@ -56,47 +60,43 @@ repos:
5660
require_serial: true # pylint does its own parallelism
5761
types: [python]
5862
exclude: ^(devtools|docs)/
59-
- id: check-copyright
60-
name: Check copyright
61-
entry: python devtools/check-copyright.py
62-
language: python
63-
types: [text]
64-
files: (^LICENSE|^README(|-dev).rst|\.py|\.pyi)$
65-
exclude: (^\.|^docs/)
66-
- id: prepare-commit-msg
67-
stages: [prepare-commit-msg]
68-
name: Prepare commit message
69-
entry: python devtools/git_message_hook.py --prepare
70-
language: python
71-
- id: check-commit-msg
72-
stages: [commit-msg]
73-
name: Check commit message
74-
entry: python devtools/git_message_hook.py --check
75-
language: python
7663
- repo: https://github.com/codespell-project/codespell
77-
rev: v2.2.6
64+
rev: v2.3.0
7865
hooks:
7966
- id: codespell
8067
exclude: (-lock\.ya?ml|\benvironments/.*\.ya?ml|\.ipynb|^THIRD_PARTY_SOFTWARE\.rst)$
8168
entry: codespell -I .codespellignore
8269
- repo: https://github.com/pre-commit/pre-commit-hooks
83-
rev: v4.5.0
70+
rev: v5.0.0
8471
hooks:
8572
- id: trailing-whitespace
8673
exclude: \.mdj$
74+
- id: check-json
75+
exclude_types: [jupyter]
8776
- id: check-toml
8877
- id: check-yaml
89-
# - id: check-added-large-files # crashing on some configuration. To be investigated
78+
- id: check-added-large-files
79+
# args: [--enforce-all]
9080
- id: check-case-conflict
9181
- id: check-merge-conflict
9282
- id: debug-statements
9383
- id: detect-private-key
9484
- id: end-of-file-fixer
95-
exclude: \.mdj$
85+
exclude: (^\.idea/.*\.xml|\.mdj)$
9686
- id: mixed-line-ending
87+
exclude: ^\.idea/.*\.xml$
9788
- id: name-tests-test
89+
- id: pretty-format-json
90+
args:
91+
- --autofix
92+
- --indent=4
93+
- --no-sort-keys
94+
- --top-keys
95+
- version,title,icon,documentation,conda_environment,run_command,geoh5,monitoring_directory,workspace_geoh5
96+
exclude_types: [jupyter]
97+
exclude: ^docs/.*/images/
9898
- repo: https://github.com/rstcheck/rstcheck
99-
rev: v6.2.0
99+
rev: v6.2.4
100100
hooks:
101101
- id: rstcheck
102102
exclude: ^THIRD_PARTY_SOFTWARE.rst$

0 commit comments

Comments
 (0)