Skip to content

Commit

Permalink
Merge pull request #68 from mrkn/daru-version
Browse files Browse the repository at this point in the history
Update the dependent daru version
  • Loading branch information
athityakumar authored Dec 12, 2017
2 parents 8c52744 + 2d813e3 commit c063118
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 58 deletions.
2 changes: 1 addition & 1 deletion daru-io.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.require_paths = ['lib']

spec.add_development_dependency 'daru', '~> 0.1.5'
spec.add_development_dependency 'daru', '~> 0.2.0'

spec.add_development_dependency 'bundler', '~> 1.15'
spec.add_development_dependency 'rake', '~> 10.0'
Expand Down
4 changes: 2 additions & 2 deletions spec/daru/io/importers/csv_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
it_behaves_like 'exact daru dataframe',
ncols: 3,
nrows: 99,
order: %i[image_resolution mls true_transform],
order: %i[image_resolution true_transform mls],
:'image_resolution.first' => 6.55779,
:'true_transform.first' => '-0.2362347,0.6308649,0.7390552,0,0.6523478'\
',-0.4607318,0.6018043,0,0.7201635,0.6242881'\
Expand Down Expand Up @@ -91,7 +91,7 @@
it_behaves_like 'exact daru dataframe',
ncols: 8,
nrows: 9,
order: %i[account manager name price product quantity rep status]
order: %i[account name rep manager product quantity price status]
end

context 'skips rows from CSV files without headers option' do
Expand Down
16 changes: 9 additions & 7 deletions spec/daru/io/importers/r_data_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
nrows: 1629,
index: (0..1628).to_a,
order: %i[
Abbreviation FIPS Non.US State cnty females.divorced females.married ind-agric
ind-arts ind-construc ind-educational ind-finance ind-information ind-manufact
ind-other.industry ind-public.admin ind-retail ind-scientific ind-transport
ind-wholesale males.diorced males.married median.earnings perc.HS+ perc.disability
perc.no.health.insurance race-am.ind race-asian race-black race-white
State Abbreviation FIPS
males.married males.diorced females.married females.divorced
perc.HS+ Non.US perc.disability
race-white race-black race-am.ind race-asian
ind-agric ind-construc ind-manufact ind-wholesale ind-retail ind-transport ind-information
ind-finance ind-scientific ind-educational ind-arts ind-other.industry ind-public.admin
median.earnings perc.no.health.insurance cnty
]
end

Expand All @@ -29,7 +31,7 @@
nrows: 1755,
index: (0..1754).to_a,
order: %i[
Business.Filings Non.Business.Filings State.Code Total.Filings year
State.Code Total.Filings Business.Filings Non.Business.Filings year
]
end

Expand All @@ -42,7 +44,7 @@
nrows: 1632,
index: (0..1631).to_a,
order: %i[
Date State own.rate se
State Date own.rate se
]
end

Expand Down
93 changes: 55 additions & 38 deletions spec/daru/io/importers/rds_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
nrows: 1113,
index: (0..1112).to_a,
order: %i[
area description epa_reach format_version latitude location location_code location_type
longitude name psc_basin psc_region record_code record_origin region reporting_agency
rmis_basin rmis_latitude rmis_longitude rmis_region sector state_or_province sub_location
submission_date water_type
state_or_province water_type sector region area location sub_location
record_code format_version submission_date reporting_agency
location_code location_type name latitude longitude psc_basin
psc_region epa_reach description rmis_region rmis_basin rmis_latitude
rmis_longitude record_origin
]
end

Expand All @@ -24,7 +25,7 @@
nrows: 6940,
index: (0..6939).to_a,
order: %i[
city date dptp no2tmean2 o3tmean2 pm10tmean2 pm25tmean2 tmpd
city tmpd dptp date pm25tmean2 pm10tmean2 o3tmean2 no2tmean2
]
end

Expand All @@ -36,7 +37,7 @@
nrows: 3030,
index: (0..3029).to_a,
order: %i[
Country Health.Expenditure Life.Expectancy Population Region Year
Country Region Year Population Life.Expectancy Health.Expenditure
]
end

Expand All @@ -48,7 +49,7 @@
nrows: 3988,
index: (0..3987).to_a,
order: %i[
asvab bdate education height id income race sat_math sex weight
id income height weight sex race education asvab sat_math bdate
]
end

