-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge 'develop' for gtools-1.0.3; exit if too many obs: SPI 32-bit in…
…teger bug * Closes #43 * Added option to selectively test via gtools, test[] * Gtools exits with error if `_N > 2^31-1` and points the user to the pertinent bug report. The SPI uses long integers (32-bit) instead of long long integers (64-bit) for its observation numbers (not to mention theyare signed integers, but alas). At any rate, this de facto limits the number of observations to 2^31-1.
- Loading branch information
Showing
23 changed files
with
238 additions
and
78 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
version: "generic-1.0.0-{build}" | ||
version: "generic-1.0.3-{build}" | ||
|
||
environment: | ||
matrix: | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
*! version 1.0.1 23Jul2018 Mauricio Caceres Bravo, [email protected] | ||
*! Encode varlist using Jenkin's 128-bit spookyhash via C plugins | ||
*! version 1.0.3 18Aug2018 Mauricio Caceres Bravo, [email protected] | ||
*! gtools function internals | ||
|
||
* rc 17000 | ||
* rc 17001 - no observations | ||
|
@@ -8,6 +8,7 @@ | |
* rc 17004 - strL variables could not be compressed | ||
* rc 17005 - strL contains binary data | ||
* rc 17006 - strL variables uknown error | ||
* rc 17800 - More than 2^31-1 obs | ||
* rc 17459 | ||
* rc 17900 | ||
* rc 17999 | ||
|
@@ -47,6 +48,17 @@ program _gtools_internal, rclass | |
exit 17001 | ||
} | ||
|
||
if ( `=_N > 2^31-1' ) { | ||
local nmax = trim("`: disp %21.0gc 2^31-1'") | ||
di as err `"too many observations"' | ||
di as err `""' | ||
di as err `"A Stata bug prevents gtools from working with more than `nmax' observations."' | ||
di as err `"See {browse "https://www.statalist.org/forums/forum/general-stata-discussion/general/1457637"}"' | ||
di as err `"and {browse "https://github.com/mcaceresb/stata-gtools/issues/43"}"' | ||
clean_all 17800 | ||
exit 17800 | ||
} | ||
|
||
local 00 `0' | ||
|
||
* Time the entire function execution | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
*! version 1.0.2 08Aug2018 Mauricio Caceres Bravo, [email protected] | ||
*! version 1.0.3 18Aug2018 Mauricio Caceres Bravo, [email protected] | ||
*! Program for managing the gtools package installation | ||
|
||
capture program drop gtools | ||
|
@@ -20,10 +20,15 @@ program gtools | |
showcase /// | ||
examples /// | ||
test /// | ||
TESTs(str) /// | ||
branch(str) /// | ||
] | ||
|
||
if ( "`branch'" == "" ) local branch master | ||
if ( `"`branch'"' == "" ) local branch master | ||
if !inlist(`"`branch'"', "develop", "master", "osx") { | ||
disp as err "unknown branch `branch'; available: develop master osx" | ||
exit 198 | ||
} | ||
|
||
local cwd `c(pwd)' | ||
local github https://raw.githubusercontent.com/mcaceresb/stata-gtools/`branch' | ||
|
@@ -41,7 +46,7 @@ program gtools | |
gtools_licenses | ||
} | ||
|
||
if ( `"`dependencies'`hashlib'`install_latest'`upgrade'`dll'`showcase'`examples'`test'"' == `""' ) { | ||
if ( `"`dependencies'`hashlib'`install_latest'`upgrade'`dll'`showcase'`examples'`test'`tests'"' == `""' ) { | ||
exit 0 | ||
} | ||
} | ||
|
@@ -83,7 +88,7 @@ program gtools | |
di as txt "Success!" | ||
cd `"`cwd'"' | ||
|
||
if ( `"`hashlib'`install_latest'`upgrade'`dll'`showcase'`examples'`test'"' == `""' ) { | ||
if ( `"`hashlib'`install_latest'`upgrade'`dll'`showcase'`examples'`test'`tests'"' == `""' ) { | ||
exit 0 | ||
} | ||
} | ||
|
@@ -92,7 +97,7 @@ program gtools | |
cap net uninstall gtools | ||
net install gtools, from(`github'/build) replace | ||
* gtools, dependencies replace | ||
if ( `"`hashlib'`dll'`showcase'`examples'`test'"' == `""' ) { | ||
if ( `"`hashlib'`dll'`showcase'`examples'`test'`tests'"' == `""' ) { | ||
exit 0 | ||
} | ||
} | ||
|
@@ -155,30 +160,55 @@ program gtools | |
} | ||
} | ||
else local hashlib spookyhash.dll | ||
if ( `"`showcase'`examples'`test'"' == `""' ) { | ||
if ( `"`showcase'`examples'`test'`tests'"' == `""' ) { | ||
exit 0 | ||
} | ||
} | ||
else if ( `hashusr' | ("`dll'" == "dll") ) { | ||
di as txt "-gtools, hashlib()- and -gtools, dll- only on Windows." | ||
if ( `"`showcase'`examples'`test'"' == `""' ) { | ||
if ( `"`showcase'`examples'`test'`tests'"' == `""' ) { | ||
exit 0 | ||
} | ||
} | ||
|
||
if ( "`showcase'`examples'" != "" ) { | ||
gtools_showcase | ||
if ( "`test'" == "" ) { | ||
if ( "`test'`tests'" == "" ) { | ||
exit 0 | ||
} | ||
} | ||
|
||
if ( "`test'" != "" ) { | ||
disp as txt "{bf:WARNING:} Unit tests from branch `branch' take 1-3 hours!" | ||
if ( "`test'`tests'" != "" ) { | ||
local t_hours comparisons | ||
local t_days bench_full | ||
local t_known dependencies basic_checks comparisons switches bench_test bench_full | ||
local t_extra: list tests - t_known | ||
|
||
if ( `:list sizeof t_extra' ) { | ||
disp `"(uknown tests detected: `t_extra'; will try to run anyway)"' | ||
} | ||
|
||
if ( "`tests'" == "" ) { | ||
disp as txt "{bf:WARNING:} Default unit tests from branch `branch' can take several" | ||
disp as txt "hours. See {help gtools:help gtools} for details on unit testing." | ||
} | ||
else if ( `:list t_hours in tests' ) { | ||
disp as txt "{bf:WARNING:} Unit tests" | ||
disp as txt _n(1) " `tests'" _n(1) | ||
disp as txt "from branch master can take several hours. See {help gtools:help gtools} for details." | ||
} | ||
else if ( `:list t_days in tests' ) { | ||
disp as txt "{bf:WARNING:} Unit tests" | ||
disp as txt _n(1) " `tests'" _n(1) | ||
disp as txt "from branch master can take more than a day. See {help gtools:help gtools} for details." | ||
} | ||
else { | ||
disp as txt "{bf:Note:} Unit tests '`tests'' from branch `branch'." | ||
} | ||
disp as txt "Are you sure you want to run them? (yes/no)", _request(GTOOLS_TESTS) | ||
if inlist(`"${GTOOLS_TESTS}"', "y", "yes") { | ||
global GTOOLS_TESTS | ||
cap noi do `github'/build/gtools_tests.do | ||
cap noi do `github'/build/gtools_tests.do `tests' | ||
exit _rc | ||
} | ||
else { | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
v 1.0.2 | ||
v 1.0.3 | ||
d | ||
d 'GTOOLS': Faster implementation of common Stata commands optimized for large datasets | ||
d | ||
|
@@ -45,7 +45,7 @@ d | |
d Author: Mauricio Caceres Bravo | ||
d Support: email [email protected] | ||
d | ||
d Distribution-Date: 20180808 | ||
d Distribution-Date: 20180818 | ||
d | ||
f _gtools_internal.ado | ||
f gcollapse.ado | ||
|
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
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
v 1.0.0 | ||
v 1.0.3 | ||
d Mauricio Caceres Bravo, [email protected] | ||
p 'GTOOLS': Generic stata repo that uses C plugins |
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
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
Binary file not shown.
Binary file not shown.
Oops, something went wrong.