Skip to content

Commit

Permalink
Merge pull request #1046 from JuliaRobotics/master
Browse files Browse the repository at this point in the history
release v0.23.2-rc1
  • Loading branch information
dehann authored Sep 5, 2023
2 parents fb4519c + 54f4e35 commit 180f2ef
Show file tree
Hide file tree
Showing 50 changed files with 4,365 additions and 2,918 deletions.
13 changes: 13 additions & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
indent = 4
always_for_in = false #
whitespace_typedefs = true
whitespace_ops_in_indices = true
remove_extra_newlines = true
import_to_using = false #
pipe_to_function_call = false #
short_to_long_function_def = true
always_use_return = true
whitespace_in_kwargs = true #
annotate_untyped_fields_with_any = true #
conditional_to_if = true
separate_kwargs_with_semicolon = true
30 changes: 30 additions & 0 deletions .github/workflows/Formatter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Format
on:
push:
branches: [master]
tags: [v*]
pull_request:

jobs:
format:
name: "Format Check"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v1
with:
version: 1
- uses: julia-actions/cache@v1
- name: Install JuliaFormatter and format
run: |
using Pkg
Pkg.add(PackageSpec(name="JuliaFormatter"))
using JuliaFormatter
format("."; verbose=true)
shell: julia --color=yes {0}
- name: Suggest formatting changes
uses: reviewdog/action-suggester@v1
if: github.event_name == 'pull_request'
with:
tool_name: JuliaFormatter
fail_on_error: true
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.9'
- '~1.10.0-0'
- 'nightly'
os:
- ubuntu-latest
Expand Down
5 changes: 3 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "DistributedFactorGraphs"
uuid = "b5cc3c7e-6572-11e9-2517-99fb8daf2f04"
version = "0.23.1"
version = "0.23.2"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand Down Expand Up @@ -60,6 +60,7 @@ TimeZones = "1.3.1"
julia = "1.9"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
GraphPlot = "a2cc645c-3eea-5389-862e-a155d0052231"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand All @@ -69,4 +70,4 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "DataStructures", "GraphPlot", "LinearAlgebra", "Manifolds", "Pkg", "Statistics"]
test = ["Aqua", "Test", "DataStructures", "GraphPlot", "LinearAlgebra", "Manifolds", "Pkg", "Statistics"]
26 changes: 16 additions & 10 deletions attic/DataBlobs/FileDataEntryBlob.jl
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@


# @generated function ==(x::BlobEntry, y::BlobEntry)
# mapreduce(n -> :(x.$n == y.$n), (a,b)->:($a && $b), fieldnames(x))
# end

#
# getHash(entry::AbstractBlobEntry) = hex2bytes(entry.hash)


##==============================================================================
## BlobEntry Common
##==============================================================================
blobfilename(entry::BlobEntry) = joinpath(entry.folder,"$(entry.id).dat")
entryfilename(entry::BlobEntry) = joinpath(entry.folder,"$(entry.id).json")

blobfilename(entry::BlobEntry) = joinpath(entry.folder, "$(entry.id).dat")
entryfilename(entry::BlobEntry) = joinpath(entry.folder, "$(entry.id).json")

##==============================================================================
## BlobEntry Blob CRUD
Expand All @@ -37,10 +34,10 @@ function addBlob!(dfg::AbstractDFG, entry::BlobEntry, data::Vector{UInt8})
error("Key '$(entry.id)' entry already exists, but no blob.")
else
open(blobfilename(entry), "w") do f
write(f, data)
return write(f, data)
end
open(entryfilename(entry), "w") do f
JSON.print(f, entry)
return JSON.print(f, entry)
end
# FIXME update for entry.blobId vs entry.originId
return UUID(entry.id)
Expand Down Expand Up @@ -71,11 +68,20 @@ end
## BlobEntry CRUD Helpers
##==============================================================================

function addData!(::Type{BlobEntry}, dfg::AbstractDFG, label::Symbol, key::Symbol, folder::String, blob::Vector{UInt8}, timestamp=now(localzone());
id::UUID = uuid4(), hashfunction = sha256)
function addData!(
::Type{BlobEntry},
dfg::AbstractDFG,
label::Symbol,
key::Symbol,
folder::String,
blob::Vector{UInt8},
timestamp = now(localzone());
id::UUID = uuid4(),
hashfunction = sha256,
)
fde = BlobEntry(key, id, folder, bytes2hex(hashfunction(blob)), timestamp)
blobId = addBlob!(dfg, fde, blob) |> UUID
newEntry = BlobEntry(fde; id=blobId, blobId)
newEntry = BlobEntry(fde; id = blobId, blobId)
de = addBlobEntry!(dfg, label, newEntry)
return de # de=>db
end
Loading

0 comments on commit 180f2ef

Please sign in to comment.