Skip to content

Conversation

@mloubout
Copy link
Contributor

Fix handling of tensor kwargs when they are provided as per-compoenent

@mloubout mloubout added the API api (symbolics, types, ...) label May 14, 2025
@classmethod
def _sympify(self, arg):
# This is used internally by sympy to process arguments at rebuilt. And since
# some of our property are non-sympyfiable we need to make sure we have a fallback
Copy link
Contributor

Choose a reason for hiding this comment

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

*properties

return orders
else:
return orders[0]
# return ({a.space_order for a in self} - {None}).pop()
Copy link
Contributor

Choose a reason for hiding this comment

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

leftover

@mloubout mloubout force-pushed the tens-kwargs branch 2 times, most recently from d8bfd46 to 1dd5f5a Compare May 14, 2025 15:00
for k, v in kwargs.items():
if isinstance(v, MatrixBase):
sub_kwargs[k] = v[i, j]
else:
Copy link
Contributor

Choose a reason for hiding this comment

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

it's imho one of those cases in which elif isinstance(v, <what's needed here>): .... else: .... would read more smoothly than a nested try-except (but I'm nitpicking here)

# Setup kwargs for subfunction
# Through rebuilding or user input, the kwargs could be
# Tensors as well from a per-component property
sub_kwargs = {}
Copy link
Contributor

Choose a reason for hiding this comment

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

seems redundant, perhaps factor out in a utility function? or a private method?

@mloubout mloubout force-pushed the tens-kwargs branch 3 times, most recently from 18d1f9b to 0f421b6 Compare May 14, 2025 15:46
@codecov
Copy link

codecov bot commented May 14, 2025

Codecov Report

Attention: Patch coverage is 94.87179% with 2 lines in your changes missing coverage. Please review.

Project coverage is 91.91%. Comparing base (3047085) to head (90aeff2).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
devito/types/basic.py 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2604      +/-   ##
==========================================
- Coverage   91.91%   91.91%   -0.01%     
==========================================
  Files         245      245              
  Lines       48403    48427      +24     
  Branches     4252     4255       +3     
==========================================
+ Hits        44491    44513      +22     
- Misses       3235     3237       +2     
  Partials      677      677              
Flag Coverage Δ
pytest-gpu-aomp-amdgpuX 72.53% <69.69%> (+0.01%) ⬆️
pytest-gpu-nvc-nvidiaX 73.60% <69.69%> (+<0.01%) ⬆️

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 merged commit c91cee0 into main May 15, 2025
34 checks passed
@mloubout mloubout deleted the tens-kwargs branch May 15, 2025 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API api (symbolics, types, ...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants