8000 examples: First complete draft of dispersion notebook by JDBetteridge · Pull Request #2595 · devitocodes/devito · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

examples: First complete draft of dispersion notebook #2595

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

JDBetteridge
Copy link
Contributor

No description provided.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
codecov bot commented May 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.29%. Comparing base (f815f38) to head (3692fbc).
Report is 64 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2595      +/-   ##
==========================================
- Coverage   91.91%   91.29%   -0.62%     
==========================================
  Files         245      245              
  Lines       48313    48495     +182     
  Branches     4244     4261      +17     
==========================================
- Hits        44406    44273     -133     
- Misses       3232     3522     +290     
- Partials      675      700      +25     
Flag Coverage Δ
pytest-gpu-aomp-amdgpuX 72.55% <ø> (+0.02%) ⬆️
pytest-gpu-nvc-nvidiaX ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

georgebisbas commented on 2025-05-02T06:30:10Z
----------------------------------------------------------------

I think we usually have references at the last cell of a notebook. Not a strict rule though.


JDBetteridge commented on 2025-05-02T12:36:06Z
----------------------------------------------------------------

Fixed

Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

georgebisbas commented on 2025-05-02T06:30:11Z
----------------------------------------------------------------

Line #1.    # We import everything we need for the noterbook at the start

notebook typo


JDBetteridge commented on 2025-05-02T12:36:08Z
----------------------------------------------------------------

Comment was superfluous anyway

Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

georgebisbas commented on 2025-05-02T06:30:12Z
----------------------------------------------------------------

Should you add a comment on how it is (if it is) different from Deviot's builtin Ricker?


JDBetteridge commented on 2025-05-02T12:36:09Z
----------------------------------------------------------------

It isn't, but I really don't think it's necessary to invoke the wrath of examples.seismic.source.py that whole file could be 5 lines IMHO. I will change it if I'm instructed to, but this is much clearer

Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

georgebisbas commented on 2025-05-02T06:30:12Z
----------------------------------------------------------------

Citation can be a link I guess


JDBetteridge commented on 2025-05-02T12:36:14Z
----------------------------------------------------------------

Fixed

Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

georgebisbas commented on 2025-05-02T06:30:13Z
----------------------------------------------------------------

receiver*


JDBetteridge commented on 2025-05-02T12:36:17Z
----------------------------------------------------------------

Yes!

Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

georgebisbas commented on 2025-05-02T06:30:14Z
----------------------------------------------------------------

Courant*


Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

georgebisbas commented on 2025-05-02T06:30:15Z
----------------------------------------------------------------

Line #2.    # space as per the work of Tam and Webb, Caunt

Citations can be lifted to previous cell, and add link


JDBetteridge commented on 2025-05-02T12:36:26Z
----------------------------------------------------------------

Superfluous comment anyway

Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

georgebisbas commented on 2025-05-02T06:30:16Z
----------------------------------------------------------------

velocity*


Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

georgebisbas commented on 2025-05-02T06:30:16Z
----------------------------------------------------------------

Indistinguishable?*


JDBetteridge commented on 2025-05-02T12:36:41Z
----------------------------------------------------------------

Also see* 😂

@FabioLuporini FabioLuporini requested review from mloubout and EdCaunt May 2, 2025 07:16
@JDBetteridge JDBetteridge requested a review from ggorman May 2, 2025 08:53
Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

mloubout commented on 2025-05-02T12:33:42Z
----------------------------------------------------------------

Nitpicking: We usually group the imports as

lib

external

devito

so here would be

from functools import partial

import numpy as np
import scipy as sp
import sympy as sym
from matplotlib import patheffects
import matplotlib.colors as colors
import matplotlib.pyplot as plt

from devito import Grid, Function, TimeFunction, SparseTimeFunction, Eq, Operator, solve

Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

mloubout commented on 2025-05-02T12:33:43Z
----------------------------------------------------------------

THis should be available in examples/seismic/sources.py , maybe make it an importable function


Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

mloubout commented on 2025-05-02T12:33:44Z
----------------------------------------------------------------

Spectrum (Fourier transform) is usualy plotted as continuous in geophys, so just plot not bar


EdCaunt commented on 2025-06-02T11:01:47Z
----------------------------------------------------------------

I quite like it as bars. It more clearly identifies the harmonics. I think conflating spectrum and spectral envelope is quite confusing really and probably bad practice, even if it is commonplace

Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

mloubout commented on 2025-05-02T12:33:45Z
----------------------------------------------------------------

Maybe point to where it's computed in examples/seismic/model.py so user/reader see it's implemented in the examples.

Also maybe h_min in case someone use different spacing in different dimensions


Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

mloubout commented on 2025-05-02T12:33:45Z
----------------------------------------------------------------

Never seen that left one, that's interesting.


EdCaunt commented on 2025-05-02T14:10:45Z
----------------------------------------------------------------

It corresponds to the "squaring" effect of numerical dispersion on an expanding wavefront (effective velocity is greater off-axis and less on-axis).

Copy link
Contributor Author

Fixed


View entire conversation on ReviewNB

Copy link
Contributor Author

Comment was superfluous anyway


View entire conversation on ReviewNB

Copy link
Contributor Author

It isn't, but I really don't think it's necessary to invoke the wrath of examples.seismic.source.py that whole file could be 5 lines IMHO. I will change it if I'm instructed to, but this is much clearer


View entire conversation on ReviewNB

Copy link
Contributor Author

Fixed


View entire conversation on ReviewNB

Copy link
Contributor Author

Yes!


View entire conversation on ReviewNB

Copy link
Contributor Author

Superfluous comment anyway


View entire conversation on ReviewNB

Copy link
Contributor Author

Also see* 😂


View entire conversation on ReviewNB

Copy link
Contributor
EdCaunt commented May 2, 2025

It corresponds to the "squaring" effect of numerical dispersion on an expanding wavefront (effective velocity is greater off-axis and less on-axis).


View entire conversation on ReviewNB

Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

EdCaunt commented on 2025-05-02T14:20:18Z
----------------------------------------------------------------

Typo: "peeking" (to surreptitiously look at something), not "peaking" (to reach a highest point)


Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

EdCaunt commented on 2025-05-02T14:20:19Z
----------------------------------------------------------------

Line #12.            print(f'Optimal weights for {ii}{th} derivative on the {jj + ii + 1} point(s) x = {x[:jj + ii + 1]}:\n\t {w[:jj + ii + 1]}')

Nitpick: Split this print over two lines.

Have you flake8 linted the notebook with nbqa?


Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

EdCaunt commented on 2025-05-02T14:20:20Z
----------------------------------------------------------------

Nitpick: "Investigation of dispersion properties" would read more naturally


Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

EdCaunt commented on 2025-05-02T14:20:21Z
----------------------------------------------------------------

I presume it assumes an antisymmetric stencil for first derivatives, or is this analysis not applicable?


Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

EdCaunt commented on 2025-05-02T14:20:21Z
----------------------------------------------------------------

Typo: "missfit" -> "misfit"

Also this paragraph is pretty garbled and needs a rewrite


Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

EdCaunt commented on 2025-05-02T14:20:22Z
----------------------------------------------------------------

This will need an #NBVAL_IGNORE_OUTPUT


Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

EdCaunt commented on 2025-05-02T14:20:23Z
----------------------------------------------------------------

"First consider the wavefield" would be more natural phrasing.

Typos: "dasahed" -> "dashed", "Courtant" -> "Courant"

"slightly sub-critical" would be better phrasing imo


Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

EdCaunt commented on 2025-05-02T14:46:27Z
----------------------------------------------------------------

Typo: "correspinging" -> "corresponding"


Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

EdCaunt commented on 2025-05-02T14:46:28Z
----------------------------------------------------------------

Typo: "dispersions" -> "dispersion"


Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

EdCaunt commented on 2025-05-02T14:46:29Z
----------------------------------------------------------------

Typo: "trapesium" -> "trapezium"


Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

EdCaunt commented on 2025-05-02T14:46:29Z
----------------------------------------------------------------

Probably reword


Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

EdCaunt commented on 2025-05-02T14:46:30Z
----------------------------------------------------------------

"Choosing some objective function that minimises some measurable quantity of interest, in this case dispersion." is a little tautologous. Perhaps "devising measure of dispersion accuracy to suit the problem of interest"


Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

EdCaunt commented on 2025-05-02T14:46:31Z
----------------------------------------------------------------

Typo: "grid pacing"


Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

EdCaunt commented on 2025-05-02T14:46:32Z
----------------------------------------------------------------

Line #1.    resolution = 101

The plots would look nicer if you doubled this and turned on imshow interpolation


Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

EdCaunt commented on 2025-05-02T14:46:32Z
----------------------------------------------------------------

Typo: "cross secion", "wave number" -> "wavenumber", "trapesium" -> "trapezium"


Copy link
review-notebook-app bot commented May 2, 2025

View / edit / reply to this conversation on ReviewNB

EdCaunt commented on 2025-05-02T14:46:33Z
----------------------------------------------------------------

Skip this cell otherwise it's going to massively slow down CI!


Copy link

View / edit / reply to this conversation on ReviewNB

EdCaunt commented on 2025-05-02T14:46:34Z
----------------------------------------------------------------

Typo: "optimisaion"


Copy link
Contributor
EdCaunt commented Jun 2, 2025

I quite like it as bars. It more clearly identifies the harmonics. I think conflating spectrum and spectral envelope is quite confusing really and probably bad practice, even if it is commonplace


View entire conversation on ReviewNB

Copy link
review-notebook-app bot commented Jun 2, 2025

View / edit / reply to this conversation on ReviewNB

EdCaunt commented on 2025-06-02T11:03:39Z
----------------------------------------------------------------

Nitpick: This markdown cell can be consolidated with the one above


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0