Skip to content

Commit

Permalink
Merge branch 'develop' for several bug fixes
Browse files Browse the repository at this point in the history
gtools-0.6.16 (2017-09-13)

* Improves the issues raised by #7
  Now the commands only fail if Stata hits the `matsize` limit (internally,
  the plugin no longer uses the `subinstr` hack to go from locals to mata
  string matrices and uses `tokens` instead, which is more appropriate;
  further, the plugin tries to set matsize to at least the number of variables
  and gives a verbose error if it fails).
* No longer crashes on Linux systems with older glibc versions.
* Fixes #14
* Should fix #12
* Fixes #9
* Fixed #8
  `gegen` is callable via `by:`; it also gives the stat for the
  overall group if called without a `by`.
  • Loading branch information
mcaceresb committed Sep 13, 2017
2 parents 3effffa + 8477936 commit feff102
Show file tree
Hide file tree
Showing 36 changed files with 761 additions and 286 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ _Gtools_ is a Stata package that provides a fast implementation of
common group commands like collapse and egen using C plugins for a
massive speed improvement.

`version 0.6.10 27Jul2017`
`version 0.6.16 13Sep2017`
Builds: Linux [![Travis Build Status](https://travis-ci.org/mcaceresb/stata-gtools.svg?branch=master)](https://travis-ci.org/mcaceresb/stata-gtools),
Windows (Cygwin) [![Appveyor Build status](https://ci.appveyor.com/api/projects/status/2bh1q9bulx3pl81p/branch/master?svg=true)](https://ci.appveyor.com/project/mcaceresb/stata-gtools)

Expand Down Expand Up @@ -427,8 +427,8 @@ devised by Bob Jenkins, which is a 128-bit hash. Stata caps observations
at 20 billion or so, meaning a 128-bit hash collision is _de facto_ impossible.
Nevertheless, the function does check for hash collisions and will fall back
on `collapse` and `egen` when it encounters a collision. An internal
mechanism for resolving potential collisions is in the works. See (issue
2)[https://github.com/mcaceresb/stata-gtools/issues/2] for a discussion.
mechanism for resolving potential collisions is in the works. See [issue
2](https://github.com/mcaceresb/stata-gtools/issues/2) for a discussion.

### Why use platform-dependent plugins?

Expand Down
30 changes: 28 additions & 2 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,34 @@
# puts a .zip file in ./releases)

from os import makedirs, path, linesep, chdir, system, remove, rename
from shutil import copy2, which, rmtree
from shutil import copy2, rmtree
from sys import platform
from tempfile import gettempdir
from zipfile import ZipFile
from re import search

try:
from shutil import which
except:
def which(program):
import os

def is_exe(fpath):
return path.isfile(fpath) and os.access(fpath, os.X_OK)

fpath, fname = path.split(program)
if fpath:
if is_exe(program):
return program
else:
for epath in os.environ["PATH"].split(os.pathsep):
epath = path.strip('"')
exe_file = path.join(epath, program)
if is_exe(exe_file):
return exe_file

return None

import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--stata',
Expand Down Expand Up @@ -54,6 +76,7 @@
required = False)
args = vars(parser.parse_args())


def makedirs_safe(directory):
try:
makedirs(directory)
Expand All @@ -62,6 +85,7 @@ def makedirs_safe(directory):
if not path.isdir(directory):
raise


gtools_ssc = [
"gcollapse.ado",
"gcollapse.sthlp",
Expand Down Expand Up @@ -193,11 +217,13 @@ def makedirs_safe(directory):
"env_set_windows.plugin",
"env_set_macosx.plugin",
"gtools_unix.plugin",
"gtools_unix_legacy.plugin",
"gtools_unix_multi.plugin",
"gtools_unix_multi_legacy.plugin",
"spookyhash.dll",
"gtools_windows.plugin",
"gtools_macosx.plugin"]
plugbak = plugins.copy()
plugbak = plugins[:]
for plug in plugbak:
if not path.isfile(path.join("build", plug)):
alt = path.join("lib", "plugin", plug)
Expand Down
35 changes: 35 additions & 0 deletions build/changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,41 @@
Change Log
==========

## gtools-0.6.15 (2017-09-12); fixes #14, #9

### Bug fixes

* Fixes https://github.com/mcaceresb/stata-gtools/issues/14
* Fixes https://github.com/mcaceresb/stata-gtools/issues/9
(prior fixes were erratic; this should work)

## gtools-0.6.14 (2017-09-12)

### Bug fixes

* No longer crashes on Linux systems with older glibc versions.

## gtools-0.6.13 (2017-09-12)

### Bug fixes

* Should fix https://github.com/mcaceresb/stata-gtools/issues/9
Added legacy plugin using older `libgomp.so` library.

## gtools-0.6.12 (2017-09-11)

### Bug fixes

* Should fix https://github.com/mcaceresb/stata-gtools/issues/12

## gtools-0.6.11 (2017-08-17)

### Bug fixes

* Fixed https://github.com/mcaceresb/stata-gtools/issues/8 so
`gegen` is callable via `by:`; it also gives the stat for the
overall group if called without a `by`.

## gtools-0.6.10 (2017-06-27)

### Bug fixes
Expand Down
Binary file modified build/env_set_unix.plugin
Binary file not shown.
Loading

0 comments on commit feff102

Please sign in to comment.