Skip to content

Commit

Permalink
bug fix in interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
kaarthiksundar committed Sep 16, 2020
1 parent cc2e6ce commit 91f4f5e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

## Pending

## v0.8.1

## v0.8
- bug fix in interpolation

## v0.8

- strengthen variable bounds for resistors and loss resistors
- compressors are made optional components
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = "GasModels"
uuid = "5e113713-6c35-5477-b766-e1109486666f"
authors = ["Russell Bent <[email protected]>", "Kaarthik Sundar <[email protected]>", "David Fobes <[email protected]>"]
repo = "https://github.com/lanl-ansi/GasModels.jl.git"
version = "0.8.0"
version = "0.8.1"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
29 changes: 28 additions & 1 deletion src/io/transient.jl
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,33 @@ at least 4 time series data points are available (and result in an error otherwi
push!(time_series_block[type][id][param], itp_val)
end
end

_fix_time_series_block!(time_series_block)
return time_series_block
end

function _fix_time_series_block!(block)
for (i, val) in get(block, "transfer", [])
if haskey(val, "withdrawal_max")
val["withdrawal_max"] = max.(val["withdrawal_max"], zeros(length(val["withdrawal_max"])))
end
if haskey(val, "withdrawal_min")
val["withdrawal_min"] = min.(val["withdrawal_min"], zeros(length(val["withdrawal_min"])))
end
end
for (i, val) in get(block, "delivery", [])
if haskey(val, "withdrawal_max")
val["withdrawal_max"] = max.(val["withdrawal_max"], zeros(length(val["withdrawal_max"])))
end
if haskey(val, "withdrawal_min")
val["withdrawal_min"] = min.(val["withdrawal_min"], zeros(length(val["withdrawal_min"])))
end
end
for (i, val) in get(block, "receipt", [])
if haskey(val, "injection_max")
val["injection_max"] = max.(val["injection_max"], zeros(length(val["injection_max"])))
end
if haskey(val, "injection_min")
val["injection_min"] = min.(val["injection_min"], zeros(length(val["injection_min"])))
end
end
end

2 comments on commit 91f4f5e

@kaarthiksundar
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@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/21494

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.8.1 -m "<description of version>" 91f4f5ed532b22b8b9c12536672c5d486987ade2
git push origin v0.8.1

Please sign in to comment.