Skip to content

Commit

Permalink
Merge pull request #17 from aaowens/verup
Browse files Browse the repository at this point in the history
Up DataFrames, add Parsers
  • Loading branch information
aaowens authored Feb 7, 2020
2 parents 17a630a + 4b49996 commit 4d6e26c
Show file tree
Hide file tree
Showing 7 changed files with 137 additions and 70 deletions.
107 changes: 46 additions & 61 deletions Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ git-tree-sha1 = "6621d9645702c1c4e6970cc6a3eae440c768000b"
uuid = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
version = "0.2.1"

[[ArrayLayouts]]
deps = ["FillArrays", "LinearAlgebra"]
git-tree-sha1 = "46de2a06a20e59ccd6362c040765fa62893f6451"
uuid = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
version = "0.1.3"

[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

Expand All @@ -22,22 +16,22 @@ uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
version = "0.5.8"

[[CSV]]
deps = ["CategoricalArrays", "DataFrames", "Dates", "FilePathsBase", "LazyArrays", "Mmap", "Parsers", "PooledArrays", "Profile", "Tables", "Unicode", "WeakRefStrings"]
git-tree-sha1 = "6b3dcd52e5a86e6c6c00777b9a9c7c5b5cc4a588"
deps = ["CategoricalArrays", "DataFrames", "Dates", "FilePathsBase", "Mmap", "Parsers", "PooledArrays", "Tables", "Unicode", "WeakRefStrings"]
git-tree-sha1 = "fe9b828d5e7b55431d75d6d180ef843d69dea048"
uuid = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
version = "0.5.17"
version = "0.5.23"

[[CategoricalArrays]]
deps = ["Compat", "DataAPI", "Future", "JSON", "Missings", "Printf", "Reexport", "Unicode"]
git-tree-sha1 = "2473560b9c7cb18f98c3c926af0dc7bedccfc7ab"
deps = ["Compat", "DataAPI", "Future", "JSON", "Missings", "Printf", "Reexport", "Statistics", "Unicode"]
git-tree-sha1 = "23d7324164c89638c18f6d7f90d972fa9c4fa9fb"
uuid = "324d7699-5711-5eae-9e2f-1d82baa6b597"
version = "0.7.2"
version = "0.7.7"

[[Compat]]
deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"]
git-tree-sha1 = "ed2c4abadf84c53d9e58510b5fc48912c2336fbb"
git-tree-sha1 = "06be57f11a029927e10d050a6c5496a8695a5437"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "2.2.0"
version = "3.3.0"

[[DataAPI]]
git-tree-sha1 = "674b67f344687a88310213ddfa8a2b3c76cc4252"
Expand All @@ -51,10 +45,10 @@ uuid = "124859b0-ceae-595e-8997-d05f6a7a8dfe"
version = "0.7.1"

[[DataFrames]]
deps = ["CategoricalArrays", "Compat", "DataAPI", "InvertedIndices", "IteratorInterfaceExtensions", "Missings", "PooledArrays", "Printf", "REPL", "Reexport", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"]
git-tree-sha1 = "271528230c65a4517522e2968c3deed76b92b998"
deps = ["CategoricalArrays", "Compat", "DataAPI", "Future", "InvertedIndices", "IteratorInterfaceExtensions", "Missings", "PooledArrays", "Printf", "REPL", "Reexport", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"]
git-tree-sha1 = "00136fcd39d503e66ab1b2eab800c47deaf7ca04"
uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
version = "0.19.4"
version = "0.20.0"

[[DataFramesMeta]]
deps = ["DataFrames", "Tables"]
Expand All @@ -64,9 +58,9 @@ version = "0.5.0"

[[DataStructures]]
deps = ["InteractiveUtils", "OrderedCollections"]
git-tree-sha1 = "1fe8fad5fc84686dcbc674aa255bc867a64f8132"
git-tree-sha1 = "b7720de347734f4716d1815b00ce5664ed6bbfd4"
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
version = "0.17.5"
version = "0.17.9"

[[DataValueInterfaces]]
git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6"
Expand All @@ -86,23 +80,17 @@ deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"

[[EzXML]]
deps = ["BinaryProvider", "Libdl", "Printf"]
git-tree-sha1 = "aed48d722e528bc634bd36a7d0e090fa2952a3c0"
deps = ["Printf", "XML2_jll"]
git-tree-sha1 = "0fa3b52a04a4e210aeb1626def9c90df3ae65268"
uuid = "8f5d6c58-4d21-5cfd-889c-e3ad7ee6a615"
version = "0.9.4"
version = "1.1.0"

[[FilePathsBase]]
deps = ["Dates", "LinearAlgebra", "Printf", "Test", "UUIDs"]
git-tree-sha1 = "2cd6e2e7965934f72cb80251f760228e2264bab3"
uuid = "48062228-2e41-5def-b9a4-89aafe57970f"
version = "0.7.0"

[[FillArrays]]
deps = ["LinearAlgebra", "Random", "SparseArrays"]
git-tree-sha1 = "b2cf74f09216cfe3c241e8484178ec0ea941870f"
uuid = "1a297f60-69ca-5386-bcde-b61e274b549b"
version = "0.8.1"

[[Future]]
deps = ["Random"]
uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820"
Expand Down Expand Up @@ -152,18 +140,18 @@ git-tree-sha1 = "b8fc7784ea3f7be5983c8ddc550fd0ecbb23c769"
uuid = "b9914132-a727-11e9-1322-f18e41205b0b"
version = "0.1.3"

[[LazyArrays]]
deps = ["ArrayLayouts", "FillArrays", "LinearAlgebra", "MacroTools", "StaticArrays"]
git-tree-sha1 = "860e3d45aaef4f7f60b77b1e5b6f9f24e590b985"
uuid = "5078a376-72f3-5289-bfd5-ec5146d43c02"
version = "0.14.6"

[[LibGit2]]
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"

[[Libdl]]
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"

[[Libiconv_jll]]
deps = ["Libdl", "Pkg"]
git-tree-sha1 = "802f5b23c846cb4ed568cae0bfb0ce0d2ba1926d"
uuid = "94ce4f54-9a6c-5748-9c1c-f9c7231a4531"
version = "1.16.0+1"

[[LightXML]]
deps = ["BinaryProvider", "Libdl"]
git-tree-sha1 = "be855e3c975b89746b09952407c156b5e4a33a1d"
Expand All @@ -177,12 +165,6 @@ uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
[[Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"

[[MacroTools]]
deps = ["Compat", "DataStructures", "Test"]
git-tree-sha1 = "82921f0e3bde6aebb8e524efc20f4042373c0c06"
uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
version = "0.5.2"

[[Markdown]]
deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
Expand Down Expand Up @@ -210,27 +192,24 @@ version = "1.1.0"

[[Parsers]]
deps = ["Dates", "Test"]
git-tree-sha1 = "c56ecb484f286639f161e712b8311f5ab77e8d32"
git-tree-sha1 = "d112c19ccca00924d5d3a38b11ae2b4b268dda39"
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
version = "0.3.8"
version = "0.3.11"

[[Pkg]]
deps = ["Dates", "LibGit2", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"]
deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Test", "UUIDs"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

[[PooledArrays]]
git-tree-sha1 = "6e8c38927cb6e9ae144f7277c753714861b27d14"
deps = ["DataAPI"]
git-tree-sha1 = "b1333d4eced1826e15adbdf01a4ecaccca9d353c"
uuid = "2dfb63ee-cc39-5dd5-95bd-886bf059d720"
version = "0.5.2"
version = "0.5.3"

[[Printf]]
deps = ["Unicode"]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"

[[Profile]]
deps = ["Printf"]
uuid = "9abbd945-dff8-562f-b5e8-e1ebf5ef1b79"

[[REPL]]
deps = ["InteractiveUtils", "Markdown", "Sockets"]
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
Expand Down Expand Up @@ -268,12 +247,6 @@ version = "0.3.1"
deps = ["LinearAlgebra", "Random"]
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[[StaticArrays]]
deps = ["LinearAlgebra", "Random", "Statistics"]
git-tree-sha1 = "5a3bcb6233adabde68ebc97be66e95dcb787424c"
uuid = "90137ffa-7385-5640-81b9-e52037218182"
version = "0.12.1"

[[Statistics]]
deps = ["LinearAlgebra", "SparseArrays"]
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Expand Down Expand Up @@ -302,19 +275,31 @@ uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"

[[WeakRefStrings]]
deps = ["Random", "Test"]
git-tree-sha1 = "9a0bb82eede528debe631b642eeb48a631a69bc2"
deps = ["DataAPI", "Random", "Test"]
git-tree-sha1 = "28807f85197eaad3cbd2330386fac1dcb9e7e11d"
uuid = "ea10d353-3f73-51f8-a26c-33c1cb351aa5"
version = "0.6.1"
version = "0.6.2"

[[XLSX]]
deps = ["Dates", "EzXML", "Printf", "ZipFile"]
git-tree-sha1 = "dcf4dfd0fd01dee9b8cbf70e9fd869a17f34032c"
uuid = "fdbf4ff8-1666-58a4-91e7-1b58723a45e0"
version = "0.5.8"

[[XML2_jll]]
deps = ["Libdl", "Libiconv_jll", "Pkg", "Zlib_jll"]
git-tree-sha1 = "ed5603a695aefe3e9e404fc7b052e02cc72cfab6"
uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a"
version = "2.9.9+1"

[[ZipFile]]
deps = ["BinaryProvider", "Libdl", "Printf"]
git-tree-sha1 = "580ce62b6c14244916cc28ad54f8a2e2886f843d"
deps = ["Libdl", "Printf", "Zlib_jll"]
git-tree-sha1 = "8748302cfdec02c4ae9c97b112cf10003f7f767f"
uuid = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea"
version = "0.8.3"
version = "0.9.1"

[[Zlib_jll]]
deps = ["Libdl", "Pkg"]
git-tree-sha1 = "fd36a6739e256527287c5444960d0266712cd49e"
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
version = "1.2.11+8"
5 changes: 3 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@ DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
JSONTables = "b9914132-a727-11e9-1322-f18e41205b0b"
LightXML = "9c8b4983-aa76-5018-a973-4c85ecc9e179"
Parsers = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
XLSX = "fdbf4ff8-1666-58a4-91e7-1b58723a45e0"

[compat]
julia = "1.1"
AbstractTrees = "0.2.1"
CSV = "0.5.16"
DataDeps = "0.7.0"
DataFrames = "0.19.4"
DataFrames = "0.20.0"
DataFramesMeta = "0.5.0"
DataStructures = "0.17.5"
JSON3 = "= 0.1.12"
JSONTables = "0.1.3"
LightXML = "0.8.1"
XLSX = "0.5.8"
julia = "1.1"
2 changes: 1 addition & 1 deletion src/PSID.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module PSID
using XLSX, DataDeps, DataFrames, CSV, LightXML, AbstractTrees, JSONTables, JSON3
using DataFramesMeta, SHA, DataStructures
using DataFramesMeta, SHA, DataStructures, Parsers

include("types.jl")
include("init.jl")
Expand Down
6 changes: 2 additions & 4 deletions src/process_codebook.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ function process_codebook()

list_codes[1]

```
Take a codexml vector of some length containing (value, text) pairs
Return a dict
```
# Take a codexml vector of some length containing (value, text) pairs
# Return a dict
function process_codes(codexml)
codes = codexml["CODE"]
vals = [content(c["VALUE"][1]) for c in codes]
Expand Down
2 changes: 1 addition & 1 deletion src/unzip_data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function read_fixedwidth(data, toks)
for j in eachindex(toks)
tok = toks[j]
r = tok[2]
dat[i, j] = parse(Float64, line[r])
dat[i, j] = Parsers.parse(Float64, line[r])
end
end
DataFrame(dat, Symbol.(names))
Expand Down
83 changes: 83 additions & 0 deletions test/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,101 @@
[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[BinaryProvider]]
deps = ["Libdl", "SHA"]
git-tree-sha1 = "5b08ed6036d9d3f0ee6369410b830f8873d4024c"
uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
version = "0.5.8"

[[DataDeps]]
deps = ["HTTP", "Reexport", "SHA"]
git-tree-sha1 = "795b99df0963831ddeefbe9ac05721ffd9475c04"
uuid = "124859b0-ceae-595e-8997-d05f6a7a8dfe"
version = "0.7.1"

[[Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"

[[Distributed]]
deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"

[[HTTP]]
deps = ["Base64", "Dates", "IniFile", "MbedTLS", "Sockets"]
git-tree-sha1 = "5c49dab19938b119fe204fd7d7e8e174f4e9c68b"
uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3"
version = "0.8.8"

[[IniFile]]
deps = ["Test"]
git-tree-sha1 = "098e4d2c533924c921f9f9847274f2ad89e018b8"
uuid = "83e8ac13-25f8-5344-8a64-a9f2b223428f"
version = "0.5.0"

[[InteractiveUtils]]
deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"

[[JSON3]]
deps = ["Mmap", "Parsers", "Test"]
git-tree-sha1 = "f9ae511abe2295a22f8192259210bd23d17e633a"
uuid = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
version = "0.1.12"

[[LibGit2]]
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"

[[Libdl]]
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"

[[Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"

[[Markdown]]
deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"

[[MbedTLS]]
deps = ["BinaryProvider", "Dates", "Libdl", "Random", "Sockets"]
git-tree-sha1 = "85f5947b53c8cfd53ccfa3f4abae31faa22c2181"
uuid = "739be429-bea8-5141-9913-cc70e7f3736d"
version = "0.7.0"

[[Mmap]]
uuid = "a63ad114-7e13-5084-954f-fe012c677804"

[[Parsers]]
deps = ["Dates", "Test"]
git-tree-sha1 = "d112c19ccca00924d5d3a38b11ae2b4b268dda39"
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
version = "0.3.11"

[[Pkg]]
deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Test", "UUIDs"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

[[Printf]]
deps = ["Unicode"]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"

[[REPL]]
deps = ["InteractiveUtils", "Markdown", "Sockets"]
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"

[[Random]]
deps = ["Serialization"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[[Reexport]]
deps = ["Pkg"]
git-tree-sha1 = "7b1d07f411bc8ddb7977ec7f377b97b158514fe0"
uuid = "189a3867-3050-52da-a836-e630ba90ab69"
version = "0.2.0"

[[SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"

[[Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"

Expand All @@ -31,3 +107,10 @@ uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
[[Test]]
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[[UUIDs]]
deps = ["Random", "SHA"]
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[[Unicode]]
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
2 changes: 1 addition & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[deps]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
DataDeps = "124859b0-ceae-595e-8997-d05f6a7a8dfe"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
DataDeps = "0.7.0"
Expand Down

0 comments on commit 4d6e26c

Please sign in to comment.