-
Notifications
You must be signed in to change notification settings - Fork 2
issue 10: view several sessions same time #171
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
Open
alixdamman
wants to merge
8
commits into
larray-project:master
Choose a base branch
from
alixdamman:10_view_several_sessions_same_time
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
fc7ee49
split test scripts
alixdamman 580f65c
made edit() function to accept arrays and sessions
alixdamman 44cfd9e
- implemented MapItem class
alixdamman d5580da
- removed setitem_pattern
alixdamman bef4f44
removed print statement
alixdamman 2728fe4
updated condition in ipython_cell_executed()
alixdamman 749b034
force update of dict-like objects when the operator = appears in the …
alixdamman f1cece4
updated patterns + ipython_cell_executed() + added test_regex.py module
alixdamman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
from larray_editor.editor import setitem_pattern, setattr_pattern | ||
|
||
|
||
def test_setitem(): | ||
# new array | ||
input = 'data = ndtest(10)' | ||
m = setitem_pattern.match(input) | ||
assert m is None | ||
|
||
# update array | ||
input = 'data[:] = 0' | ||
varname, selection = setitem_pattern.match(input).groups() | ||
assert varname == 'data' | ||
assert selection == ':' | ||
|
||
# testing array | ||
input = 'data[2010:2012] == data2[2010:2012]' | ||
m = setitem_pattern.match(input) | ||
assert m is None | ||
|
||
# session - new array | ||
input = 'ses["data"] = ndtest(10)' | ||
varname, selection = setitem_pattern.match(input).groups() | ||
assert varname == 'ses' | ||
assert selection == '"data"' | ||
|
||
# session - update array | ||
input = 'ses["data"][:] = 0' | ||
varname, selection = setitem_pattern.match(input).groups() | ||
assert varname == 'ses' | ||
assert selection == '"data"' | ||
|
||
# session - testing array | ||
input = 'ses["data"] == ses2["data"]' | ||
m = setitem_pattern.match(input) | ||
assert m is None | ||
|
||
|
||
def test_setattr(): | ||
# new array | ||
input = 'data = ndtest(10)' | ||
m = setattr_pattern.match(input) | ||
assert m is None | ||
|
||
# update array metadata | ||
input = 'data.meta.title = "my array"' | ||
m = setattr_pattern.match(input) | ||
assert m is None | ||
|
||
# session - new array | ||
input = 'ses.data = ndtest(10)' | ||
varname, attrname = setattr_pattern.match(input).groups() | ||
assert varname == 'ses' | ||
assert attrname == 'data' | ||
|
||
# session - update array | ||
input = 'ses.data[:] = 0' | ||
varname, attrname = setattr_pattern.match(input).groups() | ||
assert varname == 'ses' | ||
assert attrname == 'data' | ||
|
||
# session - update array metadata | ||
input = 'ses.data.meta.title = "my array"' | ||
m = setattr_pattern.match(input) | ||
assert m is None |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know whether it is actually needed to check for setXXX patterns explicitly (previously the idea was to have setXXX for free from the getXXX pattern IIRC), but not checking at all for the getXXX pattern will introduce a slight regression AFAICT : it will not select the array (in the tree widget) if you type "income['M']" but will select it if you type "income". Did you intentionally remove that feature or was it an oversight?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hehe, I just checked and this didn't work previously. 😉 I wonder if we should support that or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.