We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb9bd43 commit a49af4bCopy full SHA for a49af4b
4 files changed
Project.toml
@@ -6,11 +6,9 @@ version = "0.3.3"
6
[deps]
7
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
8
CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193"
9
-Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
10
DataAPI = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
11
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
12
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
13
-MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
14
Missings = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28"
15
PooledArrays = "2dfb63ee-cc39-5dd5-95bd-886bf059d720"
16
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
@@ -25,10 +23,8 @@ Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
25
23
[compat]
26
24
CSV = "0.8"
27
CodecZlib = "0.7"
28
-Combinatorics = "1"
29
DataAPI = "1.6"
30
DataFrames = "1"
31
-MacroTools = "0.5"
32
Missings = "0.4, 1"
33
PooledArrays = "1.2"
34
PrettyTables = "1"
src/DiffinDiffsBase.jl
@@ -3,12 +3,10 @@ module DiffinDiffsBase
3
using Base: @propagate_inbounds
4
using CSV
5
using CodecZlib: GzipDecompressorStream
-using Combinatorics: combinations
using DataAPI
using DataAPI: refarray, refpool, invrefpool
using Dates: Period, TimeType
using LinearAlgebra: Diagonal
-using MacroTools: @capture, isexpr, postwalk
using Missings: allowmissing, disallowmissing
using PooledArrays: _label
using PrettyTables: pretty_table
@@ -24,7 +22,7 @@ using Tables
22
using Tables: AbstractColumns, istable, columnnames, getcolumn
import Base: ==, +, -, *, isless, show, parent, view, diff
-import Base: eltype, firstindex, lastindex, getindex, iterate, length, sym_in
+import Base: eltype, firstindex, lastindex, getindex, iterate, length
import Missings: allowmissing, disallowmissing
import StatsBase: coef, vcov, confint, nobs, dof_residual, responsename, coefnames, weights,
coeftable
src/ScaledArrays.jl
@@ -89,8 +89,7 @@ end
89
90
function _scaledlabel!(labels::AbstractArray, invpool::Dict, xs::AbstractArray, start, step)
91
z = zero(valtype(invpool))
92
- @inbounds for i in eachindex(labels)
93
- x = xs[i]
+ @inbounds for (i, x) in zip(eachindex(labels), xs)
94
lbl = get(invpool, x, z)
95
if lbl !== z
96
labels[i] = lbl
@@ -118,7 +117,8 @@ function scaledlabel(xs::AbstractArray, stepsize,
118
117
R = widen(R)
119
end
120
121
- labels = similar(xs, R)
+ # Array types with customized indexing could cause problems
+ labels = similar(Array{R}, axes(xs))
122
invpool = Dict{T,R}()
123
_scaledlabel!(labels, invpool, xs, start, stepsize)
124
return labels, pool, invpool
src/did.jl
@@ -156,8 +156,9 @@ macro did(args...)
156
noproceed = false
157
didargs = ()
158
if nargs > 0
159
- if isexpr(args[1], :vect, :hcat, :vcat)
160
- noproceed = _parse!(options, args[1].args)
+ op = args[1]
+ if op isa Expr && op.head in (:vect, :hcat, :vcat)
161
+ noproceed = _parse!(options, op.args)
162
nargs > 1 && (didargs = args[2:end])
163
else
164
didargs = args
0 commit comments