-
Notifications
You must be signed in to change notification settings - Fork 3
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
Orthogonal selection #108
Open
Artur-man
wants to merge
25
commits into
keller-mark:main
Choose a base branch
from
Artur-man:main
base: main
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
Orthogonal selection #108
Changes from 22 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
d1a0b07
implement Int class and methods
Artur-man 3d3231c
implement IntDimIndexer
Artur-man 145a932
implement orthogonal indexer and orthogonal selection
Artur-man 3903f99
implement Order and IntArrayDimIndexer classes
Artur-man 587d9ec
fix documentation of Order class and finalize new method for IntArray…
Artur-man 09b9bb2
implement iter method for IntArrayDimIndexer
Artur-man 6811fc0
fix R specific indexing fixes for Orthogonal and IntArrayDim indexers
Artur-man 88b19b7
fix zero_based_to_one_based function to accept non Slice objects and …
Artur-man 0cdc700
update normalize_integer_selection for integer vector and fix for R i…
Artur-man 155b5bc
fix IntArrayDimIndexer bug for nonincreasing and decreasing vector of…
Artur-man 5c867dd
support for slicing with step size with seq function
Artur-man eef088b
fix chunk index selection bug in IntArrayDimIndexer
Artur-man 98bd238
add more tests
Artur-man b7f5c5c
update normalization and add notes
Artur-man 5f39613
update tests, add filtering functions, update get_item to include is_…
Artur-man 974ae84
readd figure
Artur-man d8fb887
update `[` method to incorporate orthogonal selection
Artur-man d7d45c0
add new orthogonal selection tests
Artur-man 0f96973
update manage_filters for orthogonal selection
Artur-man de8d51e
update s3 tests
Artur-man 7acf5e8
add note for BoolArrayDimIndexer
Artur-man 1aa13ab
remove functions and documentation of int() utilities for now #108
Artur-man 74686fe
remove commented-out lines
Artur-man 7b6104b
Update R/indexing.R
Artur-man 441c6ae
Update indexing.R, remove whitespace
Artur-man 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 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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
manage_filters <- function(filters) { | ||
lapply(filters, function(x) { | ||
# Proceed based on type of filter | ||
if(typeof(x) == "symbol") { | ||
# When empty dimension, return everything | ||
if(x == "") { | ||
return(NULL) | ||
} else { | ||
stop("Unsupported filter '", as.character(x), "' supplied") | ||
} | ||
|
||
} else if(typeof(x) == "double") { | ||
# Return single value for dimension | ||
return(slice(x, x)) | ||
} else if(typeof(x) == "language") { | ||
x <- as.list(x) | ||
|
||
# Return a range (supplied via : or seq()) | ||
if(x[[1]] == ":") { | ||
return(slice(x[[2]], x[[3]])) | ||
} else if(x[[1]] == "seq") { | ||
# TODO: do we need slicing for this case ? otherwise implement slice(start, stop, step) | ||
arg_names <- names(x) | ||
from <- ifelse("from" %in% arg_names, x[[which("from" == arg_names)]], x[[2]]) | ||
to <- ifelse("to" %in% arg_names, x[[which("to" == arg_names)]], x[[3]]) | ||
if(length(x) > 3) { | ||
by <- ifelse("by" %in% arg_names, x[[which("by" == arg_names)]], x[[4]]) | ||
return(seq(from, to, by)) | ||
} else { | ||
by <- NA | ||
return(seq(from, to)) | ||
} | ||
return(seq(from, to, by)) | ||
} else if(x[[1]] == "c") { | ||
check_func <- sapply(x, function(y) { | ||
!is.function(eval(y)) | ||
}) | ||
return(floor(unlist(x[check_func]))) | ||
} else { | ||
stop("Unsupported filter '", as.character(x), "' supplied") | ||
} | ||
} else { | ||
stop("Unsupported filter '", as.character(x), "' supplied") | ||
} | ||
}) | ||
} |
Oops, something went wrong.
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.
Would you be able to add documentation comments for this function?