Skip to content

Commit

Permalink
Surrogate i.o Surogate
Browse files Browse the repository at this point in the history
  • Loading branch information
TimSlendebroek committed Sep 25, 2024
1 parent 59b8b93 commit cdd551f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name = "BalanceOfPlantSurogate"
name = "BalanceOfPlantSurrogate"
uuid = "001e48cb-5a1e-4e3c-a5d4-cdc3aa14f3de"
authors = ["TimSlendebroek <[email protected]>"]
version = "2.0.0"
Expand Down
4 changes: 2 additions & 2 deletions data/tests_generate_hypercube.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using Test
using Pkg
using BalanceOfPlantSurogate
using BalanceOfPlantSurrogate

using Pkg.activate(@__DIR__)

@testset "BalanceOfPlantSurogate Tests" begin
@testset "BalanceOfPlantSurrogate Tests" begin
include(joinpath(@__DIR__,"generate_hypercube.jl"))
hyper_cube = generate_hypercube()
@assert !isempty(hyper_cube.cases)
Expand Down
6 changes: 3 additions & 3 deletions src/BalanceOfPlantSurogate.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module BalanceOfPlantSurogate
module BalanceOfPlantSurrogate

const __BalanceOfPlantSurogate__ = abspath(joinpath(@__DIR__, ".."))
const __BalanceOfPlantSurrogate__ = abspath(joinpath(@__DIR__, ".."))

include("model.jl")

end # module BalanceOfPlantSurogate
end # module BalanceOfPlantSurrogate
2 changes: 1 addition & 1 deletion src/model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mutable struct BOPSurogate
end

function BOPSurogate(cycle_type::Symbol; data::String="BalanceOfPlantHypercubeN=10000.csv")
df = DataFrames.DataFrame(CSV.File(joinpath(BalanceOfPlantSurogate.__BalanceOfPlantSurogate__, "data", data)))
df = DataFrames.DataFrame(CSV.File(joinpath(BalanceOfPlantSurrogate.__BalanceOfPlantSurrogate__, "data", data)))
df = filter(row -> row.cycle_type == string(cycle_type), df)

sort!(df, [:diverter_heatload, :breeder_heat_load, :total_power])
Expand Down
8 changes: 4 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Test
using BalanceOfPlantSurogate
using BalanceOfPlantSurrogate

@testset "BalanceOfPlantSurogate" begin
@testset "BalanceOfPlantSurrogate" begin
for cycle in [:rankine, :brayton]
BOPSur = BalanceOfPlantSurogate.BOPSurogate(cycle)
@assert !isnan(BalanceOfPlantSurogate.predict_thermal_efficiency(BOPSur,1e7,0.9,0.1))
BOPSur = BalanceOfPlantSurrogate.BOPSurogate(cycle)
@assert !isnan(BalanceOfPlantSurrogate.predict_thermal_efficiency(BOPSur,1e7,0.9,0.1))
end
end

0 comments on commit cdd551f

Please sign in to comment.