Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .ci/environment_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies:

# optional dependencies
- dask
- distributed
- zarr
- fsspec>=0.3.3
- choclo>=0.3.0
Expand Down Expand Up @@ -47,3 +48,5 @@ dependencies:
- wheel
- twine
- python-build
- pip:
- "geoh5py>=0.14.0b1,<0.15.0"
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
call-workflow-dependabot-auto-merge:
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-dependabot-auto-merge.yml@7241532854727d993872b67fc761139b8438615b # v3.12.0
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-dependabot-auto-merge.yml@edb72d7524d25db3b4eb976890eb6837a8eb39f8 # v4.0.1
permissions:
contents: write
pull-requests: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue_to_jira.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ permissions: {}
jobs:
call-workflow-create-jira-issue:
if: startsWith(github.repository, 'MiraGeoscience/') # run on the Mira repo only
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-jira-issue_to_jira.yml@7241532854727d993872b67fc761139b8438615b # v3.12.0
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-jira-issue_to_jira.yml@edb72d7524d25db3b4eb976890eb6837a8eb39f8 # v4.0.1
permissions:
contents: read
issues: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr_jira_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
call-workflow-pr_jira_actions:
if: github.event.action != 'edited' || github.event.changes.title != null
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-jira-pr_actions.yml@7241532854727d993872b67fc761139b8438615b # v3.12.0
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-jira-pr_actions.yml@edb72d7524d25db3b4eb976890eb6837a8eb39f8 # v4.0.1
permissions:
contents: read
pull-requests: write
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ jobs:

steps:
- name: Checkout target repository source
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- name: Setup Python env
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.11'

Expand All @@ -61,7 +61,7 @@ jobs:
# Checkout PR branch.
# TREAT THIS CODE AS MALICIOUS, DON'T RUN CODE FROM THIS BRANCH.
- name: checkout pull request source
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.pull_request.head.sha }}
path: pr_source
Expand All @@ -83,12 +83,12 @@ jobs:

steps:
- name: Checkout target repository source
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- name: Setup Python env
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.11'

Expand All @@ -98,13 +98,13 @@ jobs:
# Checkout PR branch.
# TREAT THIS CODE AS MALICIOUS, DON'T RUN CODE FROM THIS BRANCH.
- name: checkout pull request source
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.pull_request.head.sha }}
path: 'pr_source'
persist-credentials: false

- uses: reviewdog/action-black@644053a260402bc4278a865906107bd8aef7fae8 # v3.22.4
- uses: reviewdog/action-black@602e2f027fa4af7b40e7d1bf747c226dcebf8e10 # v3.26.0
with:
workdir: 'pr_source'
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/python_deploy_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:
jobs:
call-workflow-conda-publish:
name: Publish development conda package on JFrog Artifactory
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-publish_rattler_package.yml@b2de1e00a0be160d8cf6e14716825673070bf264 # v3.13.0
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-publish_rattler_package.yml@edb72d7524d25db3b4eb976890eb6837a8eb39f8 # v4.0.1
permissions:
contents: write
with:
Expand All @@ -29,7 +29,7 @@ jobs:
JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }}
call-workflow-pypi-publish:
name: Publish development pypi package (JFrog Artifactory)
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-publish_pypi_package.yml@b2de1e00a0be160d8cf6e14716825673070bf264 # v3.13.0
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-publish_pypi_package.yml@edb72d7524d25db3b4eb976890eb6837a8eb39f8 # v4.0.1
permissions:
contents: write
with:
Expand All @@ -51,14 +51,14 @@ jobs:
id-token: write
steps:
- name: Download build artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: mira-simpeg-pip-package-build
path: dist-download
# Must be a direct step (not in a reusable workflow or composite action), see
# https://docs.pypi.org/trusted-publishers/troubleshooting/#reusable-workflows-on-github
- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@ba38be9e461d3875417946c167d0b5f3d385a247 # v1.14.1
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
with:
packages-dir: dist-download/
repository-url: https://test.pypi.org/legacy/
11 changes: 6 additions & 5 deletions .github/workflows/python_deploy_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
name: Publish production Conda package on JFrog Artifactory
needs: validate-release-tag
if: ${{ github.event_name == 'release' || github.event.inputs.publish-conda == 'true' }}
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-release_conda_assets.yml@b2de1e00a0be160d8cf6e14716825673070bf264 # v3.13.0
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-release_conda_assets.yml@edb72d7524d25db3b4eb976890eb6837a8eb39f8 # v4.0.1
permissions:
contents: write
with:
Expand All @@ -54,7 +54,7 @@ jobs:
name: Publish production PyPI package (JFrog Artifactory)
needs: validate-release-tag
if: ${{ github.event_name == 'release' || github.event.inputs.publish-pypi == 'true' }}
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-release_pypi_assets.yml@b2de1e00a0be160d8cf6e14716825673070bf264 # v3.13.0
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-release_pypi_assets.yml@edb72d7524d25db3b4eb976890eb6837a8eb39f8 # v4.0.1
permissions:
contents: write
with:
Expand All @@ -70,18 +70,19 @@ jobs:
if: ${{ (github.event_name == 'release' || github.event.inputs.publish-pypi == 'true') && needs.call-workflow-pypi-release.result == 'success' }}
runs-on: ubuntu-latest
permissions:
contents: read
# Draft-release assets cannot be downloaded by this job with read-only contents access.
contents: write
id-token: write
steps:
- name: Download release assets
uses: MiraGeoscience/CI-tools/.github/actions/reusable-python-download_dist_release@b2de1e00a0be160d8cf6e14716825673070bf264 # v3.13.0
uses: MiraGeoscience/CI-tools/.github/actions/reusable-python-download_dist_release@edb72d7524d25db3b4eb976890eb6837a8eb39f8 # v4.0.1
with:
release-tag: ${{ github.event.release.tag_name || github.ref_name }}
github-token: ${{ secrets.GITHUB_TOKEN }}
# Must be a direct step (not in a reusable workflow or composite action), see
# https://docs.pypi.org/trusted-publishers/troubleshooting/#reusable-workflows-on-github
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@ba38be9e461d3875417946c167d0b5f3d385a247 # v1.14.1
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
with:
packages-dir: dist-download/
repository-url: https://upload.pypi.org/legacy/
18 changes: 4 additions & 14 deletions .github/workflows/security_scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,12 @@ concurrency:
cancel-in-progress: true

jobs:
call-workflow-zizmor-annotate:
name: Zizmor analysis (advanced security)
zizmor:
name: Zizmor analysis
# run on the Mira repo only (upstream SimPEG repo has its own workflow for Zizmor)
if: ${{ github.event_name != 'pull_request' && startsWith(github.repository, 'MiraGeoscience/') }}
if: ${{ startsWith(github.repository, 'MiraGeoscience/') }}
permissions:
security-events: write
contents: read
actions: read
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-zizmor-advanced-security.yml@7241532854727d993872b67fc761139b8438615b # v3.12.0

call-workflow-zizmor-advanced-security:
name: Zizmor analysis (annotate)
# run on the Mira repo only (upstream SimPEG repo has its own workflow for Zizmor)
if: ${{ github.event_name == 'pull_request' && startsWith(github.repository, 'MiraGeoscience/') }}
permissions:
checks: write
contents: read
actions: read
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-zizmor-annotate.yml@7241532854727d993872b67fc761139b8438615b # v3.12.0
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-zizmor.yml@edb72d7524d25db3b4eb976890eb6837a8eb39f8 # v4.0.1
6 changes: 3 additions & 3 deletions .github/workflows/test-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# Need to fetch more than the last commit so that setuptools-scm can
# create the correct version string. If the number of commits since
Expand All @@ -70,13 +70,13 @@ jobs:
run: git fetch origin 'refs/tags/*:refs/tags/*'

- name: Setup caching for conda packages
uses: actions/cache@v6
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/conda_pkgs_dir
key: conda-${{ env.PYTHON }}-${{ hashFiles(env.ENVIRONMENT) }}

- name: Setup Miniforge
uses: conda-incubator/setup-miniconda@be893c923ea9cf1cf7cd510fbdde27c7e18cbdcb
uses: conda-incubator/setup-miniconda@be893c923ea9cf1cf7cd510fbdde27c7e18cbdcb # v4.1.0
with:
python-version: ${{ env.PYTHON }}
miniforge-version: latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wip-status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
call-workflow-wip-status:
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-wip-status.yml@7241532854727d993872b67fc761139b8438615b # v3.12.0
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-wip-status.yml@edb72d7524d25db3b4eb976890eb6837a8eb39f8 # v4.0.1
permissions:
contents: read
statuses: write
4 changes: 2 additions & 2 deletions .github/workflows/zizmor-security-upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Setup Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.12"

Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
repos:
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.3.1
rev: 26.10.1
hooks:
- id: black
language_version: python3
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
rev: 7.5.0
hooks:
- id: flake8
language_version: python3
Expand All @@ -17,6 +17,6 @@ repos:
- flake8-docstrings==1.7.0
- flake8-pyproject==1.2.3
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.16.6
rev: v0.17.5
hooks:
- id: ruff-check
7 changes: 4 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,17 @@ dependencies:

# style checking
- pre-commit
- black==26.3.1
- flake8==7.0.0
- black==26.10.1
- flake8==7.5.0
- flake8-pyproject==1.2.3
- flake8-bugbear==23.12.2
- flake8-builtins==2.2.0
- flake8-mutable==1.2.0
- flake8-rst-docstrings==0.3.0
- flake8-docstrings==1.7.0
- mypy=1.15.0
- zizmor # lint GitHub Actions workflows
- ruff
- ruff=0.17.5

# recommended
- jupyter
Expand Down
16 changes: 10 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ authors = [
keywords = ["geophysics", "inverse problem"]

dependencies = [
# Mira packages
"geoh5py>=0.14.0b1,<0.15.0",
# "geoh5py @ git+https://github.com/MiraGeoscience/geoh5py.git@release/ga-4.9",
# other direct dependencies
"discretize>=0.11",
"geoana>=0.7.0",
"geoh5py>=0.13.0b1",
"libdlf",
"matplotlib",
"numpy>=1.22",
Expand Down Expand Up @@ -56,7 +59,7 @@ Documentation = 'https://docs.simpeg.xyz'
Repository = "http://github.com/MiraGeoscience/simpeg"

[project.optional-dependencies]
dask = ["dask", "zarr", "fsspec>=0.3.3"]
dask = ["dask", "distributed", "zarr", "fsspec>=0.3.3"]
choclo = ["choclo>=0.3.0"]
reporting = ["scooby"]
plotting = ["plotly"]
Expand All @@ -66,15 +69,16 @@ all = [
"simpeg[dask,choclo,plotting,reporting,sklearn,pandas]"
] # all optional *runtime* dependencies (not related to development)
style = [
"black==26.3.1",
"flake8==7.0.0",
"black==26.10.1",
"flake8==7.5.0",
"flake8-bugbear==23.12.2",
"flake8-builtins==2.2.0",
"flake8-mutable==1.2.0",
"flake8-rst-docstrings==0.3.0",
"flake8-docstrings==1.7.0",
"flake8-pyproject==1.2.3",
"ruff==0.16.6",
"mypy==1.15.0",
"ruff==0.17.5",
]
docs = [
"sphinx",
Expand Down Expand Up @@ -138,7 +142,7 @@ exclude_also = [
directory = "coverage_html_report"

[tool.black]
required-version = '26.3.1'
required-version = '26.10.1'
target-version = ["py312", "py313", "py314"]


Expand Down
8 changes: 4 additions & 4 deletions recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ requirements:
host:
- python ${{ python_min }}.*
- setuptools >=64
- setuptools_scm >=8
- setuptools_scm >=9.2.0,<10.0
- pip
run:
- python >=${{ python_min }}
- python >=${{ python_min }}, <4.0
# Mira packages
- geoh5py >=0.13.0b1, 0.13.*
# direct dependencies
- geoh5py >=0.14.0b1, <0.15.0
# other direct dependencies
- dask-core *
- discretize >=0.11
- distributed *
Expand Down
9 changes: 6 additions & 3 deletions simpeg/directives/_directives.py
Original file line number Diff line number Diff line change
Expand Up @@ -2826,14 +2826,17 @@ def parse_by_nested_levels(
Replace leaf elements of `nesting` with values from `values` (in order).
Assumes the number of leaf positions equals len(values).

Parameters:
Parameters
----------
- nesting: arbitrarily nested list structure; leaves are non-list values
- values: flat iterable whose values will fill the leaves in order

Returns:
Returns
-------
- A new nested structure with leaves replaced by values from `values`.

Raises:
Raises
------
- ValueError if `values` has fewer or more elements than required by `nesting`.
"""
indices = np.arange(len(self.invProb.dmisfit.objfcts))
Expand Down
Loading
Loading