Skip to content

Commit

Permalink
Merge pull request #10 from PALEOtoolkit/test_fixes
Browse files Browse the repository at this point in the history
Test fixes following SolverView move PALEOboxes -> PALEOmodel
  • Loading branch information
sjdaines authored Jun 25, 2022
2 parents 6c89c34 + 8297448 commit 8e3c068
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
11 changes: 6 additions & 5 deletions test/forcings/PlotForcings.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"\n",
"# activate the correct environment\n",
"import Pkg\n",
"# assuming we are in PALEOcopse/test/forcings, activate PALEOreactions environment\n",
"# assuming we are in PALEOcopse/test/forcings, activate PALEOcopse environment\n",
"Pkg.activate(joinpath(pwd(), \"../../\"))\n",
"\n",
"# activate the test environment (for additional packages, plots etc)\n",
Expand All @@ -42,6 +42,7 @@
"source": [
"\n",
"import PALEOboxes as PB\n",
"import PALEOmodel\n",
"import PALEOcopse\n",
"\n",
"using DataFrames\n",
Expand All @@ -68,7 +69,7 @@
"modeldata = PB.create_modeldata(model)\n",
"PB.allocate_variables!(model, modeldata)\n",
"\n",
"PB.set_default_solver_view!(model, modeldata)\n",
"PALEOmodel.set_default_solver_view!(model, modeldata)\n",
"\n",
"@PB.TestUtils.check_true PB.check_ready(model, modeldata)"
]
Expand Down Expand Up @@ -284,7 +285,7 @@
"plotdata = Matrix(df[!, fieldnames])\n",
"labeldata = hcat(fieldnames...) # convert Vector{String} to Array{String,2}\n",
"\n",
"show(plot(df.tforce, plotdata, labels=labeldata))"
"plot(df.tforce, plotdata, labels=labeldata)"
]
},
{
Expand Down Expand Up @@ -314,15 +315,15 @@
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.7.0",
"display_name": "Julia 1.7.3",
"language": "julia",
"name": "julia-1.7"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.7.0"
"version": "1.7.3"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions test/forcings/runforcingtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using NBInclude
using Plots

import PALEOboxes as PB

import PALEOmodel
import PALEOcopse

@testset "Forcings" begin
Expand All @@ -27,7 +27,7 @@ import PALEOcopse
# state and sms variables
PB.allocate_variables!(model, modeldata, hostdep=true)
@test PB.check_ready(model, modeldata) == true
PB.set_default_solver_view!(model, modeldata) # also (re)allocates tforce
PALEOmodel.set_default_solver_view!(model, modeldata) # also (re)allocates tforce

modelcreated_vars_dict = Dict([(var.name, var) for var in PB.get_variables(global_domain, hostdep=false)])

Expand Down
5 changes: 3 additions & 2 deletions test/global/runtemperaturetests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Test

import PALEOboxes as PB
import PALEOmodel
import PALEOcopse

@testset "GlobalTemperature" begin
Expand All @@ -19,7 +20,7 @@ import PALEOcopse
@test PB.check_ready(model, modeldata, throw_on_error=false) == false
# allocate state and sms variables
PB.allocate_variables!(model, modeldata, hostdep=true)
PB.set_default_solver_view!(model, modeldata)
PALEOmodel.set_default_solver_view!(model, modeldata)
@test PB.check_ready(model, modeldata) == true

# get modelcreated variables
Expand All @@ -37,7 +38,7 @@ import PALEOcopse
PB.dispatch_setup(model, :setup, modeldata)
# Initialise state variables to norm_value
PB.dispatch_setup(model, :norm_value, modeldata)
PB.copy_norm!(modeldata.solver_view_all)
PALEOmodel.copy_norm!(modeldata.solver_view_all)
# Initialise state variables etc
PB.dispatch_setup(model, :initial_value, modeldata)

Expand Down

2 comments on commit 8e3c068

@sjdaines
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/63101

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.0 -m "<description of version>" 8e3c06889e67ecdfdc13e7160a712034457577d1
git push origin v0.3.0

Please sign in to comment.