Skip to content

Commit 0b67ffb

Browse files
authored
Merge pull request #53 from MiraGeoscience/release/0.1.7
GEOPY-1489: merge Release/0.1.7 to main
2 parents 7adbe26 + b3b0cc0 commit 0b67ffb

15 files changed

+682
-464
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ updates:
99
directory: "/"
1010
schedule:
1111
interval: "monthly"
12+
target-branch: "develop"

.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.yml

Lines changed: 5 additions & 3 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
@@ -19,11 +20,12 @@ on:
1920
jobs:
2021
pytest:
2122
name: pytest
23+
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
2224
strategy:
2325
fail-fast: false
2426
matrix:
2527
os: [ubuntu-latest]
26-
python_ver: ['3.8', '3.9', '3.10']
28+
python_ver: ['3.9', '3.10']
2729
defaults:
2830
run:
2931
shell: bash
@@ -32,7 +34,7 @@ jobs:
3234
POETRY_VIRTUALENVS_CREATE: true
3335
POETRY_VIRTUALENVS_IN_PROJECT: true
3436
steps:
35-
- uses: actions/checkout@v3
37+
- uses: actions/checkout@v4
3638
- name: Set up Python version
3739
uses: actions/setup-python@v4
3840
with:
@@ -59,4 +61,4 @@ jobs:
5961
- name: Install dependencies
6062
run: poetry install -vvv
6163
- name: pytest
62-
run: poetry run pytest --cov-report=xml --cov=param_sweeps --cov-branch --cov-fail-under=85
64+
run: poetry run pytest --cov --cov-report=xml

.github/workflows/pytest-windows.yml

Lines changed: 8 additions & 4 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
@@ -19,10 +20,11 @@ on:
1920
jobs:
2021
pytest:
2122
name: pytest (Windows)
23+
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
2224
strategy:
2325
fail-fast: false
2426
matrix:
25-
python_ver: ['3.8', '3.9', '3.10']
27+
python_ver: ['3.9', '3.10']
2628
defaults:
2729
run:
2830
shell: bash
@@ -31,7 +33,7 @@ jobs:
3133
POETRY_VIRTUALENVS_CREATE: true
3234
POETRY_VIRTUALENVS_IN_PROJECT: true
3335
steps:
34-
- uses: actions/checkout@v3
36+
- uses: actions/checkout@v4
3537
- name: Set up Python version
3638
uses: actions/setup-python@v4
3739
with:
@@ -58,9 +60,11 @@ jobs:
5860
- name: Install dependencies
5961
run: poetry install -vvv
6062
- name: pytest
61-
run: poetry run pytest --cov-report=xml --cov=param_sweeps --cov-branch --cov-fail-under=85
63+
run: poetry run pytest --cov --cov-report=xml
6264
- name: Codecov
6365
if: ${{ success() && matrix.python_ver == '3.10' }}
64-
uses: codecov/codecov-action@v3
66+
uses: codecov/codecov-action@v4
6567
with:
6668
name: GitHub
69+
fail_ci_if_error: true
70+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/static-analysis.yml

Lines changed: 3 additions & 1 deletion
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
@@ -19,12 +20,13 @@ on:
1920
jobs:
2021
pylint:
2122
name: pylint
23+
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
2224
runs-on: ubuntu-latest
2325
env:
2426
POETRY_VIRTUALENVS_CREATE: true
2527
POETRY_VIRTUALENVS_IN_PROJECT: true
2628
steps:
27-
- uses: actions/checkout@v3
29+
- uses: actions/checkout@v4
2830
- name: Set up Python version
2931
uses: actions/setup-python@v4
3032
with:

.pre-commit-config.yaml

Lines changed: 61 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,57 @@
11

22
default_language_version:
33
python: python3
4-
exclude: docs/(conf.py|_ext/)
4+
exclude: ^docs/(source/conf.py|_ext/)
55
default_stages: [commit,push]
66
fail_fast: false
77

88
ci:
99
skip: [pylint]
10+
autoupdate_branch: develop
11+
autoupdate_schedule: monthly
1012

1113
repos:
12-
- repo: https://github.com/psf/black
13-
rev: 23.9.1
14+
- repo: https://github.com/python-poetry/poetry
15+
rev: 1.8.0
1416
hooks:
15-
- id: black
16-
types: [text]
17-
types_or: [python, pyi]
17+
- id: poetry-check
18+
args: [--lock]
19+
- repo: https://github.com/hadialqattan/pycln
20+
rev: v2.4.0
21+
hooks:
22+
- id: pycln
23+
args: [--config=pyproject.toml]
1824
- repo: https://github.com/PyCQA/isort
19-
rev: 5.12.0
25+
rev: 5.13.2
2026
hooks:
2127
- id: isort
22-
additional_dependencies: [toml] # to read config from pyproject.toml
23-
types: [text]
24-
types_or: [python, pyi]
25-
- repo: https://github.com/humitos/mirrors-autoflake
26-
rev: v1.1
28+
additional_dependencies: [tomli] # to read config from pyproject.toml
29+
- repo: https://github.com/psf/black
30+
rev: 24.4.2
2731
hooks:
28-
- id: autoflake
29-
types: [text]
30-
types_or: [python, pyi]
32+
- id: black
3133
- repo: https://github.com/PyCQA/flake8
32-
rev: 6.1.0
34+
rev: 7.0.0
3335
hooks:
3436
- id: flake8
35-
types: [text]
36-
types_or: [python, pyi]
3737
- repo: https://github.com/asottile/pyupgrade
38-
rev: v3.13.0
38+
rev: v3.15.2
3939
hooks:
4040
- id: pyupgrade
41-
args: [--py38-plus]
42-
types: [text]
43-
types_or: [python, pyi]
41+
args: [--py310-plus]
4442
- repo: https://github.com/pre-commit/mirrors-mypy
45-
rev: v1.5.1
43+
rev: v1.10.0
4644
hooks:
4745
- id: mypy
48-
additional_dependencies: [types-toml]
49-
args: [--ignore-missing-imports, --scripts-are-modules, --show-error-context,
50-
--show-column-numbers]
46+
additional_dependencies: [
47+
numpy==1.26.*, # pre-commit CI does not provide numpy 1.23.*
48+
pydantic==2.5.*,
49+
tomli, # to read config from pyproject.toml
50+
types-toml,
51+
]
52+
exclude: ^docs/
5153
- repo: https://github.com/codingjoe/relint
52-
rev: 3.1.0
54+
rev: 3.1.1
5355
hooks:
5456
- id: relint
5557
args: [-W] # to fail on warnings
@@ -60,28 +62,38 @@ repos:
6062
entry: poetry run pylint
6163
language: system
6264
require_serial: true # pylint does its own parallelism
63-
types: [text]
64-
types_or: [python, pyi]
65-
exclude: devtools
65+
types: [python]
66+
exclude: ^(devtools|docs)/
6667
- id: check-copyright
6768
name: Check copyright
6869
entry: python devtools/check-copyright.py
6970
language: python
7071
types: [text]
71-
types_or: [python, pyi]
72-
exclude: ^(devtools/|docs/|setup.py)
72+
files: (^LICENSE|^README(|-dev).rst|\.py|\.pyi)$
73+
exclude: (^\.|^docs/)
74+
- id: prepare-commit-msg
75+
stages: [prepare-commit-msg]
76+
name: Prepare commit message
77+
entry: python devtools/git_message_hook.py --prepare
78+
language: python
79+
- id: check-commit-msg
80+
stages: [commit-msg]
81+
name: Check commit message
82+
entry: python devtools/git_message_hook.py --check
83+
language: python
7384
- repo: https://github.com/codespell-project/codespell
74-
rev: v2.2.5
85+
rev: v2.2.6
7586
hooks:
7687
- id: codespell
77-
exclude: (\.ipynb$|^\.github/workflows/issue_to_jira.yml$)
78-
types: [text]
79-
types_or: [python, pyi]
88+
exclude: (\.lock|\.ipynb|^THIRD_PARTY_SOFTWARE\.rst)$
89+
entry: codespell -I .codespellignore
8090
- repo: https://github.com/pre-commit/pre-commit-hooks
81-
rev: v4.4.0
91+
rev: v4.6.0
8292
hooks:
8393
- id: trailing-whitespace
8494
exclude: \.mdj$
95+
- id: check-json
96+
exclude_types: [jupyter]
8597
- id: check-toml
8698
- id: check-yaml
8799
# - id: check-added-large-files # crashing on some configuration. To be investigated
@@ -90,13 +102,24 @@ repos:
90102
- id: debug-statements
91103
- id: detect-private-key
92104
- id: end-of-file-fixer
93-
exclude: \.mdj$
105+
exclude: (^\.idea/.*\.xml|\.mdj)$
94106
- id: mixed-line-ending
107+
exclude: ^\.idea/.*\.xml$
95108
- id: name-tests-test
109+
- id: pretty-format-json
110+
args:
111+
- --autofix
112+
- --indent=4
113+
- --no-sort-keys
114+
- --top-keys
115+
- version,title,icon,documentation,conda_environment,run_command,geoh5,monitoring_directory,workspace_geoh5
116+
exclude_types: [jupyter]
117+
exclude: ^docs/(.*/)?images/
96118
- repo: https://github.com/rstcheck/rstcheck
97119
rev: v6.2.0
98120
hooks:
99121
- id: rstcheck
122+
exclude: ^THIRD_PARTY_SOFTWARE.rst$
100123
additional_dependencies: [sphinx]
101124
- repo: https://github.com/pre-commit/pygrep-hooks
102125
rev: v1.10.0

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 Mira Geoscience
3+
Copyright (c) 2024 Mira Geoscience
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,38 @@ of samples values for parameters that you would like to sweep.
3232
To organize the output, param-sweeps uses a `UUID` file naming scheme, with
3333
a `lookup.json` file to map individual parameter sets back to their respective
3434
files.
35+
36+
License
37+
^^^^^^^
38+
MIT License
39+
40+
Copyright (c) 2024 Mira Geoscience
41+
42+
Permission is hereby granted, free of charge, to any person obtaining a copy
43+
of this software and associated documentation files (the "Software"), to deal
44+
in the Software without restriction, including without limitation the rights
45+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
46+
copies of the Software, and to permit persons to whom the Software is
47+
furnished to do so, subject to the following conditions:
48+
49+
The above copyright notice and this permission notice shall be included in all
50+
copies or substantial portions of the Software.
51+
52+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
53+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
54+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
55+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
56+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
57+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
58+
SOFTWARE.
59+
60+
61+
Third Party Software
62+
^^^^^^^^^^^^^^^^^^^^
63+
The param-sweeps Software may provide links to third party libraries or code (collectively “Third Party Software”)
64+
to implement various functions. Third Party Software does not comprise part of the Software.
65+
The use of Third Party Software is governed by the terms of such software license(s).
66+
Third Party Software notices and/or additional terms and conditions are located in the
67+
`THIRD_PARTY_SOFTWARE.rst`_ file.
68+
69+
.. _THIRD_PARTY_SOFTWARE.rst: THIRD_PARTY_SOFTWARE.rst

THIRD_PARTY_SOFTWARE.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Third-party software
2+
====================
3+
4+
The mira-omf repository and source distributions bundle several libraries that are
5+
compatibly licensed. We list these here.
6+
7+
.. list-table::
8+
:widths: 25 25 50
9+
:header-rows: 1
10+
11+
* - Name
12+
- License
13+
- Description
14+
* - `geoh5py <https://github.com/MiraGeoscience/geoh5py>`_
15+
- LGPL-3.0-or-later
16+
- Python API for geoh5, an open file format for geoscientific data
17+
* - `h5py <https://www.h5py.org/>`_
18+
- BSD License
19+
- The h5py package provides both a high- and low-level interface to the HDF5 library from Python.
20+
* - `numpy <https://github.com/numpy/numpy>`_
21+
- BSD-3-Clause
22+
- Fundamental package for array computing in Python

0 commit comments

Comments
 (0)