Skip to content

Moved all experimental code including tests into research folder. #304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Dec 7, 2022
2 changes: 1 addition & 1 deletion .github/workflows/ExperimentalTests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: IntegrationTests
name: TestExperimentalFeatures

on:
push:
Expand Down
1 change: 0 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ version = "0.4"

[deps]
AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
AdaptiveRejectionSampling = "c75e803d-635f-53bd-ab7d-544e482d8c75"
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
InplaceOps = "505f98c9-085e-5b2c-8e89-488be7bf1f34"
Expand Down
28 changes: 28 additions & 0 deletions research/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[deps]
AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
AdaptiveRejectionSampling = "c75e803d-635f-53bd-ab7d-544e482d8c75"
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
InplaceOps = "505f98c9-085e-5b2c-8e89-488be7bf1f34"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
StatsFuns = "4c63d2b9-4356-54db-8cca-17b64c39e42c"
UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"

[compat]
AbstractMCMC = "3.2, 4"
ArgCheck = "1, 2"
DocStringExtensions = "0.8, 0.9"
InplaceOps = "0.3"
ProgressMeter = "1"
Requires = "0.5, 1"
Setfield = "0.7, 0.8, 1"
StatsBase = "0.31, 0.32, 0.33"
StatsFuns = "0.8, 0.9, 1"
UnPack = "1"
julia = "1"
8 changes: 8 additions & 0 deletions research/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
In order to use algorithms in this folder, please navigate to the AdvancedHMC folder and run


```
] activate research/
] develop src/
] instantiate
```
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
using AdvancedHMC
import AdvancedHMC: ∂H∂r, neg_energy, AbstractKinetic
import Random: AbstractRNG

struct RelativisticKinetic{T} <: AbstractKinetic
"Mass"
m::T
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using ReTest, AdvancedHMC
using AdvancedHMC
using AdvancedHMC: RelativisticKinetic
using LinearAlgebra: dot

@testset "Hamiltonian" begin
Expand All @@ -9,4 +8,4 @@ using LinearAlgebra: dot
metric = UnitEuclideanMetric(10)
h = Hamiltonian(metric, RelativisticKinetic(1.0, 1.0), f, g)
@test h.kinetic isa RelativisticKinetic
end
end
4 changes: 4 additions & 0 deletions test/experimental/runtests.jl → research/tests/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
using ReTest

# include the source code for relativistic HMC
include("../src/relativistic_hmc.jl")

# include the tests for relativistic HMC
include("relativistic_hmc.jl")

@main function runtests(patterns...; dry::Bool=false)
Expand Down
2 changes: 0 additions & 2 deletions src/AdvancedHMC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,6 @@ export DifferentiableDensityModel

include("contrib/ad.jl")

include("experimental/relativistic_hmc.jl")

### Init

using Requires
Expand Down
7 changes: 6 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ if GROUP == "All" || GROUP == "AdvancedHMC"
end

if GROUP == "All" || GROUP == "Experimental"
include(joinpath("experimental", "runtests.jl"))
using Pkg
# activate separate test environment
Pkg.activate(joinpath(DIRECTORY_AdvancedHMC, "research"))
Pkg.develop(PackageSpec(; path=DIRECTORY_AdvancedHMC))
Pkg.instantiate()
include(joinpath(DIRECTORY_AdvancedHMC, "research/tests", "runtests.jl"))
end

if GROUP == "All" || GROUP == "Downstream"
Expand Down