-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Derive all PyFluent warnings from common base classes. (#2852)
* feat: Derive all PyFluent warnings from common base classes. * feat: Derive all PyFluent warnings from common base classes. * fix: test
- Loading branch information
Showing
12 changed files
with
80 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,33 @@ | ||
"""Provides a module to get warnings for core functionality.""" | ||
|
||
import warnings | ||
|
||
|
||
class PyFluentDeprecationWarning(FutureWarning): | ||
"""Provides the common warning class for all deprecated PyFluent feature.""" | ||
"""Provides the common warning class for warnings about deprecated PyFluent | ||
features.""" | ||
|
||
pass | ||
|
||
|
||
class PyFluentUserWarning(UserWarning): | ||
"""Provides the common warning class for warnings generated from user code.""" | ||
|
||
pass | ||
|
||
|
||
class WarningControl: | ||
"""Class to control warnings in PyFluent.""" | ||
|
||
def enable(self): | ||
"""Enables all PyFluent warnings.""" | ||
warnings.simplefilter("default", PyFluentDeprecationWarning) | ||
warnings.simplefilter("default", PyFluentUserWarning) | ||
|
||
def disable(self): | ||
"""Disables all PyFluent warnings.""" | ||
warnings.simplefilter("ignore", PyFluentDeprecationWarning) | ||
warnings.simplefilter("ignore", PyFluentUserWarning) | ||
|
||
|
||
warning = WarningControl() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters