diff --git a/.gitignore b/.gitignore index 2d522a2..0e4fc8d 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ /Manifest*.toml /docs/Manifest*.toml /docs/build/ -*.jld2 \ No newline at end of file +*.jld2 +*.vscode \ No newline at end of file diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..cb29830 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,13 @@ +coverage: + status: + project: + default: + target: "50%" + threshold: "0%" + patch: + default: + target: "0%" + threshold: "0%" + +comment: + layout: "reach, diff, files" \ No newline at end of file diff --git a/docs/make.jl b/docs/make.jl index 1df952d..6373978 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,23 +1,23 @@ using FewBodyDB using Documenter -DocMeta.setdocmeta!(FewBodyDB, :DocTestSetup, :(using FewBodyDB); recursive=true) +DocMeta.setdocmeta!(FewBodyDB, :DocTestSetup, :(using FewBodyDB); recursive = true) makedocs(; - modules=[FewBodyDB], - authors="Shuhei Ohno, Martin Mikkelsen", - sitename="FewBodyDB.jl", - format=Documenter.HTML(; - canonical="https://JuliaFewBody.github.io/FewBodyDB.jl", - edit_link="main", - assets=String[], + modules = [FewBodyDB], + authors = "Shuhei Ohno, Martin Mikkelsen", + sitename = "FewBodyDB.jl", + format = Documenter.HTML(; + canonical = "https://JuliaFewBody.github.io/FewBodyDB.jl", + edit_link = "main", + assets = String[], ), - pages=[ + pages = [ "Home" => "index.md", ], ) deploydocs(; - repo="github.com/JuliaFewBody/FewBodyDB.jl", - devbranch="main", + repo = "github.com/JuliaFewBody/FewBodyDB.jl", + devbranch = "main", ) diff --git a/src/FewBodyDB.jl b/src/FewBodyDB.jl index c73d592..3e014cc 100644 --- a/src/FewBodyDB.jl +++ b/src/FewBodyDB.jl @@ -4,12 +4,12 @@ module FewBodyDB export @get, @bib # set dictionary -REFS = Dict{String,String}() -DATA = Dict{String,String}() +REFS = Dict{String, String}() +DATA = Dict{String, String}() # put new data (for development use only) macro put(expr) - DATA[join(string.(expr.args[begin:end-1]), "/")] = string(expr.args[end]) + return DATA[join(string.(expr.args[begin:(end - 1)]), "/")] = string(expr.args[end]) end # get data @@ -21,31 +21,31 @@ julia> @get Bubin2005Jan, HD⁺, energy, (J=0, v=0) ``` """ macro get(expr) - if expr isa String - # @get "Bubin2005Jan/HD⁺/energy/(J = 0, v = 0)" - return :( FewBodyDB.get($expr) ) - elseif expr isa Expr && expr.head == :string - # v = 0; @get "Bubin2005Jan/HD⁺/energy/(J = 0, v = $v)" - return :( FewBodyDB.get(string($(esc(expr)))) ) - elseif expr isa Symbol - # k = "Bubin2005Jan/HD⁺/energy/(J = 0, v = 0)"; @get k - return :( FewBodyDB.get(string($(esc(expr)))) ) - elseif expr isa Expr && expr.head == :tuple - # @get Bubin2005Jan, HD⁺, energy, (J=0, v=0) - return FewBodyDB.get(join(string.(expr.args), "/")) - else - # others - return :( FewBodyDB.get(string($(esc(expr)))) ) - end + if expr isa String + # @get "Bubin2005Jan/HD⁺/energy/(J = 0, v = 0)" + return :(FewBodyDB.get($expr)) + elseif expr isa Expr && expr.head == :string + # v = 0; @get "Bubin2005Jan/HD⁺/energy/(J = 0, v = $v)" + return :(FewBodyDB.get(string($(esc(expr))))) + elseif expr isa Symbol + # k = "Bubin2005Jan/HD⁺/energy/(J = 0, v = 0)"; @get k + return :(FewBodyDB.get(string($(esc(expr))))) + elseif expr isa Expr && expr.head == :tuple + # @get Bubin2005Jan, HD⁺, energy, (J=0, v=0) + return FewBodyDB.get(join(string.(expr.args), "/")) + else + # others + return :(FewBodyDB.get(string($(esc(expr))))) + end end function get(key) - return DATA[key] + return DATA[key] end # put new bibliography (for development use only) macro ref(expr) - REFS[string(expr.args[begin])] = string(expr.args[end]) + return REFS[string(expr.args[begin])] = string(expr.args[end]) end # get BibTeX entry @@ -69,37 +69,37 @@ julia> println(@bib Bubin2005Jan) ``` """ macro bib(expr) - if expr isa String - # @bib "Bubin2005Jan" - return :( FewBodyDB.bib($expr) ) - elseif expr isa Expr && expr.head == :string - # s = Bubin2005Jan; @bib "$s" - return :( FewBodyDB.bib(string($(esc(expr)))) ) - elseif expr isa Symbol - try - # @bib Bubin2005Jan - return FewBodyDB.bib(string(expr)) - catch - # k = "Bubin2005Jan"; @bib k - return :( FewBodyDB.bib(string($(esc(expr)))) ) + if expr isa String + # @bib "Bubin2005Jan" + return :(FewBodyDB.bib($expr)) + elseif expr isa Expr && expr.head == :string + # s = Bubin2005Jan; @bib "$s" + return :(FewBodyDB.bib(string($(esc(expr))))) + elseif expr isa Symbol + try + # @bib Bubin2005Jan + return FewBodyDB.bib(string(expr)) + catch + # k = "Bubin2005Jan"; @bib k + return :(FewBodyDB.bib(string($(esc(expr))))) + end + else + # others + return :(FewBodyDB.bib(string($(esc(expr))))) end - else - # others - return :( FewBodyDB.bib(string($(esc(expr)))) ) - end end function bib(key) - return REFS[key] + return REFS[key] end # list keys macro keys() - return collect(Base.keys(DATA)) + return collect(Base.keys(DATA)) end # update bibliography & database include("refs/Bubin2005Jan.jl") include("refs/Karr2006Apr.jl") - +include("refs/Suzuki2003Jul.jl") end diff --git a/src/refs.bib b/src/refs.bib index b783406..73eb87a 100644 --- a/src/refs.bib +++ b/src/refs.bib @@ -26,3 +26,15 @@ @article{Karr2006Apr month = apr, pages = {2095–2105} } + +@book{Suzuki2003Jul, + title={Stochastic variational approach to quantum-mechanical few-body problems}, + volume = {54}, + ISSN = {0940-7677}, + url = {https://doi.org/10.1007/3-540-49541-X}, + DOI = {10.1007/3-540-49541-X}, + author={Suzuki, Yasuyuki and Varga, K{\'a}lm{\'a}n}, + year={2002}, + month = july, + publisher={Springer}, +} \ No newline at end of file diff --git a/src/refs/Bubin2005Jan.jl b/src/refs/Bubin2005Jan.jl index b4c5b58..c584d5b 100644 --- a/src/refs/Bubin2005Jan.jl +++ b/src/refs/Bubin2005Jan.jl @@ -1,19 +1,19 @@ @ref Bubin2005Jan, """ -@article{Bubin2005Jan, - title = {Charge asymmetry in HD+}, - volume = {122}, - ISSN = {1089-7690}, - url = {http://dx.doi.org/10.1063/1.1850905}, - DOI = {10.1063/1.1850905}, - number = {4}, - journal = {The Journal of Chemical Physics}, - publisher = {AIP Publishing}, - author = {Bubin, Sergiy and Bednarz, Eugeniusz and Adamowicz, Ludwik}, - year = {2005}, - month = jan -} -""" + @article{Bubin2005Jan, + title = {Charge asymmetry in HD+}, + volume = {122}, + ISSN = {1089-7690}, + url = {http://dx.doi.org/10.1063/1.1850905}, + DOI = {10.1063/1.1850905}, + number = {4}, + journal = {The Journal of Chemical Physics}, + publisher = {AIP Publishing}, + author = {Bubin, Sergiy and Bednarz, Eugeniusz and Adamowicz, Ludwik}, + year = {2005}, + month = jan + } + """ -@put Bubin2005Jan, HD⁺, energy, (J=0, v=0), -0.5978979685 -@put Bubin2005Jan, HD⁺, energy, (J=0, v=1), -0.5891818291 -@put Bubin2005Jan, HD⁺, energy, (J=0, v=2), -0.5809037001 \ No newline at end of file +@put Bubin2005Jan, HD⁺, energy, (J = 0, v = 0), -0.5978979685 +@put Bubin2005Jan, HD⁺, energy, (J = 0, v = 1), -0.5891818291 +@put Bubin2005Jan, HD⁺, energy, (J = 0, v = 2), -0.5809037001 diff --git a/src/refs/Suzuki2003Jul.jl b/src/refs/Suzuki2003Jul.jl new file mode 100644 index 0000000..038f968 --- /dev/null +++ b/src/refs/Suzuki2003Jul.jl @@ -0,0 +1,36 @@ +@ref Suzuki2003Jul, """ + @book{Suzuki2003Jul, + title={Stochastic variational approach to quantum-mechanical few-body problems}, + volume = {54}, + ISSN = {0940-7677}, + url = {https://doi.org/10.1007/3-540-49541-X}, + DOI = {10.1007/3-540-49541-X}, + author={Suzuki, Yasuyuki and Varga, K{\'a}lm{\'a}n}, + year={2002}, + month = july, + publisher={Springer}, + } + """ + +@put Suzuki2003Jul, Ps⁻, energy, "¹Sᵉ", -0.2620050702328 +@put Suzuki2003Jul, ∞H⁻, energy, "¹Sᵉ", -0.527751016523 +@put Suzuki2003Jul, H⁻, energy, "³Pᵉ", -0.1252865 +@put Suzuki2003Jul, ttμ, energy, "¹Sᵉ", -112.9730179 +@put Suzuki2003Jul, ttμ, energy, "¹Pᵒ", -110.2621165 +@put Suzuki2003Jul, ttμ, energy, "¹Dᵉ", -105.982930 +@put Suzuki2003Jul, ttμ, energy, "¹Fᵒ", -101.43 +@put Suzuki2003Jul, tdμ, energy, "¹Sᵉ", -111.364511474 +@put Suzuki2003Jul, tdμ, energy, "¹Pᵒ", -108.179385 +@put Suzuki2003Jul, tdμ, energy, "¹Dᵉ", -103.408481 +@put Suzuki2003Jul, ∞He, energy, "¹Sᵉ", -2.903724376984 +@put Suzuki2003Jul, He, energy, "¹Sᵉ", -2.903724372437 +@put Suzuki2003Jul, He, energy, "³Sᵉ", -2.175293782367 +@put Suzuki2003Jul, He, energy, "³Pᵒ", -2.123843086498 +@put Suzuki2003Jul, He, energy, "¹Dᵉ", -2.055620732852 +@put Suzuki2003Jul, ∞He, energy, "³Dᵉ", -2.055338993337 +@put Suzuki2003Jul, He, energy, "¹Fᵒ", -2.031255144382 +@put Suzuki2003Jul, He, energy, "³Fᵒ", -2.031255168403 +@put Suzuki2003Jul, He, energy, "¹Gᵉ", -2.020000710898 +@put Suzuki2003Jul, He, energy, "³Gᵉ", -2.020000710925 +@put Suzuki2003Jul, p̄He⁺, energy, "L=31", -3.50763486 +@put Suzuki2003Jul, ∞Li, energy, "¹Sᵉ", -7.279913 diff --git a/test/runtests.jl b/test/runtests.jl index 140f0f4..a85e065 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -4,8 +4,8 @@ using Test @testset "FewBodyDB.jl" begin # @put - FewBodyDB.@put Ohno2025Sep, H, energy, (n=1, l=0, m=0), -0.5 - @test "-0.5" == (@get Ohno2025Sep, H, energy, (n=1, l=0, m=0)) + FewBodyDB.@put Ohno2025Sep, H, energy, (n = 1, l = 0, m = 0), -0.5 + @test "-0.5" == (@get Ohno2025Sep, H, energy, (n = 1, l = 0, m = 0)) # @bib @test "@article{Bubin2005Jan" == (@bib Bubin2005Jan)[1:21] @@ -15,19 +15,53 @@ using Test @test "@article{Bubin2005Jan" == FewBodyDB.bib("Bubin2005Jan")[1:21] # @get - @test "-0.5978979685" == @get Bubin2005Jan, HD⁺, energy, (J=0, v=0) + @test "-0.5978979685" == @get Bubin2005Jan, HD⁺, energy, (J = 0, v = 0) @test "-0.5978979685" == @get "Bubin2005Jan/HD⁺/energy/(J = 0, v = 0)" @test "-0.5978979685" == (k = "Bubin2005Jan/HD⁺/energy/(J = 0, v = 0)"; @get k) @test "-0.5978979685" == (v = 0; @get "Bubin2005Jan/HD⁺/energy/(J = 0, v = $v)") - @test "-0.5891818291" == @get Bubin2005Jan, HD⁺, energy, (J=0, v=1) + @test "-0.5891818291" == @get Bubin2005Jan, HD⁺, energy, (J = 0, v = 1) @test "-0.5891818291" == @get "Bubin2005Jan/HD⁺/energy/(J = 0, v = 1)" @test "-0.5891818291" == (k = "Bubin2005Jan/HD⁺/energy/(J = 0, v = 1)"; @get k) @test "-0.5891818291" == (v = 1; @get "Bubin2005Jan/HD⁺/energy/(J = 0, v = $v)") - @test "-0.59789796860903" == @get Karr2006Apr, HD⁺, energy, (J=0, v=0) + @test "-0.59789796860903" == @get Karr2006Apr, HD⁺, energy, (J = 0, v = 0) @test "-0.59789796860903" == @get "Karr2006Apr/HD⁺/energy/(J = 0, v = 0)" @test "-0.59789796860903" == (k = "Karr2006Apr/HD⁺/energy/(J = 0, v = 0)"; @get k) @test "-0.59789796860903" == (v = 0; @get "Karr2006Apr/HD⁺/energy/(J = 0, v = $v)") + # Suzuki2003Jul entries (updated) + @test "-0.2620050702328" == @get Suzuki2003Jul, Ps⁻, energy, "¹Sᵉ" + @test "-0.2620050702328" == @get "Suzuki2003Jul/Ps⁻/energy/¹Sᵉ" + @test "-0.2620050702328" == (k = "Suzuki2003Jul/Ps⁻/energy/¹Sᵉ"; @get k) + + @test "-0.527751016523" == @get Suzuki2003Jul, ∞H⁻, energy, "¹Sᵉ" + @test "-0.527751016523" == @get "Suzuki2003Jul/∞H⁻/energy/¹Sᵉ" + + @test "-0.1252865" == @get Suzuki2003Jul, H⁻, energy, "³Pᵉ" + @test "-0.1252865" == @get "Suzuki2003Jul/H⁻/energy/³Pᵉ" + + @test "-112.9730179" == @get Suzuki2003Jul, ttμ, energy, "¹Sᵉ" + @test "-110.2621165" == @get Suzuki2003Jul, ttμ, energy, "¹Pᵒ" + @test "-105.98293" == @get Suzuki2003Jul, ttμ, energy, "¹Dᵉ" + @test "-101.43" == @get Suzuki2003Jul, ttμ, energy, "¹Fᵒ" + + @test "-111.364511474" == @get Suzuki2003Jul, tdμ, energy, "¹Sᵉ" + @test "-108.179385" == @get Suzuki2003Jul, tdμ, energy, "¹Pᵒ" + @test "-103.408481" == @get Suzuki2003Jul, tdμ, energy, "¹Dᵉ" + + @test "-2.903724376984" == @get Suzuki2003Jul, ∞He, energy, "¹Sᵉ" + @test "-2.903724372437" == @get Suzuki2003Jul, He, energy, "¹Sᵉ" + @test "-2.175293782367" == @get Suzuki2003Jul, He, energy, "³Sᵉ" + @test "-2.123843086498" == @get Suzuki2003Jul, He, energy, "³Pᵒ" + @test "-2.055620732852" == @get Suzuki2003Jul, He, energy, "¹Dᵉ" + @test "-2.055338993337" == @get Suzuki2003Jul, ∞He, energy, "³Dᵉ" + @test "-2.031255144382" == @get Suzuki2003Jul, He, energy, "¹Fᵒ" + @test "-2.031255168403" == @get Suzuki2003Jul, He, energy, "³Fᵒ" + @test "-2.020000710898" == @get Suzuki2003Jul, He, energy, "¹Gᵉ" + @test "-2.020000710925" == @get Suzuki2003Jul, He, energy, "³Gᵉ" + + @test "-3.50763486" == @get Suzuki2003Jul, p̄He⁺, energy, "L=31" + @test "-7.279913" == @get Suzuki2003Jul, ∞Li, energy, "¹Sᵉ" + end