Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
loopy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Klöckner
loopy
Commits
50768a5c
Commit
50768a5c
authored
8 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Deprecate 'warn', move to 'warn_with_kernel'
parent
d8c45494
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
loopy/diagnostic.py
+7
-1
7 additions, 1 deletion
loopy/diagnostic.py
with
7 additions
and
1 deletion
loopy/diagnostic.py
+
7
−
1
View file @
50768a5c
...
@@ -23,6 +23,9 @@ THE SOFTWARE.
...
@@ -23,6 +23,9 @@ THE SOFTWARE.
"""
"""
from
pytools
import
MovedFunctionDeprecationWrapper
# {{{ warnings
# {{{ warnings
class
LoopyWarningBase
(
UserWarning
):
class
LoopyWarningBase
(
UserWarning
):
...
@@ -47,7 +50,7 @@ class WriteRaceConditionWarning(LoopyWarning):
...
@@ -47,7 +50,7 @@ class WriteRaceConditionWarning(LoopyWarning):
# }}}
# }}}
def
warn
(
kernel
,
id
,
text
,
type
=
LoopyWarning
):
def
warn
_with_kernel
(
kernel
,
id
,
text
,
type
=
LoopyWarning
):
from
fnmatch
import
fnmatchcase
from
fnmatch
import
fnmatchcase
for
sw
in
kernel
.
silenced_warnings
:
for
sw
in
kernel
.
silenced_warnings
:
if
fnmatchcase
(
id
,
sw
):
if
fnmatchcase
(
id
,
sw
):
...
@@ -60,6 +63,9 @@ def warn(kernel, id, text, type=LoopyWarning):
...
@@ -60,6 +63,9 @@ def warn(kernel, id, text, type=LoopyWarning):
warn
(
text
,
type
)
warn
(
text
,
type
)
warn
=
MovedFunctionDeprecationWrapper
(
warn_with_kernel
)
# {{{ errors
# {{{ errors
class
LoopyError
(
RuntimeError
):
class
LoopyError
(
RuntimeError
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment