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
76 changes: 51 additions & 25 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ name: Testing

on:
push:
branches:
- '*'
branches: ['*']
pull_request:
branches:
- '*'
branches: ['*']

jobs:
setup-build:
name: Ex1 (${{ matrix.python-version }}, ${{ matrix.os }})
Expand All @@ -18,26 +17,53 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.10"]
test_file: ["tests/test_dcip.py", "tests/test_em.py", "tests/test_gpr.py", "tests/test_mag.py", "tests/test_seismic.py"]
python-version: ["3.11"]
test_file: [
"tests/test_dcip.py",
"tests/test_em.py",
"tests/test_gpr.py tests/test_seismic.py",
"tests/test_mag.py"
]
env:
PYTEST_DISABLE_PLUGIN_AUTOLOAD: "1"
MPLBACKEND: Agg # avoid GUI backends import cost

steps:
- uses: actions/checkout@v2
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
activate-environment: geosci-labs
channels: conda-forge
environment-file: environment.yml
python-version: ${{ matrix.python-version }}
- name: Install Env
run: |
conda info
conda config --show
conda install -y pytest
pip install testipynb
conda list
- name: Run Tests
run: |
pytest -v ${{ matrix.test_file }}
- uses: actions/checkout@v4

# Use Miniforge3 (not "latest" to avoid 404s) + mamba, strict conda-forge
- name: Setup Conda (Miniforge3 + mamba)
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Miniforge3
miniforge-version: "24.11.0-0" # pin to avoid 'latest' asset 404s
python-version: ${{ matrix.python-version }}
activate-environment: geosci-labs
environment-file: environment.yml
use-mamba: true
auto-update-conda: false
auto-activate-base: false
channels: conda-forge
channel-priority: strict
condarc: |
channels:
- conda-forge
channel_priority: strict

- name: Show environment info
run: |
conda info
conda list

- name: Install test dependencies (pytest + testipynb)
run: |
n=0
until [ $n -ge 3 ]; do
mamba install -y pytest && pip install -U testipynb && break
n=$((n+1))
echo "Retry $n/3 after transient fetch error..."
sleep 10
done

- name: Run tests
run: pytest -v ${{ matrix.test_file }}
23 changes: 0 additions & 23 deletions environment-dev.yml

This file was deleted.

23 changes: 13 additions & 10 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@ name: geosci-labs
channels:
- conda-forge
dependencies:
- cvxopt
- deepdish
- discretize
- ipywidgets>=0.6.0
- jupyter
- matplotlib<3.5
- Pillow
- pip
- pymatsolver
- python=3.10
- python=3.11
- numpy
- scipy
- pydiso
- matplotlib
- ipywidgets
- jupyterlab
- pillow
- requests
- discretize
- simpeg
- pymatsolver
- deepdish
- cvxopt
- pip
- pip:
- git+https://github.com/geoscixyz/geosci-labs
123 changes: 15 additions & 108 deletions notebooks/dcip/DC_SurveyDataInversion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,9 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/syckdog/opt/anaconda3/envs/e350_notebook/lib/python3.9/site-packages/discretize/utils/code_utils.py:247: FutureWarning: ExtractCoreMesh has been deprecated, please use extract_core_mesh. It will be removed in version 1.0.0 of discretize.\n",
" warnings.warn(\n"
]
}
],
"outputs": [],
"source": [
"import warnings\n",
"warnings.filterwarnings(\"ignore\")\n",
Expand Down Expand Up @@ -54,24 +45,9 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "04569e8a845b4a32bc77d043b2950dd3",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"MyApp(children=(ToggleButtons(description='survey', options=('Dipole-Dipole', 'Dipole-Pole', 'Pole-Dipole', 'P…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"cylinder_app()"
]
Expand Down Expand Up @@ -139,24 +115,9 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "d1384e6efce843ca873e1a2f8571cc74",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"MyApp(children=(FloatSlider(value=-30.0, continuous_update=False, description='A', max=40.0, min=-40.0, step=1…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"plot_layer_potentials_app()"
]
Expand Down Expand Up @@ -198,24 +159,9 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "d645ed44e78b485a93927aa419e818e8",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"MyApp(children=(IntSlider(value=0, description='i', max=17), Output()), layout=Layout(align_items='stretch', d…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"MidpointPseudoSectionWidget()"
]
Expand All @@ -242,26 +188,9 @@
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"scrolled": false
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "6a25181275ec473a99eb1e64715b50d2",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"interactive(children=(BoundedFloatText(value=1000.0, description='$\\\\rho_1$', max=1000.0, min=10.0), BoundedFl…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"DC2DPseudoWidget()"
]
Expand Down Expand Up @@ -296,34 +225,12 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "79e1c6477a08484db56eb9cd47a1916a",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"MyApp(children=(BoundedFloatText(value=1000.0, description='$\\\\rho_1$', max=1000.0, min=10.0), BoundedFloatTex…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"DC2DfwdWidget()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -343,7 +250,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.11.10"
},
"widgets": {
"state": {
Expand All @@ -366,5 +273,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
32 changes: 5 additions & 27 deletions notebooks/em/EM_EM31.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -65,34 +65,12 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "f1ca2def4ff64fd59de24c86ec4ed65f",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"interactive(children=(FloatSlider(value=0.0, continuous_update=False, description='$h_{boom}$', max=2.0), Floa…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"interactive_responseFct()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -111,9 +89,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.11.10"
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
Loading
Loading