Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
islpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
Kaushik Kulkarni
islpy
Commits
c8b5ab75
Commit
c8b5ab75
authored
9 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Document DEFAULT_CONTEXT, warn about cross-context comparisons
parent
32b0b270
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/reference.rst
+10
-0
10 additions, 0 deletions
doc/reference.rst
islpy/__init__.py
+13
-7
13 additions, 7 deletions
islpy/__init__.py
with
23 additions
and
7 deletions
doc/reference.rst
+
10
−
0
View file @
c8b5ab75
...
...
@@ -82,6 +82,16 @@ Error Reporting
.. exception:: Error
Global Data
^^^^^^^^^^^
.. data:: DEFAULT_CONTEXT
ISL objects being unpickled or initialized from strings will be instatiated
within this :class:`Context`.
.. versionadded:: 2015.2
Symbolic Constants
^^^^^^^^^^^^^^^^^^
...
...
This diff is collapsed.
Click to expand it.
islpy/__init__.py
+
13
−
7
View file @
c8b5ab75
...
...
@@ -139,14 +139,14 @@ def _add_functionality():
new_ctx
.
_release
()
def
context_getstate
(
self
):
if
self
.
data
==
_
DEFAULT_CONTEXT
.
data
:
if
self
.
data
==
DEFAULT_CONTEXT
.
data
:
return
(
"
default
"
,)
else
:
return
(
None
,)
def
context_setstate
(
self
,
data
):
if
data
[
0
]
==
"
default
"
:
self
.
_setup
(
_
DEFAULT_CONTEXT
.
data
)
self
.
_setup
(
DEFAULT_CONTEXT
.
data
)
else
:
context_init
(
self
)
...
...
@@ -175,7 +175,7 @@ def _add_functionality():
raise
TypeError
(
"'
s
'
argument not supplied
"
)
if
context
is
None
:
context
=
_
DEFAULT_CONTEXT
context
=
DEFAULT_CONTEXT
new_me
=
self
.
read_from_str
(
context
,
s
)
self
.
_setup
(
new_me
.
_release
())
...
...
@@ -232,10 +232,16 @@ def _add_functionality():
# {{{ rich comparisons
def
obj_eq
(
self
,
other
):
assert
self
.
get_ctx
()
==
other
.
get_ctx
(),
(
"
Equality-comparing two objects from different ISL Contexts
"
"
will likely lead to entertaining (but never useful) results.
"
"
In particular, Spaces with matching names will no longer be
"
"
equal.
"
)
return
self
.
is_equal
(
other
)
def
obj_ne
(
self
,
other
):
return
not
self
.
is
_eq
ual
(
other
)
return
not
self
.
_
_eq
__
(
other
)
for
cls
in
ALL_CLASSES
:
if
hasattr
(
cls
,
"
is_equal
"
):
...
...
@@ -488,7 +494,7 @@ def _add_functionality():
raise
TypeError
(
"'
name
'
argument not supplied
"
)
if
context
is
None
:
context
=
_
DEFAULT_CONTEXT
context
=
DEFAULT_CONTEXT
new_me
=
cls
.
alloc
(
context
,
name
,
user
)
self
.
_setup
(
new_me
.
_release
())
...
...
@@ -775,7 +781,7 @@ def _add_functionality():
raise
TypeError
(
"'
src
'
argument not supplied
"
)
if
context
is
None
:
context
=
_
DEFAULT_CONTEXT
context
=
DEFAULT_CONTEXT
if
isinstance
(
src
,
six
.
string_types
):
new_me
=
Val
.
read_from_str
(
context
,
src
)
...
...
@@ -1012,7 +1018,7 @@ def _add_functionality():
_add_functionality
()
_
DEFAULT_CONTEXT
=
Context
()
DEFAULT_CONTEXT
=
Context
()
def
_back_to_basic
(
new_obj
,
old_obj
):
...
...
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