Skip to content

Commit

Permalink
Dev 1.0 (#212)
Browse files Browse the repository at this point in the history
* Remove all backwards incomp. stuff (#186)

* Improve Survey (#187)

- Survey:
  - `frequencies` is also a dict.
  - Sources and receivers must be tuples or dicts; NO lists.
  - `name` is optional (and keyword only).
  - Optional `info` and `date` parameters.
  - No `Survey.observed`-attribute any longer.
  - No more `fixed` surveys.
  - `noise_floor` and `relative_error` are new stored as data array if they
    are not floats.
  - `data` can be a dict containing many data set.

- Dipole
  - No `name` any longer.

- Simulation:
  - `name` is optional (and keyword only).
  - Optional `info` parameter.

* Sphinx theme (#188)

* Re-work Core (#189)

* Re-work Solver (#190)

Solver:
* Start solver overhaul
* solve() does not take grid any longer; new signature, new `plain`
* New verbosity levels

Other
* Model is aware of grid; reduced TensorMesh
* _Map -> BaseMap
* _TensorMesh -> BaseMesh
* Field knows its grid (#191)

Documentation:
* Lots of documentation adjustements
* IPython and matplotlib sphinx-directives (#192)

* Re-work Model (#194)

- Not set properties (`property_y`, `property_z`, `mu_r`, `epsilon_r`) all return None if called.
- Not set properties cannot be set later.
- `model.case` are strings instead of numbers: `['isotropic', 'HTI', 'VTI', 'triaxial']

* Separate API docs per module (#195)

* Re-work Maps (#196)

* Rework entire interpolation stuff
* Cleaned-up maps

* Re-work meshes (#197)

* PEC to prolongation (#198)

* Re-work Fields Part I (#199)

* Remove SourceField
* Fields is not a subclassed ndarray any longer
* Inherit discretize conditionally
* Add setup.cfg for F401 on __init__
* Fix bug src-dep gridding in Simulation
* Do not (de-)serialize Maps

* Rework fields (#200)

* Cleaned module fields
* Add Win/MacOs; Python 3.9
* New fct emg3d.solver.solve_source
* New module electrodes; includes electric wire source

* Fix windows pytest failure (#202)

`pytest test_fields.py::TestGetReceiver::test_basics` fails on Windows, most likely with `emg3d.construct_mesh` - No idea why (`int32` issue?).

* Re-work electrodes (#203)

* Rework Surveys, Simulations, Optimize (#204)

* Magnetic field lives on faces again
* Outsource gallery again
* Do not store sfield, simplify rfield
* Add 'relative' to receivers
* New electrode convenience fcts
* Enable relative receivers in Survey/Simulation
* magnetic field use volume avg for mu again
* Simulation; no more grid
* to emsig.xyz and emg3d.emsig.xyz
* dict instead of tuples possible for construct_mesh

* Rework CLI/utils/io (#205)

* Rework io, utils, time
* master->main
* Move Fourier to new module `time`

* Fixes and docs for rc1 (#207)

* Improve docs
* Script to update old file format
* Fix rel. receivers in Simulation class

* Fixes to v1.0.0-rc.1 (#209)

- Fix adding noise to observed data in simulation if noise_floor is an xarray (related to point below) 
- Improve `survey.{noise_floor;relative_error}`

* fix workflow sed

* Further improvements towards 1.0 (#211)

* Further pep8 names in `core`
* Change discretize from master to main
* Re-enable `sphinx.ext.viewcode`
* Shorten doc urls (manual/api/dev)
* `max_prime` to `max_lowest` in `good_mg_cell_nr`
* Add CPU/RAM script to doc
* Fix fields.interpolate
* Update logo
  • Loading branch information
prisae committed May 22, 2021
1 parent 1a3add1 commit de92608
Show file tree
Hide file tree
Showing 123 changed files with 18,408 additions and 13,376 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/linkcheck.yml
Expand Up @@ -12,9 +12,9 @@ jobs:

steps:

# Cancel any previous run of the test job; [pin v0.6.0]
# Cancel any previous run of the test job; [pin v0.8.0 (2021-02-13)]
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@ce177499ccf9fd2aded3b0426c97e5434c2e8a73
uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d
with:
access_token: ${{ github.token }}

Expand Down
28 changes: 16 additions & 12 deletions .github/workflows/pytest.yml → .github/workflows/linux.yml
@@ -1,11 +1,11 @@
name: pytest
name: linux

# Only build PRs, the master branch, and releases.
# Only build PRs, the main branch, and releases.
on:
pull_request:
push:
branches:
- master
- main
release:
types:
- published
Expand Down Expand Up @@ -44,11 +44,15 @@ jobs:
- python-version: 3.8
name: plain
os: ubuntu
conda: "'discretize<0.6'" # Check discretize backwards comp.
conda: ""
- python-version: 3.8
name: full
os: ubuntu
conda: "xarray tqdm empymod h5py scooby discretize matplotlib"
- python-version: 3.9
name: plain
os: ubuntu
conda: ""

env:
# Used to for coveralls flag
Expand All @@ -57,9 +61,9 @@ jobs:

steps:

# Cancel any previous run of the test job; [pin v0.6.0]
# Cancel any previous run of the test job; [pin v0.8.0 (2021-02-13)]
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@ce177499ccf9fd2aded3b0426c97e5434c2e8a73
uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d
with:
access_token: ${{ github.token }}

Expand All @@ -81,8 +85,8 @@ jobs:
run: git fetch origin 'refs/tags/*:refs/tags/*'

- name: Setup miniconda
# [pin master Feb 8, 2001]
uses: conda-incubator/setup-miniconda@77b16ed746da28724c61e1f1ad23395a4b695ef5
# [pin v2.1.1 (2021-04-01)]
uses: conda-incubator/setup-miniconda@35d1405e78aa3f784fe3ce9a2eb378d5eeb62169
with:
auto-update-conda: true
miniconda-version: "latest"
Expand Down Expand Up @@ -132,8 +136,8 @@ jobs:
needs: test
name: Deploy to PyPI
runs-on: ubuntu-latest
# Only from the origin repository, not forks; only master and tags.
if: github.repository_owner == 'emsig' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))
# Only from the origin repository, not forks; only main and tags.
if: github.repository_owner == 'emsig' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))

steps:
# Checks-out your repository under $GITHUB_WORKSPACE
Expand Down Expand Up @@ -165,12 +169,12 @@ jobs:
pip install -r requirements-dev.txt
- name: Build source and wheel distributions
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/main'
run: |
# Change setuptools-scm local_scheme to "no-local-version" so the
# local part of the version isn't included, making the version string
# compatible with Test PyPI.
sed --in-place "s/'root'/'local_scheme':'no-local-version','root'/g" setup.py
sed --in-place 's/"root"/"local_scheme":"no-local-version","root"/g' setup.py
- name: Build source and wheel distributions
run: |
Expand Down
86 changes: 86 additions & 0 deletions .github/workflows/macos_windows.yml
@@ -0,0 +1,86 @@
name: macos & windows

# Only build PRs, the main branch, and releases.
on:
pull_request:
push:
branches:
- main
release:
types:
- published

# Use bash by default in all jobs
defaults:
run:
# Using "-l {0}" is necessary for conda environments to be activated
# But this breaks on MacOS if using actions/setup-python:
# https://github.com/actions/setup-python/issues/132
shell: bash

jobs:
test:

name: ${{ matrix.os }} py${{ matrix.python }}
runs-on: ${{ matrix.os }}-latest

strategy:
fail-fast: false
matrix:
os: [macos, windows]
python: [3.8, ]

steps:

# Cancel any previous run of the test job; [pin v0.8.0 (2021-02-13)]
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d
with:
access_token: ${{ github.token }}

# Checks-out your repository under $GITHUB_WORKSPACE
- name: Checkout
uses: actions/checkout@v2
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
# the last release is greater than this, the version still be wrong.
# Increase if necessary.
fetch-depth: 100
# The GitHub token is preserved by default but this job doesn't need
# to be able to push to GitHub.
persist-credentials: false

# Need the tags so that setuptools_scm can form a valid version number
- name: Fetch git tags
run: git fetch origin 'refs/tags/*:refs/tags/*'

- name: Setup miniconda
# [pin v2.1.1 (2021-04-01)]
uses: conda-incubator/setup-miniconda@35d1405e78aa3f784fe3ce9a2eb378d5eeb62169
with:
auto-update-conda: true
miniconda-version: "latest"
python-version: ${{ matrix.python }}
miniforge-variant: Mambaforge
use-mamba: true
# The following should not be necessary with Mambaforg(?).
channels: conda-forge,defaults
channel-priority: strict

- name: Install dependencies
shell: bash -l {0}
run: |
conda config --set always_yes yes --set changeps1 no
conda config --show-sources
conda config --show
conda install numpy pytest pytest-console-scripts pip
pip install setuptools_scm pytest-flake8
conda info -a
conda list
- name: Test with pytest
shell: bash -l {0}
run: |
python setup.py install
pytest --flake8
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -3,7 +3,8 @@ __pycache__/

# Sphinx
docs/_build/
docs/api/
docs/api/emg3d*
docs/savefig/

# Pytest and coverage related
htmlcov
Expand Down
18 changes: 18 additions & 0 deletions .readthedocs.yml
@@ -0,0 +1,18 @@
# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
formats: []

# Optionally set the version of Python and requirements required to build your
# docs
python:
version: 3.8
install:
- requirements: requirements-dev.txt
- method: pip
path: .

0 comments on commit de92608

Please sign in to comment.