-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #658 from brk00/docs_corrections
Other docs added and corrections made to sphinxdocs
- Loading branch information
Showing
14 changed files
with
1,772 additions
and
188 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,214 @@ | ||
******************** | ||
Formal Specification | ||
******************** | ||
|
||
DataFrames Data Structures | ||
========================== | ||
|
||
* Type Definitions and Type Hierarchy | ||
* Constructors | ||
* Indexing (Refs / Assigns) | ||
* Operators | ||
|
||
* Unary Operators: | ||
|
||
* ``+``, ``-``, ``!``, ``'`` | ||
|
||
* Elementary Unary Functions | ||
|
||
* ``abs``, ... | ||
|
||
* Binary Operators: | ||
|
||
* Arithmetic Operators: | ||
|
||
* Scalar Arithmetic: ``+``, ``-``, ``*``, ``/``, | ||
* Array Arithmetic: ``+``, ``.+``, ``-``, ``.-``, ``.*``, ``./``, ``.^`` | ||
|
||
* Bit Operators: ``&``, ``|``, | ||
* Comparison Operators: | ||
|
||
* Scalar Comparisons: ``==``, ``!=``, ``<``, ``<=``, ``>``, | ||
* Array Comparisons: ``.==``, ``.!=``, ``.<``, ``.<=``, ``.>``, ``.>=`` | ||
|
||
* Container Operations | ||
* Broadcasting / Recycling | ||
* Type Promotion and Conversion | ||
* String Representations | ||
* IO | ||
* Copying | ||
* Properties | ||
|
||
* size | ||
* length | ||
* ndims | ||
* eltype | ||
|
||
* Predicates | ||
* Handling NA's | ||
* Iteration | ||
* Miscellaneous | ||
|
||
The NAtype | ||
========== | ||
|
||
Behavior under Unary Operators | ||
------------------------------ | ||
|
||
The unary operators | ||
|
||
Behavior under Unary Operators | ||
------------------------------ | ||
|
||
The unary operators | ||
|
||
Behavior under Arithmetic Operators | ||
----------------------------------- | ||
|
||
Constructors | ||
============ | ||
|
||
* NA's | ||
|
||
* Constructor: ``NAtype()`` | ||
* Const alias: ``NA`` | ||
|
||
* DataVector's | ||
|
||
* From (Vector, BitVector): ``DataArray([1, 2, 3], falses(3))`` | ||
* From (Vector, Vector{Bool}): ``DataArray([1, 2, 3], [false, false, false])`` | ||
* From (Vector): ``DataArray([1, 2, 3])`` | ||
* From (BitVector, BitVector): ``DataArray(trues(3), falses(3))`` | ||
* From (BitVector): ``DataArray(trues(3))`` | ||
* From (Range1): ``DataArray(1:3)`` | ||
* From (DataVector): ``DataArray(DataArray([1, 2, 3]))`` | ||
* From (Type, Int): ``DataArray(Int, 3)`` | ||
* From (Int): ``DataArray(3)`` (Type defaults to Float64) | ||
* From (): ``DataArray()`` (Type defaults to Float64, length defaults to 0) | ||
* Initialized with Float64 zeros: ``datazeros(3)`` | ||
* Initialized with typed zeros: ``datazeros(Int, 3)`` | ||
* Initialized with Float64 ones: ``dataones(3)`` | ||
* Initialized with typed ones: ``dataones(Int, 3)`` | ||
* Initialized with falses: ``datafalses(3)`` | ||
* Initialized with trues: ``datatrues(3)`` | ||
* Literal syntax: ``DataVector[1, 2, NA]`` | ||
|
||
* PooledDataVector's | ||
|
||
* From (Vector, BitVector): ``PooledDataArray([1, 2, 3], falses(3))`` | ||
* From (Vector, Vector{Bool}): ``PooledDataArray([1, 2, 3], [false, false, false])`` | ||
* From (Vector): ``PooledDataArray([1, 2, 3])`` | ||
* From (BitVector, BitVector): ``PooledDataArray(trues(3), falses(3))`` | ||
* From (BitVector, Vector{Bool}): ``PooledDataArray(trues(3), [false, false, false])`` | ||
* From (BitVector): ``PooledDataArray(trues(3))`` | ||
* From (Range1): ``PooledDataArray(1:3)`` | ||
* From (DataVector): ``PooledDataArray(DataArray([1, 2, 3]))`` | ||
* From (Type, Int): ``PooledDataArray(Int, 3)`` | ||
* From (Int): ``PooledDataArray(3)`` (Type defaults to Float64) | ||
* From (): ``PooledDataArray()`` (Type defaults to Float64, length defaults to 0) | ||
* Initialized with Float64 zeros: ``pdatazeros(3)`` | ||
* Initialized with typed zeros: ``pdatazeros(Int, 3)`` | ||
* Initialized with Float64 ones: ``pdataones(3)`` | ||
* Initialized with typed ones: ``pdataones(Int, 3)`` | ||
* Initialized with falses: ``pdatafalses(3)`` | ||
* Initialized with trues: ``pdatatrues(3)`` | ||
* Literal syntax: ``PooledDataVector[1, 2, NA]`` | ||
|
||
* DataMatrix | ||
|
||
* From (Array, BitArray): ``DataMatrix([1 2; 3 4], falses(2, 2))`` | ||
* From (Array, Array{Bool}): ``DataMatrix([1 2; 3 4], [false false; false false])`` | ||
* From (Array): ``DataMatrix([1 2; 3 4])`` | ||
* From (BitArray, BitArray): ``DataMatrix(trues(2, 2), falses(2, 2))`` | ||
* From (BitArray): ``DataMatrix(trues(2, 2))`` | ||
* From (DataVector...): ``DataMatrix(DataVector[1, NA], DataVector[NA, 2])`` | ||
* From (Range1...): ``DataMatrix(1:3, 1:3)`` | ||
* From (DataMatrix): ``DataMatrix(DataArray([1 2; 3 4]))`` | ||
* From (Type, Int, Int): ``DataMatrix(Int, 2, 2)`` | ||
* From (Int, Int): ``DataMatrix(2, 2)`` (Type defaults to Float64) | ||
* From (): ``DataMatrix()`` (Type defaults to Float64, length defaults to (0, 0)) | ||
* Initialized with Float64 zeros: ``dmzeros(2, 2)`` | ||
* Initialized with typed zeros: ``dmzeros(Int, 2, 2)`` | ||
* Initialized with Float64 ones: ``dmones(2, 2)`` | ||
* Initialized with typed ones: ``dmones(Int, 2, 2)`` | ||
* Initialized with falses: ``dmfalses(2, 2)`` | ||
* Initialized with trues: ``dmtrues(2, 2)`` | ||
* Initialized identity matrix: ``dmeye(2, 2)`` | ||
* Initialized identity matrix: ``dmeye(2)`` | ||
* Initialized diagonal matrix: ``dmdiagm([2, 1])`` | ||
* Literal syntax: ``DataMatrix[1 2; NA 2]`` | ||
|
||
* DataFrame | ||
|
||
* From (): ``DataFrame()`` | ||
* From (Vector{Any}, Index): ``DataFrame({datazeros(3), dataones(3)}, Index(["A", "B"]))`` | ||
* From (Vector{Any}): ``DataFrame({datazeros(3), dataones(3)})`` | ||
* From (Expr): ``DataFrame(quote A = [1, 2, 3, 4] end)`` | ||
* From (Matrix, Vector{String}): ``DataFrame([1 2; 3 4], ["A", "B"])`` | ||
* From (Matrix): ``DataFrame([1 2; 3 4])`` | ||
* From (Tuple): ``DataFrame(dataones(2), datafalses(2))`` | ||
* From (Associative): ??? | ||
* From (Vector, Vector, Groupings): ??? | ||
* From (Dict of Vectors): ``DataFrame({"A" => [1, 3], "B" => [2, 4]})`` | ||
* From (Dict of Vectors, Vector{String}): ``DataFrame({"A" => [1, 3], "B" => [2, 4]}, ["A"])`` | ||
* From (Type, Int, Int): ``DataFrame(Int, 2, 2)`` | ||
* From (Int, Int): ``DataFrame(2, 2)`` | ||
* From (Vector{Types}, Vector{String}, Int): ``DataFrame({Int, Float64}, ["A", "B"], 2)`` | ||
* From (Vector{Types}, Int): ``DataFrame({Int, Float64}, 2)`` | ||
|
||
Indexing | ||
======== | ||
|
||
Types on indices:: | ||
|
||
NA | ||
|
||
dv = datazeros(10) | ||
|
||
dv[1] | ||
|
||
dv[1:2] | ||
|
||
dv[:] | ||
|
||
dv[[1, 2 3]] | ||
|
||
dv[[false, false, true, false, false]] | ||
|
||
dmzeros(10) | ||
|
||
Indexers: Int, Range, Colon, Vector{Int}, Vector{Bool}, String, Vector{String} | ||
|
||
DataVector's and PooledDataVector's implement: | ||
|
||
* Int | ||
* Range | ||
* Colon | ||
* Vector{Int} | ||
* Vector{Bool} | ||
|
||
DataMatrix's implement the Cartesian product: | ||
|
||
* Int, Int | ||
* Int, Range | ||
* Int, Colon | ||
* Int, Vector{Int} | ||
* Int, Vector{Bool}... | ||
* Vector{Bool}, Int | ||
* Vector{Bool}, Range | ||
* Vector{Bool}, Colon | ||
* Vector{Bool}, Vector{Int} | ||
* Vector{Bool}, Vector{Bool} | ||
|
||
Single Int access? | ||
|
||
DataFrame's add two new indexer types: | ||
|
||
* String | ||
* Vector{String} | ||
|
||
These can only occur as (a) the only indexer or (b) in the second slot of a paired indexer | ||
|
||
Anything that can be getindex()'d can also be setindex!()'d | ||
|
||
Where do we allow Expr indexing? |
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
Oops, something went wrong.