diff --git a/src/streams.jl b/src/streams.jl index 78b9c44..8f8f2f7 100644 --- a/src/streams.jl +++ b/src/streams.jl @@ -569,7 +569,7 @@ name of the component. """ function readstreamhistory!(fs, streamname, filename; ismoleflow=false) - data, header = readdlm(filename, ',', '\n', header=true) + data, header = readdlm(lowercase(filename), ',', '\n', header=true) comps = string.(header[2:end]) # readdlm returns an array of AbstractStrings for some reason flows = data[:, 2:end] timestamps = DateTime.(data[:, 1], "yyyy/mm/dd HH:MM") @@ -590,9 +590,9 @@ Writes in a stream history file (CSV file). """ function writestreamhistory(stream, filename, moleflow=false) if moleflow - writetimearray(stream.moleflows, filename, format="yyyy/mm/dd HH:MM", delim=',') + writetimearray(stream.moleflows, lowercase(filename), format="yyyy/mm/dd HH:MM", delim=',') else - writetimearray(stream.massflows, filename, format="yyyy/mm/dd HH:MM", delim=',') + writetimearray(stream.massflows, lowercase(filename), format="yyyy/mm/dd HH:MM", delim=',') end return nothing diff --git a/test/components/Argon.comp b/test/components/Argon.comp deleted file mode 100644 index f6e1f13..0000000 --- a/test/components/Argon.comp +++ /dev/null @@ -1,5 +0,0 @@ -Argon -1 -Ar -1 -39.948 \ No newline at end of file diff --git a/test/components/Nitrogen.comp b/test/components/Nitrogen.comp deleted file mode 100644 index 36596ee..0000000 --- a/test/components/Nitrogen.comp +++ /dev/null @@ -1,5 +0,0 @@ -Nitrogen -1 -N -2 -28.0134 \ No newline at end of file diff --git a/test/runtests.jl b/test/runtests.jl index c9c0ee1..e5caed8 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3,6 +3,27 @@ using Test @testset "Streams" begin fs = Flowsheet() + + @comp begin + "C" --> 2 + "H" --> 4 + end "Ethylene" fs + dummy = writecomponent(joinpath(@__DIR__, "components", "Ethylene.comp"), fs.comps["Ethylene"]) + @test dummy == 25 + + @comp begin + "C" --> 2 + "H" --> 6 + end "Ethane" fs + dummy = writecomponent(joinpath(@__DIR__, "components", "Ethane.comp"), fs.comps["Ethane"]) + @test dummy == 24 + + @comp begin + "H" --> 2 + end "Hydrogen" fs + dummy = writecomponent(joinpath(@__DIR__, "components", "Hydrogen.comp"), fs.comps["Hydrogen"]) + @test dummy == 21 + count = readcomponentlist!(fs, joinpath(@__DIR__, "components"), ["Ethylene", "Ethane", "Hydrogen"]) @test count == 3 @test fs.comps["Ethylene"].Mr ≈ 28.053