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

Option: Warnings and/or Deprecation Warnings Raise RuntimeError #822

Merged
merged 20 commits into from
Apr 25, 2022

Conversation

eslickj
Copy link
Member

@eslickj eslickj commented Apr 22, 2022

Changes proposed in this PR:

This adds to config options, warning_to_exception and deprecation_to_exception. If these options are set to True, they make log messages at warning or above raise and exception and/or warning and above log messages that say deprecat* raise an exception. This can be used to test that a model raises no warnings or uses no deprecated methods or models. For warnings it also lets you see a traceback, so you can get more specific diagnostic info on the warning.

Legal Acknowledgement

By contributing to this software project, I agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the license terms described in the LICENSE.txt file at the top level of this directory.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@eslickj eslickj self-assigned this Apr 22, 2022
@codecov
Copy link

codecov bot commented Apr 22, 2022

Codecov Report

Merging #822 (ece422a) into main (828e469) will increase coverage by 0.00%.
The diff coverage is 85.00%.

@@           Coverage Diff           @@
##             main     #822   +/-   ##
=======================================
  Coverage   67.92%   67.92%           
=======================================
  Files         567      567           
  Lines       62208    62228   +20     
  Branches    11513    11520    +7     
=======================================
+ Hits        42254    42268   +14     
- Misses      17780    17784    +4     
- Partials     2174     2176    +2     
Impacted Files Coverage Δ
idaes/config.py 82.44% <85.00%> (+0.46%) ⬆️
idaes/ver.py 61.53% <0.00%> (-4.62%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 828e469...ece422a. Read the comment docs.

docs/reference_guides/configuration.rst Outdated Show resolved Hide resolved
idaes/config.py Outdated Show resolved Hide resolved
idaes/config.py Outdated Show resolved Hide resolved
idaes/config.py Outdated Show resolved Hide resolved
idaes/config.py Outdated Show resolved Hide resolved
idaes/config.py Outdated Show resolved Hide resolved
idaes/config.py Outdated Show resolved Hide resolved
idaes/tests/test_config.py Outdated Show resolved Hide resolved
docs/reference_guides/configuration.rst Outdated Show resolved Hide resolved
docs/reference_guides/configuration.rst Outdated Show resolved Hide resolved
Copy link
Member

@andrewlee94 andrewlee94 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, but I had one question about what appears to be an unnecessary duplicated line.

idaes/tests/test_config.py Outdated Show resolved Hide resolved
@andrewlee94 andrewlee94 added enhancement New feature or request documentation Documentations comments and requests Priority:Normal Normal Priority Issue or PR labels Apr 25, 2022
@andrewlee94 andrewlee94 added the testing Issues dealing with testing of code label Apr 25, 2022
@eslickj eslickj changed the title Option: Warnings and/or Deprecation Warings Raise RuntimeError Option: Warnings and/or Deprecation Warnings Raise RuntimeError Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentations comments and requests enhancement New feature or request Priority:Normal Normal Priority Issue or PR testing Issues dealing with testing of code
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

4 participants