Skip to content

api: fix derivatives kw for tensors#2723

Merged
mloubout merged 2 commits intomainfrom
tens-deriv-kw
Sep 8, 2025
Merged

api: fix derivatives kw for tensors#2723
mloubout merged 2 commits intomainfrom
tens-deriv-kw

Conversation

@mloubout
Copy link
Contributor

@mloubout mloubout commented Sep 2, 2025

Fixes #2721

@mloubout mloubout added bug-py-minor API api (symbolics, types, ...) labels Sep 2, 2025
@codecov
Copy link

codecov bot commented Sep 2, 2025

Codecov Report

❌ Patch coverage is 94.11765% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.15%. Comparing base (b4e9995) to head (af0bd23).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
devito/types/basic.py 60.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2723   +/-   ##
=======================================
  Coverage   92.15%   92.15%           
=======================================
  Files         248      248           
  Lines       49961    49995   +34     
  Branches     4399     4401    +2     
=======================================
+ Hits        46040    46072   +32     
- Misses       3211     3213    +2     
  Partials      710      710           
Flag Coverage Δ
pytest-gpu-aomp-amdgpuX 70.92% <38.46%> (-0.02%) ⬇️
pytest-gpu-nvc-nvidiaX 71.88% <38.46%> (-0.03%) ⬇️

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.

@mloubout mloubout force-pushed the tens-deriv-kw branch 3 times, most recently from 32cc14d to fcf95ab Compare September 3, 2025 20:02
Copy link
Contributor

@FabioLuporini FabioLuporini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uncontroverisal

PS: I just noted applyfunc should probably be a private meth

@mloubout
Copy link
Contributor Author

mloubout commented Sep 4, 2025

PS: I just noted applyfunc should probably be a private meth

It's a sympy method from the sympy matrix type, not ours.

@mloubout mloubout force-pushed the tens-deriv-kw branch 3 times, most recently from aea705d to abcb8d1 Compare September 6, 2025 02:35
Copy link
Contributor

@EdCaunt EdCaunt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple super tiny nitpicks, feel free to ignore. Looks g2g otherwise

u = Function(name="u", grid=grid, space_order=2, staggered=x)
v = Function(name="v", grid=grid, space_order=2, staggered=NODE)

w = [-2, 2] # Should 4 coeff since this is staggered
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 coeffs?


eq0 = Eq(u, v.dx(w=w)).evaluate
exp0 = -2 * v / x.spacing + 2 * v._subs(x, x + x.spacing)/x.spacing
# This one should fallback to taylor coeffs sinc w is too short
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"sinc" -> "since"

f = func(name="t", grid=grid, space_order=2)

# Custom coefficients
c = [10, 10, 10]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: is it worth making these 10, 20, 30 just to remove a potential non-uniqueness?

@mloubout mloubout merged commit eaa4891 into main Sep 8, 2025
36 checks passed
@mloubout mloubout deleted the tens-deriv-kw branch September 8, 2025 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API api (symbolics, types, ...) bug-py-minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for custom FD coefficients when using Vector objects

3 participants