jpjones76 / SeisIO.jl

Julia language support for geophysical time series data
http://seisio.readthedocs.org
Other
47 stars 21 forks source link

Failing DataFormat test on julia 1.6.1 #83

Open adigitoleo opened 3 years ago

adigitoleo commented 3 years ago

I'm getting a failing DataFormat test for SeisIO 1.2.1:

================= DataFormats ==================
                     DataFormats/test_SeisHDF.jl
  ASDF
    read_hdf5
    scan_hdf5
    asdf_rqml
    write_hdf5
      write to new file
      add to existing file
      write to new file with gaps
      asdf_wqml
        append mode
        overwrite mode
ovewriting QuakeML...
Writing event 1033269798770001346
        to new file
        append file with incompatible QML
      write SeisEvent
        to new file
        to existing file
        to appended file
      read_asdf_evt
        accuracy of SeisEvent i/o
          single-event read
          multi-event read
          multi-file read
                          DataFormats/test_ah.jl
  AH (Ad Hoc)
    v1
ERROR: LoadError: LoadError: There was an error during testing
in expression starting at /home/admin/.julia/packages/SeisIO/JgSIN/test/DataFormats/test_ah.jl:10
in expression starting at /home/admin/.julia/packages/SeisIO/JgSIN/test/runtests.jl:27
ERROR: Package SeisIO errored during testing
Full test log ``` (@v1.6) pkg> test SeisIO Testing SeisIO Status `/tmp/jl_EI6DOV/Project.toml` [a74b3585] Blosc v0.7.0 [717857b8] DSP v0.6.10 [7a1cc6ca] FFTW v1.4.1 [c27321d9] Glob v1.3.0 [f67ccb44] HDF5 v0.13.6 [cd3eb016] HTTP v0.8.19 [9c8b4983] LightXML v0.8.1 [b372bb87] SeisIO v1.2.1 [ade2ca70] Dates `@stdlib/Dates` [8bb1440f] DelimitedFiles `@stdlib/DelimitedFiles` [37e2e46d] LinearAlgebra `@stdlib/LinearAlgebra` [56ddb016] Logging `@stdlib/Logging` [d6f4376e] Markdown `@stdlib/Markdown` [a63ad114] Mmap `@stdlib/Mmap` [44cfe95a] Pkg `@stdlib/Pkg` [de0858da] Printf `@stdlib/Printf` [9a3f8284] Random `@stdlib/Random` [6462fe0b] Sockets `@stdlib/Sockets` [10745b16] Statistics `@stdlib/Statistics` [8dfed614] Test `@stdlib/Test` Status `/tmp/jl_EI6DOV/Manifest.toml` [621f4979] AbstractFFTs v1.0.1 [79e6a3ab] Adapt v3.3.0 [b99e7846] BinaryProvider v0.5.10 [a74b3585] Blosc v0.7.0 [d360d2e6] ChainRulesCore v0.9.43 [34da2185] Compat v3.29.0 [717857b8] DSP v0.6.10 [ffbed154] DocStringExtensions v0.8.4 [e2ba6199] ExprTools v0.1.3 [8f5d6c58] EzXML v1.1.0 [7a1cc6ca] FFTW v1.4.1 [c27321d9] Glob v1.3.0 [f67ccb44] HDF5 v0.13.6 [cd3eb016] HTTP v0.8.19 [83e8ac13] IniFile v0.5.0 [d8418881] Intervals v1.5.0 [c8e1da08] IterTools v1.3.0 [692b3bcd] JLLWrappers v1.3.0 [9c8b4983] LightXML v0.8.1 [2ab3a3ac] LogExpFunctions v0.2.3 [739be429] MbedTLS v1.0.3 [78c3b35d] Mocking v0.7.1 [6fe1bfb0] OffsetArrays v1.8.0 [f27b6e38] Polynomials v1.2.1 [21216c6a] Preferences v1.2.2 [3cdcf5f2] RecipesBase v1.1.1 [189a3867] Reexport v1.0.0 [b372bb87] SeisIO v1.2.1 [276daf66] SpecialFunctions v1.4.0 [f269a46b] TimeZones v1.5.5 [0b7ba130] Blosc_jll v1.14.3+1 [f5851436] FFTW_jll v3.3.9+7 [0234f1f7] HDF5_jll v1.12.0+1 [1d5cc7b8] IntelOpenMP_jll v2018.0.3+2 [94ce4f54] Libiconv_jll v1.16.1+0 [5ced341a] Lz4_jll v1.9.2+2 [856f044c] MKL_jll v2021.1.1+1 [458c3c95] OpenSSL_jll v1.1.1+6 [efe28fd5] OpenSpecFun_jll v0.5.4+0 [02c8fc9c] XML2_jll v2.9.12+0 [3161d3a3] Zstd_jll v1.4.8+0 [0dad84c5] ArgTools `@stdlib/ArgTools` [56f22d72] Artifacts `@stdlib/Artifacts` [2a0f44e3] Base64 `@stdlib/Base64` [ade2ca70] Dates `@stdlib/Dates` [8bb1440f] DelimitedFiles `@stdlib/DelimitedFiles` [8ba89e20] Distributed `@stdlib/Distributed` [f43a241f] Downloads `@stdlib/Downloads` [b77e0a4c] InteractiveUtils `@stdlib/InteractiveUtils` [4af54fe1] LazyArtifacts `@stdlib/LazyArtifacts` [b27032c2] LibCURL `@stdlib/LibCURL` [76f85450] LibGit2 `@stdlib/LibGit2` [8f399da3] Libdl `@stdlib/Libdl` [37e2e46d] LinearAlgebra `@stdlib/LinearAlgebra` [56ddb016] Logging `@stdlib/Logging` [d6f4376e] Markdown `@stdlib/Markdown` [a63ad114] Mmap `@stdlib/Mmap` [ca575930] NetworkOptions `@stdlib/NetworkOptions` [44cfe95a] Pkg `@stdlib/Pkg` [de0858da] Printf `@stdlib/Printf` [3fa0cd96] REPL `@stdlib/REPL` [9a3f8284] Random `@stdlib/Random` [ea8e919c] SHA `@stdlib/SHA` [9e88b42a] Serialization `@stdlib/Serialization` [1a1011a3] SharedArrays `@stdlib/SharedArrays` [6462fe0b] Sockets `@stdlib/Sockets` [2f01184e] SparseArrays `@stdlib/SparseArrays` [10745b16] Statistics `@stdlib/Statistics` [fa267f1f] TOML `@stdlib/TOML` [a4e569a6] Tar `@stdlib/Tar` [8dfed614] Test `@stdlib/Test` [cf7118a7] UUIDs `@stdlib/UUIDs` [4ec0a83e] Unicode `@stdlib/Unicode` [e66e0078] CompilerSupportLibraries_jll `@stdlib/CompilerSupportLibraries_jll` [deac9b47] LibCURL_jll `@stdlib/LibCURL_jll` [29816b5a] LibSSH2_jll `@stdlib/LibSSH2_jll` [c8ffd9c3] MbedTLS_jll `@stdlib/MbedTLS_jll` [14a3606d] MozillaCACerts_jll `@stdlib/MozillaCACerts_jll` [83775a58] Zlib_jll `@stdlib/Zlib_jll` [8e850ede] nghttp2_jll `@stdlib/nghttp2_jll` [3f19e933] p7zip_jll `@stdlib/p7zip_jll` Testing Running tests... [ Info: Please allow 20 minutes for all tests to execute. DSP found. Not installing. HDF5 found. Not installing. 2021-05-18T20:33:47.670: tests begin, path = /home/admin/.julia/packages/SeisIO/JgSIN/test, has_restricted = false, keep_log = false, keep_samples = true ================== CoreUtils =================== CoreUtils/test_FastIO.jl FastIO IOStream generic IO CoreUtils/test_calculus.jl diff_x!, int_x! CoreUtils/test_get_svn.jl dowloading via SVN... A SVN_test A SVN_test/test Exported revision 41. dowloading via SVN... svn: E170000: URL 'https://github.com/jpjones76/SeisIO-TestData/trunk/DOESNT_EXIST' doesn't exist CoreUtils/test_ls.jl safe_isfile safe_isdir ls arch = x86_64 extended ls tests skipped. (files not found; is this Appveyor?) CoreUtils/test_poly.jl poly CoreUtils/test_read_utils.jl low-level read utils CoreUtils/test_time.jl time starttime non-chronological endtime non-chronological t_win, w_time faithful representation of gaps arbitrary windows containing gaps length-0 gap negative gap single-point gap non-null gap at end negative gap at end t_bounds mktime int2tstr, tstr2int sort_segs! t_extend time-series irregular mk_t t_arr! x_inds CoreUtils/test_ts_timekeeping.jl time test with synthetic timeseries data creating files reading to test all channel-extension cases final checks cleanup CoreUtils/test_typ2code.jl code2typ, typ2code ==================== Types ===================== Types/math.jl mathematical properties reflexivity commutativity S1 + S2 == S2 + S1 S + C == C + S C1 + C2 == C2 + C1 S + U - U == S (for sorted S) associativity (S1 + S2) + S3 == S1 + (S2 + S3) (S1 + S2) + C == S1 + (S2 + C) Types/test_InstResp.jl InstrumentResponse subtypes resp codes Types/test_extended_methods.jl extended methods getindex getindex + Int on SeisData ==> SeisChannel getindex + Range on SeisData ==> SeisData setindex! in findid isempty append! SeisChannel methods Types/test_memory.jl uniqueness of memory allocation Types/test_notes.jl annotation and logging note! clear_notes! accuracy of automatic logging Types/test_show.jl show Types/test_splat.jl "splat" structure creation Types/unittests_types.jl InstrumentPosition SeisPha PhaseCat EventChannel, EventTraceData =================== RandSeis =================== RandSeis/test_randseis.jl RandSeis getbandcode rand_misc iccodes_and_units rand_t controlled gaps gap < Δ/2 + 1 rand_resp namestrip repop_id! randSeis* keywords a0 c fc s ==================== Utils ===================== Utils/test_chanutils.jl channel_match cmatch_p! Utils/test_findid.jl findid Utils/test_get_seis_channels.jl get_seis_channels Utils/test_guess.jl guess ability to determine file types unambiguously known file formats read_data with guess() Utils/test_nx_max.jl Utils/test_string_parsing.jl parsing how bad float strings parse: 49.9.81 => 49.81 .9f => 0.9 .9fff183948913749817 => Inf +-+-+-1232.0 => -1232.0 12a32.34a => 12.0 threeve => 0.0 Texa$ => 0.0 13.13.13. => 13.0 -.123efe => -0.123 buf_to_double Utils/test_units.jl units check that RandSeis uses valid UCUM units test conversions to UCUM units =================== NativeIO =================== NativeIO/test_native_io.jl Native I/O read/write of types SeisData SeisHdr SeisEvent read/write of each type to same file read with mmap read file with integer record number read a multi-record file read file list with list of record numbers read nothing due to an intentionally poor choice of record numbers read first record from each SeisIO file using a wildcard list test that every custom Type can be written and read faithfully test read/write with data compression ================= DataFormats ================== DataFormats/test_SeisHDF.jl ASDF read_hdf5 scan_hdf5 asdf_rqml write_hdf5 write to new file add to existing file write to new file with gaps asdf_wqml append mode overwrite mode ovewriting QuakeML... Writing event 2372503460633866952 to new file append file with incompatible QML write SeisEvent to new file to existing file to appended file read_asdf_evt accuracy of SeisEvent i/o single-event read multi-event read multi-file read DataFormats/test_ah.jl AH (Ad Hoc) v1 ERROR: LoadError: LoadError: There was an error during testing in expression starting at /home/admin/.julia/packages/SeisIO/JgSIN/test/DataFormats/test_ah.jl:10 in expression starting at /home/admin/.julia/packages/SeisIO/JgSIN/test/runtests.jl:27 ERROR: Package SeisIO errored during testing ```

My julia version:

Julia Version 1.6.1
Commit 6aaedecc44* (2021-04-23 05:59 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-8705G CPU @ 3.10GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.1.0 (ORCJIT, skylake)

I'm very new to julia, if there is a way to get more verbose logs or more info on this please let me know. This is a fresh julia install on linux with no other julia packages installed.

jpjones76 commented 3 years ago

It looks like your tests didn't try to download the test data set... there should be a check for the test data, with verbose logging of the data download if the data set isn't found. I've looked at this a couple of times over the last two weeks, but I can't understand why that happened to you.

adigitoleo commented 3 years ago

No worries, I'll poke around as time permits and see if I can help. Maybe I can learn something about testing in julia :) Looks like the test is using files from SampleFiles/AH, which contains the following:

shell> ls .julia/packages/SeisIO/JgSIN/test/SampleFiles/AH/
ah1.f  ah2.f  BRV.TSG.DS.lE21.resp  lhz.ah
adigitoleo commented 3 years ago

Curiously, everything is passing just fine on an Ubuntu box:

julia> versioninfo()
Julia Version 1.4.1
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU E5-1660 v4 @ 3.20GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-8.0.1 (ORCJIT, broadwell)
adigitoleo commented 3 years ago

Do you happen to know of a way to send the output of pkg>test <foo> to a file?

jpjones76 commented 3 years ago

One moment. If your tests pass in Ubuntu, then what is the operating system where they're failing?

adigitoleo commented 3 years ago

The test fails on Arch Linux x86_64 with kernel 5.12.9-arch1-1 (julia versioninfo in the OP).

I think it downloads using subversion, which I also have:

❯ svn --version
svn, version 1.14.1 (r1886195)
   compiled May 24 2021, 14:42:10 on x86_64-pc-linux-gnu

Copyright (C) 2021 The Apache Software Foundation.
This software consists of contributions made by many people;
see the NOTICE file for more information.
Subversion is open source software, see http://subversion.apache.org/

The following repository access (RA) modules are available:

* ra_svn : Module for accessing a repository using the svn network protocol.
  - with Cyrus SASL authentication
  - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' scheme
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
  - using serf 1.3.9 (compiled with 1.3.9)
  - handles 'http' scheme
  - handles 'https' scheme

The following authentication credential caches are available:

* Gnome Keyring
* GPG-Agent
* KWallet (KDE)
adigitoleo commented 3 years ago

Maybe it comes from this line: https://github.com/jpjones76/SeisIO.jl/blob/main/test/DataFormats/test_ah.jl#L54

I was going through the steps in that block individually and for that line I get:

julia>   @test string(u2d(C.misc["ot"]*μs)) == "1990-05-12T04:50:08.7"
Test Failed at REPL[53]:1
  Expression: string(u2d(C.misc["ot"] * μs)) == "1990-05-12T04:50:08.7"
   Evaluated: "1990-05-12T04:50:08.700" == "1990-05-12T04:50:08.7"
ERROR: There was an error during testing

Is there any reason why these are being compared as strings? A similar check is being done 6 lines above by comparing the DateTime values, which works.

jpjones76 commented 3 years ago

Wait. Does Arch have a nonstandard implementation of DateTime formatting, like Unix strptime()?

adigitoleo commented 3 years ago

So it looks like the DateTime print format changed in a recent Julia version. I can't quite track down the commit, but it's not an Arch vs Ubuntu thing. I installed Julia 1.6.1 on the Ubuntu machine and I get the same zero-padding behaviour:

julia> versioninfo()
Julia Version 1.6.1
Commit 6aaedecc44 (2021-04-23 05:59 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU E5-1660 v4 @ 3.20GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, broadwell)

julia> using Dates

julia> DateTime(Date(2018, 1, 1), Time(8, 15, 42, 10))
2018-01-01T08:15:42.010

Compared to Julia 1.4.1 (default from Ubuntu repos):

julia> versioninfo()
Julia Version 1.4.1
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU E5-1660 v4 @ 3.20GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-8.0.1 (ORCJIT, broadwell)

julia> using Dates

julia> DateTime(Date(2018, 1, 1), Time(8, 15, 42, 10))
2018-01-01T08:15:42.01

I'll try to find when this was changed, for reference. I suppose it can't hurt to teach myself some git bisect. Your test runners are using 1.5 I think so that narrows it down a bit.

The good news is that without that one line, everything else is passing on 1.6.1 :)

adigitoleo commented 3 years ago

Git bisect was a bit ambitious because I would have to pull older versions of all kinds of dependencies, so I gave up :) But this change was definitely introduced in the 1.6 release, and I think I found the PR:

https://github.com/JuliaLang/julia/pull/35582/files

jpjones76 commented 2 years ago

Just a fast update: this test issue has been fixed on branch "main" and I'll be doing a bugfix release including this in a couple of weeks.