Skip to content

Python: Test Catch User Errors#172

Merged
ax3l merged 1 commit intoBLAST-ImpactX:developmentfrom
ax3l:test-catch-user-errors-py
Sep 13, 2022
Merged

Python: Test Catch User Errors#172
ax3l merged 1 commit intoBLAST-ImpactX:developmentfrom
ax3l:test-catch-user-errors-py

Conversation

@ax3l
Copy link
Copy Markdown
Member

@ax3l ax3l commented Jul 23, 2022

Test multiple possible usage errors from Python. We want to make sure that these errors throw exceptions and do not abort/terminate the Python process. That way, the user-experience in IPython/Jupyter notebooks will be better (no session restart needed).

@ax3l ax3l added component: tests examples, tests and benchmarks component: python Python bindings labels Jul 23, 2022
@ax3l ax3l requested review from RTSandberg and cemitch99 July 23, 2022 01:46
Copy link
Copy Markdown
Member

@cemitch99 cemitch99 left a comment

Choose a reason for hiding this comment

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

This looks good to me.

@ax3l ax3l force-pushed the test-catch-user-errors-py branch from a13c0b5 to bcc1406 Compare July 26, 2022 00:02
Copy link
Copy Markdown
Contributor

@RTSandberg RTSandberg left a comment

Choose a reason for hiding this comment

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

I don't see why this wouldn't pass but it looks good to me

@ax3l ax3l force-pushed the test-catch-user-errors-py branch 6 times, most recently from 94898fb to 013245c Compare September 1, 2022 23:46
// check for validity of arguments
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(argd > 0.0_prt, "invalid ptd arg (<=0)");
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(arg > 0.0_prt, "invalid pt arg (<=0)");
AMREX_ASSERT_WITH_MESSAGE(argd > 0.0_prt, "invalid ptd arg (<=0)");
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Moved to debug-only because this is in a kernel as part of a hot loop.

@ax3l ax3l force-pushed the test-catch-user-errors-py branch 3 times, most recently from 23b2144 to 8eac9d2 Compare September 6, 2022 23:16
@ax3l ax3l enabled auto-merge (squash) September 6, 2022 23:16
@ax3l ax3l force-pushed the test-catch-user-errors-py branch from 8eac9d2 to b7f534e Compare September 9, 2022 18:36
@ax3l
Copy link
Copy Markdown
Member Author

ax3l commented Sep 9, 2022

ah, got ya: AMReX-Codes/amrex#2944

Test multiple possible usage errors from Python. We want to make
sure that these errors throw exceptions and do not abort/terminate
the Python process. That way, the user-experience in IPython/Jupyter
notebooks will be better (no session restart needed).
@ax3l ax3l force-pushed the test-catch-user-errors-py branch from 55aa2e9 to 616b33a Compare September 13, 2022 18:51
@ax3l ax3l merged commit c6fc469 into BLAST-ImpactX:development Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: python Python bindings component: tests examples, tests and benchmarks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants