-
Couldn't load subscription status.
- Fork 0
Result store update #18
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
Conversation
rename append_all_results! to concat_results! and preallocate_append to preallocate_concat
| ```julia | ||
| count::Float64 = @getRME ivOutplantCountPerM2("iv_name"::Cstring)::Cdouble. | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @DanTanAtAims what's the difference between the two below?
@getRME ivOutplantCountPerM2("iv_name"::Cstring)::Cdouble
# and
@RME ivOutplantCountPerM2("iv_name"::Cstring)::Cdouble
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second will error out when there was no error. In the RME macro
macro RME(func)
local m = esc(Meta.parse("@ccall RME.$(func)"))
return quote
local err = $m
----> if !(typeof(err) <: Cstring) && err != 0 && !(typeof(err) <: Cvoid) # <--- this condition prevents function calls that return numbers to fail.
local err_msg = @ccall RME.lastError()::Cstring
throw(ArgumentError("Call to RME failed with message: $(unsafe_string(err_msg))"))
end
...
end
endThe conditions of the if statement are evaluated as follows for getters that return numeric, non-error values
!(Cdouble <: Cstring) (true)
err != 0 (true) # Importantly no error has occurred.
!(typeof(err) <: Cvoid) (true)So we enter the error if block. We should only use the new macro @getRME when we have no choice as we lose the safety of the error checking in the original macro.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, obvious now, sorry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very last comment to address Dan, thank you.
docs/src/getting_started.md
Outdated
|
|
||
| # Collect and store all results, where `reps` is the total number of expected runs. | ||
| collect_all_results!(result_store, start_year, end_year, reps) | ||
| append_all_results!(result_store, start_year, end_year, reps) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These examples need to be updated
src/ReefModEngine.jl
Outdated
| # Examples | ||
| ```julia | ||
| count::Float64 = @getRME ivOutplantCountPerM2("iv_name"::Cstring)::Cdouble |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more - update example variable as count is also a function.
| count::Float64 = @getRME ivOutplantCountPerM2("iv_name"::Cstring)::Cdouble | |
| count_per_m2::Float64 = @getRME ivOutplantCountPerM2("iv_name"::Cstring)::Cdouble |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @DanTanAtAims
Update result store to use YAXArrays and NetCDF.
After each counterfactual and intervention run call.
This will add the results to the YAXArray dataset and add rows to the scenario DataFrame reflecting scenario intervention factors.