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

Replace std::terminate with throw #3

Merged
merged 22 commits into from
May 21, 2021
Merged

Replace std::terminate with throw #3

merged 22 commits into from
May 21, 2021

Conversation

mlxd
Copy link
Member

@mlxd mlxd commented May 13, 2021

Context: The Abort.hpp header defines a series of macros that call std::terminate in the event of an unfavourable state or event in Jet. This will cause problems with the Python bindings, and kill the Python session is such a state or event is encountered.

Description of the Change: This PR replaces std::terminate with a thrown exception defined by the error message.

Benefits: This will prevent the Python session being terminated in the event of a call to any of the Abort.hpp macros.

Possible Drawbacks: None

Related GitHub Issues: None

@mlxd mlxd requested review from Mandrenkov and brownj85 May 13, 2021 15:20
@mlxd mlxd self-assigned this May 13, 2021
@mlxd mlxd added the enhancement ✨ New feature or request label May 13, 2021
@github-actions
Copy link

Test Report (Ubuntu)

0 files  0 suites   0s ⏱️
0 tests 0 ✔️ 0 💤 0 ❌

Results for commit 11b1d8c.

@github-actions
Copy link

Test Report (MacOS)

0 files  0 suites   0s ⏱️
0 tests 0 ✔️ 0 💤 0 ❌

Results for commit 11b1d8c.

Copy link
Collaborator

@Mandrenkov Mandrenkov left a comment

Choose a reason for hiding this comment

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

Thanks for running the benchmarks! This change would not be possible without them.

Also, don't forget to update the changelog!

@github-actions
Copy link

github-actions bot commented May 18, 2021

Test Report (C++) on Ubuntu

    1 files  ±0      1 suites  ±0   0s ⏱️ ±0s
239 tests ±0  239 ✔️ ±0  0 💤 ±0  0 ❌ ±0 
519 runs  ±0  519 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 45c6020. ± Comparison against base commit 45c6020.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented May 18, 2021

Test Report (C++) on MacOS

    1 files  ±0      1 suites  ±0   0s ⏱️ ±0s
239 tests ±0  239 ✔️ ±0  0 💤 ±0  0 ❌ ±0 
519 runs  ±0  519 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 45c6020. ± Comparison against base commit 45c6020.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@Mandrenkov Mandrenkov left a comment

Choose a reason for hiding this comment

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

Awesome work on the refactoring and the tests! This is a nice improvement over the first iteration.

In addition to the in-situ review comments, I would also suggest creating a Test_Abort.cpp file with a simple unit test to verify the format of an abort exception message.

Finally, don't forget to append this change to CHANGELOG.md!

Copy link
Collaborator

@Mandrenkov Mandrenkov left a comment

Choose a reason for hiding this comment

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

Nice! I have a few grammar and formatting suggestions but otherwise the PR looks solid.

Mandrenkov and others added 6 commits May 20, 2021 09:19
* Switch multi-index to row-major order

* Replace 'utilities' tag with 'Utilities'

* Fix tests specifying indices in column-major order

* Update changelog

* Fix Python unit test using column-major indices

* Undo modification to previous changelog entry

* Fix PR number
Copy link
Collaborator

@Mandrenkov Mandrenkov left a comment

Choose a reason for hiding this comment

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

🎉 Looks good to me! 🎉

@mlxd mlxd merged commit 45c6020 into main May 21, 2021
@mlxd mlxd deleted the enable-exceptions branch May 21, 2021 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants