Skip to content
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

Merge from EarthSciML/AtmosphericDeposition #3

Merged
merged 11 commits into from
Jul 11, 2024
3 changes: 1 addition & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ jobs:
fail-fast: false
matrix:
version:
- '1.8'
- '1.9'
- '1.10'
os:
Expand All @@ -36,7 +35,7 @@ jobs:
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v4
with:
file: lcov.info
docs:
Expand Down
17 changes: 13 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "AtmosphericDeposition"
uuid = "1a52f20c-0d16-41d8-a00a-b2996d86a462"
authors = ["EarthSciML authors and contributors"]
version = "0.1.0"
version = "0.2.1"

[deps]
DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
Expand All @@ -15,19 +15,28 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"

[weakdeps]
GasChem = "58070593-4751-4c87-a5d1-63807d11d76c"

[extensions]
GasChemExt = "GasChem"

[compat]
DifferentialEquations = "7"
EarthSciMLBase = "0.6"
ModelingToolkit = "8"
EarthSciMLBase = "0.6, 0.8"
GasChem = "0.5"
IfElse = "0.1"
ModelingToolkit = "8"
SafeTestsets = "0.1"
StaticArrays = "1"
Unitful = "1"
julia = "1"

[extras]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
GasChem = "58070593-4751-4c87-a5d1-63807d11d76c"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "SafeTestsets"]
test = ["Test", "SafeTestsets", "GasChem", "Dates"]
10 changes: 10 additions & 0 deletions ext/GasChemExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module GasChemExt

using AtmosphericDeposition, GasChem, EarthSciMLBase
Base.:(+)(w::Wetdeposition, b::SuperFast) = operator_compose(b, w)
Base.:(+)(b::SuperFast, w::Wetdeposition) = w + b

Base.:(+)(d::DrydepositionG, b::SuperFast) = operator_compose(b, d)
Base.:(+)(b::SuperFast, d::DrydepositionG) = d + b

end
12 changes: 12 additions & 0 deletions test/connector_test.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using AtmosphericDeposition
using Test, Unitful, ModelingToolkit, GasChem, Dates, EarthSciMLBase

@testset "Connector" begin
ModelingToolkit.check_units(eqs...) = nothing
start = Dates.datetime2unix(Dates.DateTime(2016, 5, 1))
@parameters t
composed_ode = SuperFast(t) + FastJX(t) + DrydepositionG(t) + Wetdeposition(t)
tspan = (start, start+3600*24*3)
sys = structural_simplify(get_mtk(composed_ode))
@test length(states(sys)) ≈ 18
end
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@ using Test, SafeTestsets
@safetestset "wetdep_test.jl" begin
include("wetdep_test.jl")
end

@safetestset "connector_test.jl" begin
include("connector_test.jl")
end
end
Loading