From 3d66e68897fe52b1526d1983fd1252cd4563f6be Mon Sep 17 00:00:00 2001 From: Jingpeng Wu Date: Mon, 6 Jul 2020 12:16:49 -0400 Subject: [PATCH] fix skeletonization. (#79) * upgrade to Julia 1.4; fix skeletonize by not reversing the coordinate from xyz to zyx; * fix travis build * fix Pkg.PackageSpec * delete installing the package. * fix documenter build * drop support of julia1.0 --- .gitignore | 1 + .travis.yml | 10 +++++----- Dockerfile | 6 ++++-- Project.toml | 2 +- docs/make.jl | 26 ++++++++++++++++++++------ scripts/skeletonize.jl | 2 +- src/Manifests.jl | 2 +- src/Utils/RangeIndexingArrays.jl | 6 +++--- 8 files changed, 36 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index f7686143..d47f44a7 100755 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ docs/build/ Manifest.toml *.log +*.dat diff --git a/.travis.yml b/.travis.yml index afaa48a2..3aa048ea 100755 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,8 @@ language: julia os: linux julia: - - 1.0 + - 1.3 + - 1.4 - nightly notifications: @@ -14,10 +15,9 @@ install: - sudo apt-get install -y -qq hdf5-tools script: - - julia -e 'import Pkg; Pkg.clone("https://github.com/seung-lab/BigArrays.jl.git")' - - julia -e 'import Pkg; Pkg.clone(pwd()); Pkg.test("RealNeuralNetworks", coverage=true)' - - julia -e 'using Pkg; Pkg.add("Documenter")' - - julia -e 'using Pkg; cd(Pkg.dir("RealNeuralNetworks")); include(joinpath("docs", "make.jl"))' + - julia -e 'using Pkg; Pkg.develop(PackageSpec(name="BigArrays", url="https://github.com/seung-lab/BigArrays.jl.git"))' + - julia -e 'using Pkg; Pkg.test("RealNeuralNetworks", coverage=true)' + - julia -e 'using Pkg; Pkg.add("Documenter"); cd(Pkg.dir("RealNeuralNetworks")); include(joinpath("docs", "make.jl"))' #jobs: diff --git a/Dockerfile b/Dockerfile index c96dea4b..178ef10a 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM julia:1.3 +FROM julia:1.4 LABEL maintainer="Jingpeng Wu " \ function="skeletonization" @@ -20,9 +20,11 @@ RUN julia -e 'using Pkg; Pkg.update(); Pkg.instantiate();' RUN julia -e 'using Pkg; Pkg.develop(PackageSpec(name="BigArrays", url="https://github.com/seung-lab/BigArrays.jl.git"))' #Pkg.resolve(); \ #Pkg.develop(PackageSpec(url="https://github.com/seung-lab/RealNeuralNetworks.jl.git")); \ -RUN julia -e 'using Pkg; Pkg.develop(PackageSpec(name="RealNeuralNetworks", path=pwd())); \ + +RUN julia -e 'using Pkg; Pkg.develop(PackageSpec(name="RealNeuralNetworks", path=joinpath(pwd(), "RealNeuralNetworks"))); \ Pkg.develop("RealNeuralNetworks"); Pkg.instantiate();' # install registered packages later + RUN julia -e 'using Pkg; Pkg.add("LightGraphs"); \ Pkg.add("MetaGraphs"); \ Pkg.add("ArgParse");\ diff --git a/Project.toml b/Project.toml index 2bbadcd4..13781329 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "RealNeuralNetworks" uuid = "4491297b-8966-5840-8cb9-b189d60f3398" -version = "1.0.1" +version = "1.3.1" [deps] BigArrays = "c2a8506f-1b35-5b08-8aa1-bb4a7b47a05e" diff --git a/docs/make.jl b/docs/make.jl index 61d2c59e..0e693551 100755 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,14 +1,32 @@ -using Documenter, RealNeuralNetworks +using Documenter +using RealNeuralNetworks using RealNeuralNetworks.Neurons using RealNeuralNetworks.Neurons.Segments using RealNeuralNetworks.Neurons.Segments.Synapses using RealNeuralNetworks.SWCs +# The DOCSARGS environment variable can be used to pass additional arguments to make.jl. +# This is useful on CI, if you need to change the behavior of the build slightly but you +# can not change the .travis.yml or make.jl scripts any more (e.g. for a tag build). +if haskey(ENV, "DOCSARGS") + for arg in split(ENV["DOCSARGS"]) + (arg in ARGS) || push!(ARGS, arg) + end +end + makedocs( modules=[RealNeuralNetworks, Neurons, Segments, Synapses, SWCs], sitename="RealNeuralNetworks.jl", authors="Jingpeng Wu", - format=:html, + format = Documenter.HTML( + # Use clean URLs, unless built as a "local" build + prettyurls = !("local" in ARGS), + canonical = "https://seung-lab.github.io/RealNeuralNetworks.jl/latest/", + assets = ["assets/favicon.ico"], + analytics = "UA-136089579-2", + highlights = ["yaml"], + ), + linkcheck = !("skiplinks" in ARGS), pages = [ "Home" => "index.md", "Manual" => Any[ @@ -26,15 +44,11 @@ makedocs( ], "man/contributing.md", ], - # use clean URLs, unless built as a "local" build - html_prettyurls = !("local" in ARGS), - html_canonical = "https://seung-lab.github.io/RealNeuralNetworks.jl/latest", ) deploydocs( repo="github.com/seung-lab/RealNeuralNetworks.jl", target="build", - julia="0.7", deps=nothing, make=nothing ) diff --git a/scripts/skeletonize.jl b/scripts/skeletonize.jl index a316bc3a..7761561e 100755 --- a/scripts/skeletonize.jl +++ b/scripts/skeletonize.jl @@ -32,7 +32,7 @@ end function parse_commandline() s = ArgParseSettings() - @add_arg_table s begin + @add_arg_table! s begin "--neuronid", "-i" help = "the segment id to skeletonize" arg_type = Int diff --git a/src/Manifests.jl b/src/Manifests.jl index 10fffcdb..dfbfa8cc 100755 --- a/src/Manifests.jl +++ b/src/Manifests.jl @@ -51,7 +51,7 @@ function Manifest( ranges::Vector, ba::BigArray{D,T} ) where {D,T} rangesList = map( BigArrays.Indexes.string2unit_range, ranges ) # convert from z,y,x to x,y,z # this is due to a bug in chunkflow, we should not need this in the future - rangesList = map( reverse, rangesList) + # rangesList = map( reverse, rangesList) @show rangesList Manifest( ba, obj_id, rangesList ) end diff --git a/src/Utils/RangeIndexingArrays.jl b/src/Utils/RangeIndexingArrays.jl index 0854be3f..8ccadfa6 100755 --- a/src/Utils/RangeIndexingArrays.jl +++ b/src/Utils/RangeIndexingArrays.jl @@ -45,9 +45,9 @@ function range_string_list2septa_list(rangeStringList::Vector) septaList end -@inline function range_string_list2septa_list(rangeStringList::CSV.Column{String, String}) - range_string_list2septa_list(map(string, rangeStringList)) -end +#@inline function range_string_list2septa_list(rangeStringList::CSV.Column{String, String}) +# range_string_list2septa_list(map(string, rangeStringList)) +#end """