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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

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.88235% with 15 lines in your changes missing coverage. Please review.

Project coverage is 87.28%. Comparing base (cc04242) to head (140a1f5).

Files with missing lines Patch % Lines
devito/operator/operator.py 54.54% 5 Missing ⚠️
devito/core/operator.py 20.00% 4 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/dense.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2500      +/-   ##
==========================================
- Coverage   87.29%   87.28%   -0.01%     
==========================================
  Files         238      238              
  Lines       45609    45609              
  Branches     4042     4047       +5     
==========================================
- Hits        39814    39811       -3     
- Misses       5112     5115       +3     
  Partials      683      683              

☔ 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

Let me know if I'm being too picky!

Copy link

@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.

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