Skip to content
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

RFC: Added ref type parameter, compact to PooledDataFrame #242

Closed
wants to merge 5 commits into from

Conversation

kmsquire
Copy link
Contributor

@kmsquire kmsquire commented Apr 9, 2013

[Copied from https://github.com//pull/227; see there for additional comments/discussion. That pull was from my repository, and this one is from the DataFrames.jl repo, which makes it easier for others to test.]

  • Allows the user to specify the reference type for PooledDataArrays
    (default is still Uint16)
  • Added compact to take an existing PooledDataArray and change the
    reference type to the smallest size possible. Returns the same
    PooledDataArray if nothing has changed, and a new one if the size
    is reduced

The current PooledDataArray tests pass.

Example (from #241 (comment))

julia> using DataFrames

julia> a = PooledDataArray([1,1,2,2])
4-element Int64 PooledDataArray:
 1
 1
 2
 2

julia> a.refs
4-element Uint16 Array:
 0x0001
 0x0001
 0x0002
 0x0002

julia> b = compact(a)
4-element Int64 PooledDataArray:
 1
 1
 2
 2

julia> b.refs
4-element Uint8 Array:
 0x01
 0x01
 0x02
 0x02

julia> c = PooledDataArray([1,1,2,2], Uint8)
4-element Int64 PooledDataArray:
 1
 1
 2
 2

julia> c.refs
4-element Uint8 Array:
 0x01
 0x01
 0x02
 0x02

julia> c = PooledDataArray([1,1,2,2], Int8)
4-element Int64 PooledDataArray:
 1
 1
 2
 2

julia> c.refs
4-element Int8 Array:
 1
 1
 2
 2

kmsquire and others added 5 commits April 30, 2013 15:59
* Allows the user to specify the reference type for PooledDataArrays
  (default is still Uint16)
* Added `compact` to take an existing PooledDataArray and change the
  reference type to the smallest size possible.  Returns the same
  PooledDataArray if nothing has changed, and a new one if the size
  is reduced
* Added RefType to distinguish refs arrays from normal arrays during PooledDataArray construction
* Added push!, pop!, shift!, unshift!
* For ref types of bit size 8 or 16, add overflow check
@kmsquire
Copy link
Contributor Author

This was already applied, but maybe got accidentally pulled along in the move from Harlan's repository. Closing...

@kmsquire kmsquire closed this Dec 18, 2013
@kmsquire kmsquire deleted the pooled_ref_parameterization branch December 18, 2013 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants