Skip to content

Commit 2f99002

Browse files
committed
format
1 parent bbf1778 commit 2f99002

10 files changed

Lines changed: 36 additions & 37 deletions

File tree

src/Common.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ end
142142
##==============================================================================
143143
## Validation of session, robot, and user labels.
144144
##==============================================================================
145-
global _invalidIds =
146-
["GRAPH", "AGENT", "VARIABLE", "FACTOR", "BLOB_ENTRY", "FACTORGRAPH"]
145+
global _invalidIds = ["GRAPH", "AGENT", "VARIABLE", "FACTOR", "BLOB_ENTRY", "FACTORGRAPH"]
147146

148147
const global _validLabelRegex::Regex = r"^[a-zA-Z][-\w\.\@]*$"
149148

src/DataBlobs/entities/BlobEntry.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,3 @@ function StructUtils.makedict(s::StructUtils.StructStyle, T::Type{Blobentries},
141141
end
142142
return entries, nothing
143143
end
144-

src/DataBlobs/services/BlobEntry.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ Should be extended if DFG variable is not returned by reference.
131131
Also see: [`getBlobentry`](@ref), [`addBlob!`](@ref), [`mergeBlobentry!`](@ref)
132132
"""
133133
function addBlobentry!(var::VariableCompute, entry::Blobentry)
134-
haskey(var.blobentries, entry.label) && throw(LabelExistsError("Blobentry", entry.label))
134+
haskey(var.blobentries, entry.label) &&
135+
throw(LabelExistsError("Blobentry", entry.label))
135136
var.blobentries[entry.label] = entry
136137
return entry
137138
end

src/FileDFG/services/FileDFG.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,9 @@ function loadDFG(file::AbstractString)
232232
catch e
233233
if e isa MethodError
234234
@warn "Deprecated serialization: Failed to read DFG metadata. Attempting to load using the old format. Error:" e
235-
fgPacked =
236-
GraphsDFGs.PackedGraphsDFG(JSON.parse(jstr, GraphsDFGs._OldPackedGraphsDFG; style = DFGJSONStyle()))
235+
fgPacked = GraphsDFGs.PackedGraphsDFG(
236+
JSON.parse(jstr, GraphsDFGs._OldPackedGraphsDFG; style = DFGJSONStyle()),
237+
)
237238
else
238239
rethrow(e)
239240
end

src/entities/DFGFactor.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ function FactorDFG(
162162
state::FactorState = FactorState(),
163163
cache = nothing;
164164
tags::Set{Symbol} = Set{Symbol}([:FACTOR]),
165-
timestamp::Union{DateTime, ZonedDateTime, TimeDateZone} = TimeDateZone(now(localzone())),
165+
timestamp::Union{DateTime, ZonedDateTime, TimeDateZone} = TimeDateZone(
166+
now(localzone()),
167+
),
166168
solvable::Int = 1,
167169
bloblets::Bloblets = Bloblets(),
168170
blobentries::Blobentries = Blobentries(),

src/entities/DFGVariable.jl

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ StructUtils.lift(::Type{<:State}, obj) = DFG.unpackState(obj)
9595

9696
##------------------------------------------------------------------------------
9797
## States - OrderedDict{Symbol, State}
98-
const States = OrderedDict{Symbol, State{T, P, N}} where {T<:AbstractStateType,P,N}
98+
const States = OrderedDict{Symbol, State{T, P, N}} where {T <: AbstractStateType, P, N}
9999

100100
StructUtils.dictlike(::Type{<:States}) = false
101101
StructUtils.structlike(::Type{<:States}) = false
@@ -107,7 +107,11 @@ function StructUtils.lower(states::States)
107107
end
108108
end
109109

110-
function StructUtils.lift(::StructUtils.StructStyle, S::Type{<:States{T}}, json_vector) where T
110+
function StructUtils.lift(
111+
::StructUtils.StructStyle,
112+
S::Type{<:States{T}},
113+
json_vector,
114+
) where {T}
111115
states = S()
112116
foreach(json_vector) do obj
113117
return push!(states, Symbol(obj.label) => StructUtils.make(State{T}, obj))
@@ -170,7 +174,10 @@ version(::Type{<:VariableDFG}) = v"0.29"
170174
refStates(v::VariableDFG) = v.states
171175

172176
#NOTE fielddefaults and fieldtags not through @kwarg macro due to error with State{T, P, N}
173-
function StructUtils.fielddefaults(::StructUtils.StructStyle, ::Type{VariableDFG{T,P,N}}) where {T,P,N}
177+
function StructUtils.fielddefaults(
178+
::StructUtils.StructStyle,
179+
::Type{VariableDFG{T, P, N}},
180+
) where {T, P, N}
174181
return (
175182
timestamp = TimeDateZone(now(localzone())),
176183
tags = Set{Symbol}(),
@@ -223,8 +230,12 @@ function VariableDFG(
223230
timestamp = TimeDateZone(timestamp)
224231
end
225232
if !isnothing(nanosecondtime)
226-
@assert isnothing(steadytime), "nanosecondtime is replaced by steadytime. Cannot specify both steadytime and nanosecondtime"
227-
Base.depwarn("nanosecondtime kwarg is deprecated, use steadytime instead", :VariableDFG)
233+
@assert isnothing(steadytime),
234+
"nanosecondtime is replaced by steadytime. Cannot specify both steadytime and nanosecondtime"
235+
Base.depwarn(
236+
"nanosecondtime kwarg is deprecated, use steadytime instead",
237+
:VariableDFG,
238+
)
228239
steadytime = Nanosecond(nanosecondtime)
229240
end
230241
if !isnothing(smalldata)
@@ -235,25 +246,13 @@ function VariableDFG(
235246

236247
N = getDimension(T)
237248
P = getPointType(T)
238-
return VariableDFG{T, P, N}(;
239-
label,
240-
steadytime,
241-
solvable,
242-
tags,
243-
timestamp,
244-
kwargs...,
245-
)
249+
return VariableDFG{T, P, N}(; label, steadytime, solvable, tags, timestamp, kwargs...)
246250
end
247251

248252
function VariableDFG(label::Symbol, state::State; kwargs...)
249-
return VariableCompute(;
250-
label,
251-
states = OrderedDict(state.label => state),
252-
kwargs...,
253-
)
253+
return VariableCompute(; label, states = OrderedDict(state.label => state), kwargs...)
254254
end
255255

256-
257256
# Base.getproperty(x::VariableCompute, f::Symbol) = begin
258257
# if f == :solvable
259258
# getfield(x, f)[]
@@ -321,10 +320,7 @@ Base.@kwdef struct VariableSkeleton <: AbstractGraphVariable
321320
tags::Set{Symbol} = Set{Symbol}()
322321
end
323322

324-
function VariableSkeleton(
325-
label::Symbol,
326-
tags = Set{Symbol}();
327-
)
323+
function VariableSkeleton(label::Symbol, tags = Set{Symbol}();)
328324
return VariableSkeleton(label, tags)
329325
end
330326

src/services/CompareUtils.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,12 @@ function compare(a::State, b::State)
213213
!isapprox(a.observability, b.observability; atol = 1e-13) &&
214214
@debug("infoPerCoord is not equal") === nothing &&
215215
return false
216-
a.marginalized != b.marginalized && @debug("ismargin is not equal") === nothing && return false
216+
a.marginalized != b.marginalized &&
217+
@debug("ismargin is not equal") === nothing &&
218+
return false
217219
# a.dontmargin != b.dontmargin &&
218-
# @debug("dontmargin is not equal") === nothing &&
219-
# return false
220+
# @debug("dontmargin is not equal") === nothing &&
221+
# return false
220222
getVariableType(a) != getVariableType(b) &&
221223
@debug("variableType is not equal") === nothing &&
222224
return false

src/services/DFGVariable.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,4 +671,3 @@ function listStates(
671671
end
672672
return labels
673673
end
674-

src/services/Serialization.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ function packState(d::State{T}) where {T <: StateType}
9393
length(d.covar) > 1 && @warn(
9494
"Packing of more than one parametric covariance is NOT supported yet, only packing first."
9595
)
96-
96+
9797
return (
9898
label = d.label,
99-
vecval =_val,
99+
vecval = _val,
100100
dimval = size(castval, 1),
101101
vecbw = d.bw[:],
102102
dimbw = size(d.bw, 1),

test/fileDFGTests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ using UUIDs
4343
label = :testing2,
4444
blobstore = :store,
4545
# timestamp = ZonedDateTime(2014, 5, 30, 21, tz"UTC-4"),
46-
timestamp = DFG.TimeDateZone( ZonedDateTime(2014, 5, 30, 21, tz"UTC-4")),
46+
timestamp = DFG.TimeDateZone(ZonedDateTime(2014, 5, 30, 21, tz"UTC-4")),
4747
),
4848
),
4949
verts,

0 commit comments

Comments
 (0)