Expand All @@ -60,9 +61,13 @@
nrows: 750,
index: (0..749).to_a,
order: %i[
MxNum VisitNum airCanF airFelD airmus airnic coarse duBdRmBlaG duBdRmCanF duBdRmDerF duBdRmFelD
duBdRmMusM duBdRmWeight duBedBlaG duBedCanF duBedDerF duBedFelD duBedMusM duBedWeight duKitchBlaG
duKitchCanF duKitchDerF duKitchFelD duKitchMusM duKitchWeight no2 pm25
MxNum VisitNum pm25 no2 airnic coarse
duBedWeight duBdRmWeight duKitchWeight
duBedBlaG duBdRmBlaG duKitchBlaG
duBedMusM duBdRmMusM duKitchMusM airmus
duBedFelD duBdRmFelD duKitchFelD airFelD
duBedCanF duBdRmCanF duKitchCanF airCanF
duBedDerF duBdRmDerF duKitchDerF
]
end

Expand All @@ -74,34 +79,46 @@
nrows: 168,
index: (0..167).to_a,
order: %i[
1st.author.O 1st.author.R 80.power 90.power 95.power Actual.Power.O Analysis.completion.date.R
Area.of.expertise.R Authors.O Calculated.P.value.O Citation.Count.1st.author.O
Citation.count.1st.author.R Citation.count.paper.O Citation.count.senior.author.O
Citation.count.senior.author.R Citations.R Coder.s.email.R Collect.materials.from.authors
Completion.R Contact.Researcher.R Current.position.R Data.collection.quality.R Degree.R
Description.of.effect.O Descriptors.O Differences.R Difficulty.of.implimentation.R Direction.R
Discipline.O Domain.expertise.R Dummy Effect.Size.R Effect.similarity.R Effect.size.O
Exciting.result.O Feasibility.O Findings.similarity.R Implementation.quality.R
Institution.1st.author.O Institution.1st.author.R Institution.prestige.1st.author.O
Institution.prestige.1st.author.R Institution.prestige.senior.author.O
Institution.prestige.senior.author.R Institution.senior.author.O Institution.senior.author.R
Internal.conceptual.replications.O Internal.direct.replications.O Issue.O Journal.O Local.ID
Meta.analysis.significant Meta.analytic.estimate.Fz Method.expertise.R
Methodology.expertise.required.O N.O N.R Notes.R Number.of.Authors.O Number.of.Authors.R
Number.of.Research.sites.R Number.of.Studies.O Number.of.research.sites.O O.within.CI.R
OSC.reviewer.O OSC.reviewer.R Opportunity.for.expectancy.bias.O Opportunity.for.lack.of.diligence.O
Original.Author.s.Assessment P.value.R Pages.O Peer.reviewed.articles.R Planned.Power
Planned.Sample Power.R Project.URL Project.audit.complete.R R.check.location.R Replicate.R
Replicated.study.number.R Replication.similarity.R Reported.P.value.O Secondary.R Secondary.data.O
Secondary.data.R Senior.author.O Senior.author.R Status.R Study.Title.O Study.claim.date.R
Successful.conceptual.replications.O Successful.direct.replications.O Surprise.of.outcome.R
Surprising.result.O T.Comparison.effects.R.O T.N.O T.N.O.for.tables T.N.R T.N.R.for.tables
T.O.larger T.Test.Comparison.R T.Test.Statistic.O T.Test.Statistic.R T.Test.value.O T.Test.value.R
T.TestComparison.O T.df1.O T.df1.R T.df2.O T.df2.R T.p.comparison.O T.p.comparison.R T.pval.O
T.pval.R T.pval.USE.O T.pval.USE.R T.pval.recalc.O T.pval.recalc.R T.r.O T.r.R T.sign.O.113
T.sign.O.131 T.sign.R.125 T.sign.R.132 Tails.O Tails.R Test.statistic.O Test.statistic.R
Total.publications.R Type.of.analysis.O.128 Type.of.analysis.O.56 Type.of.analysis.R.129
Type.of.analysis.R.74 Type.of.effect.O Type.of.effect.R V130 Volume.O Year.of.highest.degree.R
Local.ID Study.Title.O Authors.O Journal.O Volume.O Issue.O Pages.O
Project.URL Descriptors.O Number.of.Authors.O Number.of.Authors.R
1st.author.O Citation.Count.1st.author.O Institution.1st.author.O
Senior.author.O Citation.count.senior.author.O
Institution.senior.author.O 1st.author.R Citation.count.1st.author.R
Institution.1st.author.R Senior.author.R Citation.count.senior.author.R
Institution.senior.author.R Citation.count.paper.O
Institution.prestige.1st.author.O Institution.prestige.senior.author.O
Institution.prestige.1st.author.R Institution.prestige.senior.author.R
Number.of.Studies.O Discipline.O Number.of.research.sites.O
Secondary.data.O Methodology.expertise.required.O
Opportunity.for.expectancy.bias.O Opportunity.for.lack.of.diligence.O
Surprising.result.O Exciting.result.O
Internal.conceptual.replications.O Successful.conceptual.replications.O
Internal.direct.replications.O Successful.direct.replications.O
Feasibility.O Status.R Completion.R Secondary.R Contact.Researcher.R
Study.claim.date.R Analysis.completion.date.R Coder.s.email.R
Replicated.study.number.R Test.statistic.O N.O Reported.P.value.O
Calculated.P.value.O Tails.O Type.of.analysis.O.56 Type.of.effect.O
Description.of.effect.O Effect.size.O Actual.Power.O 80.power 90.power
95.power Collect.materials.from.authors Planned.Sample Planned.Power
Original.Author.s.Assessment OSC.reviewer.O Test.statistic.R N.R
P.value.R Direction.R Tails.R Type.of.analysis.R.74 Type.of.effect.R
Replicate.R Power.R Effect.Size.R OSC.reviewer.R Notes.R
Project.audit.complete.R R.check.location.R Degree.R
Year.of.highest.degree.R Current.position.R Domain.expertise.R
Method.expertise.R Total.publications.R Peer.reviewed.articles.R
Citations.R Implementation.quality.R Data.collection.quality.R
Replication.similarity.R Differences.R Effect.similarity.R
Findings.similarity.R Difficulty.of.implimentation.R
Surprise.of.outcome.R Dummy Number.of.Research.sites.R
Secondary.data.R Area.of.expertise.R T.N.O T.Test.Statistic.O
T.TestComparison.O T.df1.O T.df2.O T.Test.value.O T.p.comparison.O
T.pval.O T.pval.recalc.O T.pval.USE.O T.sign.O.113 T.r.O T.N.R
T.Test.Statistic.R T.Test.Comparison.R T.df1.R T.df2.R T.Test.value.R
T.p.comparison.R T.pval.R T.pval.recalc.R T.pval.USE.R T.sign.R.125
T.r.R T.Comparison.effects.R.O Type.of.analysis.O.128
Type.of.analysis.R.129 V130 T.sign.O.131 T.sign.R.132 T.O.larger
T.N.O.for.tables T.N.R.for.tables Meta.analytic.estimate.Fz
O.within.CI.R Meta.analysis.significant
]
end
end
20 changes: 10 additions & 10 deletions spec/daru/io/importers/sql_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
it_behaves_like 'exact daru dataframe',
ncols: 3,
nrows: 2,
order: %i[age id name],
data: [[20, 30],[1,2],%w[Homer Marge]]
order: %i[id name age],
data: [[1,2],%w[Homer Marge],[20, 30]]
end

