Coder Social home page Coder Social logo

composite error about drillholes.jl HOT 13 CLOSED

juliaearth avatar juliaearth commented on June 14, 2024
composite error

from drillholes.jl.

Comments (13)

juliohm avatar juliohm commented on June 14, 2024 1

Hi @Lanjal , we are refactoring the code in the cleanup branch. If you install the package with ] add DrillHoles#cleanup you will get the latest version I am using. However, we still didn't have time to cleanup the compositing part.

@rmcaixeta should be able to help you out with the version you're using now.

from drillholes.jl.

Lanjal avatar Lanjal commented on June 14, 2024 1

Sweet!
Thanks Julio.
BTW great work !

from drillholes.jl.

Lanjal avatar Lanjal commented on June 14, 2024 1

Hi Rafael, no look here
2 - there are no missing values in EL1
julia> describe(assay)
4×7 DataFrame
Row │ variable mean min median max nmissing eltype ⋯
│ Symbol Union… Any Union… Any Int64 DataType ⋯
─────┼──────────────────────────────────────────────────────────────────────────
1 │ HOLEID OCR-RCH-030 OCR_DDH_007 0 String ⋯
2 │ FROM 12.4561 0.0 11.0 40.0 0 Float64
3 │ TO 13.6079 1.0 12.0 42.0 0 Float64
4 │ EL1 10.8796 0.05 6.66 45.09 0 Float64

1 - Tried , same error
julia> cmpst = composite(dh, interval=1.0, mode=:nodiscard)
ERROR: TypeError: in Type{...} expression, expected UnionAll, got Symbol
Stacktrace:
[1] composite(::DrillHoles.DrillHole; interval::Float64, zone::Nothing, mode::Symbol, mincomp::Float64, gap::Float64) at /home/andre/.julia/packages/DrillHoles/uLhpl/src/compositing.jl:58
[2] top-level scope at REPL[29]:1

I will try all over again removing Julia and installing the packages again from zero to see it woks. I'll get back to you anyway to let you know.

from drillholes.jl.

Lanjal avatar Lanjal commented on June 14, 2024 1

sounds perfect. I'm extracting the data form a database. It is local now but I will put on my server and send you the script when the data it is there.

from drillholes.jl.

Lanjal avatar Lanjal commented on June 14, 2024 1

Good to hear that it is ok, has to be something with my machine here . Julia is 1.4.1 on a Ubuntu Fockall Fossa machine
(@v1.4) pkg> status DataFrames DrillHoles
Status ~/.julia/environments/v1.4/Project.toml
[a93c6f00] DataFrames v0.21.8
[9d36f3b5] DrillHoles v0.1.3

Just tested on a windows machine, guess what? IT WORKED

I forgot I had a windows machine here. It is something with mine old linux box. Sorry about that and thanks again for the help

from drillholes.jl.

juliohm avatar juliohm commented on June 14, 2024 1

from drillholes.jl.

rmcaixeta avatar rmcaixeta commented on June 14, 2024

Hi @Lanjal . Thanks for sharing the issue. I took a quick look here, the part around ln 58 worked ok here even with more recent versions. Can you try these two scenarios to help me debug it, please?

  1. check if it works without zone definition: composite(dh, interval=1.0, mode=:nodiscard)
  2. try using EL1 as zone, but fill missing values with -99 prior to desurvey dh.

from drillholes.jl.

rmcaixeta avatar rmcaixeta commented on June 14, 2024

Hm ok. If you can share the data, I can take a look in the weekend to help too

from drillholes.jl.

Lanjal avatar Lanjal commented on June 14, 2024

Here is the script if you want to check what is happening
using LibPQ, DataFrames, DrillHoles, Plots,CSV

conn=LibPQ.Connection("host=162.55.126.129 dbname=geofoss user=droid password=devcor")

collar=DataFrame(execute(conn, "select c.bhid as "HOLEID", c.xcollar as "X", c.ycollar as "Y",c.zcollar as "Z",max(s._at) as "ENDDEPTH"from collar as c, survey as s where c.bhid=s.bhid group by c.bhid,c.xcollar,c.ycollar,c.zcollar"))
collar.HOLEID=convert(Vector{String}, collar.HOLEID)
collar.ENDDEPTH=convert(Vector{Float64}, collar.ENDDEPTH)
collar.X=convert(Vector{Float64}, collar.X)
collar.Y=convert(Vector{Float64}, collar.Y)
collar.Z=convert(Vector{Float64}, collar.Z)
collar

survey=DataFrame(execute(conn, "SELECT bhid as "HOLEID",_at as "AT",az as "AZM",dip*-1 as "DIP" FROM survey"))
survey.HOLEID=convert(Vector{String}, survey.HOLEID)
survey.AT=convert(Vector{Float64}, survey.AT)
survey.AZM=convert(Vector{Float64}, survey.AZM)
survey.DIP=convert(Vector{Float64}, survey.DIP)
survey

