-
Notifications
You must be signed in to change notification settings - Fork 8
check rcppdeepstate from this repo #13
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
tdhock
wants to merge
11
commits into
master
Choose a base branch
from
check-rcppdeepstate
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 all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f52b7f8
leak
tdhock c0aacd7
fail_ci_if_error:true
tdhock 8b37de6
only pr not push
tdhock e9277ec
custom test harness
tdhock 01881ed
10 inputs
tdhock 5c0626a
fixed seed
tdhock 16d3fe6
only leak for positive data
tdhock 32d0969
tab ->space
tdhock 4a57056
rm rcppdeepstate yaml action
tdhock 631d0d3
new yaml
tdhock 9920c75
merge
tdhock 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| on: | ||
| pull_request: | ||
| branches: | ||
| - '*' | ||
|
|
||
| name: 'RcppDeepState analysis' | ||
| jobs: | ||
| RcppDeepState: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| env: | ||
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
|
|
||
| - uses: FabrizioSandri/RcppDeepState-action@main | ||
| with: | ||
| fail_ci_if_error: true | ||
| seed: 5 | ||
| time_limit_seconds: 60 | ||
| max_inputs: 100 | ||
| comment: true | ||
| verbose: true |
53 changes: 53 additions & 0 deletions
53
inst/testfiles/binseg_interface/binseg_interface_DeepState_TestHarness.cpp
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,53 @@ | ||
| #include <fstream> | ||
| #include <RInside.h> | ||
| #include <iostream> | ||
| #include <RcppDeepState.h> | ||
| #include <qs.h> | ||
| #include <DeepState.hpp> | ||
|
|
||
| RInside Rinstance; | ||
|
|
||
| /** FUNCTION SIGNATURE */ | ||
| Rcpp::List binseg_interface(const Rcpp::NumericVector data_vec, const Rcpp::NumericVector weight_vec, | ||
| const int max_segments, const int min_segment_length, const std::string distribution_str, | ||
| const std::string container_str, const Rcpp::LogicalVector is_validation_vec, const Rcpp::NumericVector position_vec); | ||
|
|
||
| Rcpp::LogicalVector RcppDeepState_LogicalVector(int rand_size){ | ||
| Rcpp::LogicalVector rand_vec(rand_size); | ||
| for(int i = 0 ; i < rand_size;i++){ | ||
| rand_vec[i] = DeepState_IntInRange(0,1); | ||
| } | ||
|
|
||
| return rand_vec; | ||
| } | ||
|
|
||
| #define INPUTS \ | ||
| int n_data = DeepState_IntInRange(1,1000); \ | ||
| Rcpp::NumericVector data_vec = RcppDeepState_NumericVector(n_data, 0, 1000); \ | ||
| Rcpp::NumericVector weight_vec = RcppDeepState_NumericVector(n_data, 0, 1000); \ | ||
| int max_segments = RcppDeepState_int(1, n_data); \ | ||
| int min_segment_length = RcppDeepState_int(1, 10); \ | ||
| std::string distribution_str = "test"; \ | ||
| std::string container_str = "test"; \ | ||
| Rcpp::LogicalVector is_validation_vec = RcppDeepState_LogicalVector(n_data); \ | ||
| Rcpp::NumericVector position_vec = RcppDeepState_NumericVector(n_data, 0, 1000); | ||
|
|
||
| TEST(binsegRcpp, generator){ | ||
| INPUTS | ||
| } | ||
|
|
||
| TEST(binsegRcpp, runner){ | ||
| INPUTS | ||
|
|
||
| /** INPUTS DUMP | ||
| Skipped: the final analysis table will contain an empty inputs column | ||
| */ | ||
|
|
||
| try{ | ||
| binseg_interface(data_vec, weight_vec, max_segments,min_segment_length, | ||
| distribution_str, container_str, is_validation_vec, position_vec); | ||
|
|
||
| }catch(Rcpp::exception& e){ | ||
| std::cout<<"Exception Handled"<<std::endl; | ||
| } | ||
| } | ||
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
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.
you could use a macro like this to avoid duplication in definition of data /generator code.
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.
@FabrizioSandri
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.
@tdhock I have revised the harness creation procedure of RcppDeepState and made some additional improvements, including the use of macros. You can find these new changes in FabrizioSandri/RcppDeepState#16.
Before testing this change I have to merge FabrizioSandri/RcppDeepState#16 into the main branch. I will wait for your code review before merging these modifications, so that if something is wrong I can simply adjust.