context 'with a database connection of ActiveRecord' do
Expand All @@ -28,8 +28,8 @@
it_behaves_like 'exact daru dataframe',
ncols: 3,
nrows: 2,
order: %i[age id name],
data: [[20, 30],[1,2],%w[Homer Marge]]
order: %i[id name age],
data: [[1,2],%w[Homer Marge],[20, 30]]
end

before { ActiveRecord::Base.establish_connection("sqlite3:#{db_name}") }
Expand All @@ -40,16 +40,16 @@
it_behaves_like 'exact daru dataframe',
ncols: 3,
nrows: 2,
order: %i[age id name],
data: [[20, 30],[1,2],%w[Homer Marge]]
order: %i[id name age],
data: [[1,2],%w[Homer Marge],[20, 30]]
end

context 'with ActiveRecord::Connection' do
it_behaves_like 'exact daru dataframe',
ncols: 3,
nrows: 2,
order: %i[age id name],
data: [[20, 30],[1,2],%w[Homer Marge]]
order: %i[id name age],
data: [[1,2],%w[Homer Marge],[20, 30]]
end

context 'with path to sqlite3 file' do
Expand All @@ -60,8 +60,8 @@
it_behaves_like 'exact daru dataframe',
ncols: 3,
nrows: 2,
order: %i[age id name],
data: [[20, 30],[1,2],%w[Homer Marge]]
order: %i[id name age],
data: [[1,2],%w[Homer Marge],[20, 30]]
end

context 'raises error for invalid arguments' do # rubocop:disable RSpec/EmptyExampleGroup
Expand Down

0 comments on commit c063118

Please sign in to comment.