assay=DataFrame(execute(conn, "SELECT bhid as "HOLEID",_from as "FROM", _to as "TO",el1 as "EL1" FROM assay WHERE el1 IS NOT NULL"))
assay.HOLEID=convert(Vector{String}, assay.HOLEID)
assay.FROM=convert(Vector{Float64}, assay.FROM)
assay.TO=convert(Vector{Float64}, assay.TO)
assay.EL1=convert(Vector{Float64}, assay.EL1)
assay

collarIn = Collar(file=collar, holeid=:HOLEID, x=:X, y=:Y, z=:Z)
surveyIn = Survey(file=survey, holeid=:HOLEID, at=:AT, azm=:AZM, dip=:DIP)
assayIn = Interval(file=assay, holeid=:HOLEID, from=:FROM, to=:TO)

#Desurvey the drillhole data objects
dh = drillhole(collarIn, surveyIn, assayIn)
CSV.write("DESURVEYED.csv",dh.table)

describe(dh.table.LENGTH)
#THE FOLLOWING LINE GIVES ME THE ERROR MSG
cmpst = composite(dh, interval=1.0, zone=:EL1, mode=:nodiscard)
composited=dropmissing(cmpst.table)
CSV.write("COMPOSITED.csv", composited)

from drillholes.jl.

Lanjal avatar Lanjal commented on June 14, 2024

Reinstalled Julia and
---- After ] add "all the guys below" I got:

julia> using LibPQ, DataFrames, DrillHoles, Plots,CSV
[ Info: Precompiling LibPQ [194296ae-ab2e-5f79-8cd4-7183a0a5a0d1]
[ Info: Precompiling DataFrames [a93c6f00-e57d-5684-b7b6-d8193f3e46c0]
[ Info: Precompiling DrillHoles [9d36f3b5-8124-4f7e-bcda-df733105c718]
ERROR: LoadError: LoadError: syntax: space not allowed after ":" used for quoting
Stacktrace:
[1] top-level scope at /home/andre/.julia/packages/DrillHoles/uLhpl/src/compositing.jl:58
[2] include(::Module, ::String) at ./Base.jl:377
[3] include(::String) at /home/andre/.julia/packages/DrillHoles/uLhpl/src/DrillHoles.jl:5
[4] top-level scope at /home/andre/.julia/packages/DrillHoles/uLhpl/src/DrillHoles.jl:12
[5] include(::Module, ::String) at ./Base.jl:377
[6] top-level scope at none:2
[7] eval at ./boot.jl:331 [inlined]
[8] eval(::Expr) at ./client.jl:449
[9] top-level scope at ./none:3
in expression starting at /home/andre/.julia/packages/DrillHoles/uLhpl/src/compositing.jl:58
in expression starting at /home/andre/.julia/packages/DrillHoles/uLhpl/src/DrillHoles.jl:12
ERROR: Failed to precompile DrillHoles [9d36f3b5-8124-4f7e-bcda-df733105c718] to /home/andre/.julia/compiled/v1.4/DrillHoles/XEHc3_Jz11C.ji.
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1272
[3] _require(::Base.PkgId) at ./loading.jl:1029
[4] require(::Base.PkgId) at ./loading.jl:927
[5] require(::Module, ::Symbol) at ./loading.jl:922

---I went to composite.jl and removed de space between : and Union on line 58
---it was
num = eltype.(eachcol(dh)) .<: Union{Missing, Number}
---I changed to
num = eltype.(eachcol(dh)) .<:Union{Missing,Number}
---Then compiled ok
julia> using LibPQ, DataFrames, DrillHoles, Plots,CSV
[ Info: Precompiling DrillHoles [9d36f3b5-8124-4f7e-bcda-df733105c718]
[ Info: Precompiling Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]

----runing the code I got the error again
julia> cmpst = composite(dh, interval=1.0, zone=:EL1, mode=:nodiscard)
ERROR: TypeError: in Type{...} expression, expected UnionAll, got Symbol
Stacktrace:
[1] composite(::DrillHoles.DrillHole; interval::Float64, zone::Symbol, mode::Symbol, mincomp::Float64, gap::Float64) at /home/andre/.julia/packages/DrillHoles/uLhpl/src/compositing.jl:58
[2] top-level scope at REPL[57]:1

from drillholes.jl.

rmcaixeta avatar rmcaixeta commented on June 14, 2024

Hi Andre. Strange, I tested here both in Linux and Windows, and both worked well. Which version of julia you're using?
And if you could share too the output of this, please: ] status DrillHoles DataFrames

from drillholes.jl.

Lanjal avatar Lanjal commented on June 14, 2024

Will do Julio! Thanks

from drillholes.jl.

rmcaixeta avatar rmcaixeta commented on June 14, 2024

Great, I'm closing this issue then.
I highly recommend julia 1.6 too! Abs

from drillholes.jl.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.