Skip to content
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

misc: Revamp exception hierarchy #2500

Merged
merged 11 commits into from
Dec 23, 2024
Merged

misc: Revamp exception hierarchy #2500

merged 11 commits into from
Dec 23, 2024

Conversation

FabioLuporini
Copy link
Contributor

This was long due

Also improves handling of C-level errors

Copy link

codecov bot commented Dec 17, 2024

Codecov Report

Attention: Patch coverage is 55.26316% with 17 lines in your changes missing coverage. Please review.

Project coverage is 87.27%. Comparing base (c04071a) to head (76651c8).
Report is 12 commits behind head on master.

Files with missing lines Patch % Lines
devito/operator/operator.py 54.54% 5 Missing ⚠️
devito/core/operator.py 20.00% 4 Missing ⚠️
devito/builtins/utils.py 0.00% 1 Missing ⚠️
devito/ir/clusters/algorithms.py 50.00% 1 Missing ⚠️
devito/ir/iet/visitors.py 50.00% 1 Missing ⚠️
devito/passes/clusters/aliases.py 50.00% 1 Missing ⚠️
devito/passes/clusters/buffering.py 66.66% 1 Missing ⚠️
devito/passes/iet/orchestration.py 50.00% 1 Missing ⚠️
devito/types/basic.py 66.66% 1 Missing ⚠️
devito/types/dense.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2500      +/-   ##
==========================================
- Coverage   87.28%   87.27%   -0.01%     
==========================================
  Files         238      238              
  Lines       45683    45686       +3     
  Branches     4052     4057       +5     
==========================================
- Hits        39874    39873       -1     
- Misses       5123     5127       +4     
  Partials      686      686              

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

Copy link
Contributor

@georgebisbas georgebisbas left a comment

Choose a reason for hiding this comment

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

Looks fine!

devito/operator/operator.py Outdated Show resolved Hide resolved
tests/test_buffering.py Outdated Show resolved Hide resolved
@JDBetteridge
Copy link
Contributor

Let me know if I'm being too picky!

Copy link
Contributor

@JDBetteridge JDBetteridge left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -188,7 +189,8 @@ def _sanitize_exprs(cls, expressions, **kwargs):

for i in expressions:
if not isinstance(i, Evaluable):
raise InvalidOperator("`%s` is not an `Evaluable` object" % str(i))
raise CompilationError(f"`{i!s}` is not an Evaluable object, "
"check again your Equation")
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: "check your equation again" would be more natural phrasing, and the comma should probably be a semicolon

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixing now

"than available (%s) " % humanbytes(available_mem) +
"on physical device, this will start swapping")
raise MemoryError(
f"Trying to allocate more memory ({humanbytes(required_mem)}) "
Copy link
Contributor

Choose a reason for hiding this comment

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

Honestly much better.

@mloubout mloubout merged commit 061ef8e into master Dec 23, 2024
31 checks passed
@mloubout mloubout deleted the improve-exceptions branch December 23, 2024 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants