Skip to content
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

Zeroes getting returned from fetchvars #591

Closed
bpbond opened this issue Mar 23, 2022 · 4 comments · Fixed by #605
Closed

Zeroes getting returned from fetchvars #591

bpbond opened this issue Mar 23, 2022 · 4 comments · Fixed by #605
Assignees
Milestone

Comments

@bpbond
Copy link
Member

bpbond commented Mar 23, 2022

Uh oh, I have a suspicion that my #496 may have broken fetchvars — although if that's the case don't know why tests didn't flag the issue! @leeyap and @BennettForville found

> library(hector)
> RCP45 <- system.file("input/hector_ssp245.ini", package = "hector")
> core45 <- newcore(RCP45)
> reference <- fetchvars(core45, NA)
> head(reference)
             scenario year variable  value    units
1 Unnamed Hector core   NA       Ca 277.15 ppmv CO2
2 Unnamed Hector core   NA     Ftot   0.00     W/m2
3 Unnamed Hector core   NA     FCO2   0.00     W/m2
4 Unnamed Hector core   NA     Tgav   0.00     degC

which doesn't look good.

@bpbond bpbond self-assigned this Mar 23, 2022
@bpbond
Copy link
Member Author

bpbond commented Mar 24, 2022

nm 😳

@bpbond bpbond closed this as completed Mar 24, 2022
@bpbond
Copy link
Member Author

bpbond commented Mar 24, 2022

Reopening. This is confusing behavior and should be fixed to warn, error, something.

@bpbond bpbond reopened this Mar 24, 2022
@bpbond
Copy link
Member Author

bpbond commented Apr 3, 2022

More fetchvars bad behavior:

> library(hector)
> hc <- newcore("./inst/input/hector_ssp245.ini")
> run(hc)
Hector core:	Unnamed Hector core
Start date:	1745
End date:	2300
Current date:	2300
Input file:	/Users/bpbond/Dropbox/Documents/Work/Code/hector/inst/input/hector_ssp245.ini
> x <- fetchvars(hc, dates = NA)
> x
             scenario year variable      value    units
1 Unnamed Hector core   NA       Ca 503.744948 ppmv CO2
2 Unnamed Hector core   NA     Ftot   3.906607     W/m2
3 Unnamed Hector core   NA     FCO2   3.363304     W/m2
4 Unnamed Hector core   NA     Tgav   2.768967     degC

(These are the 2300 values.)

This is not at all what the documentation says ("Set to NA to return data with no associated dates such as model parameters").

@bpbond
Copy link
Member Author

bpbond commented Apr 3, 2022

☝️ re the zeroes, this is correct behavior. An un-run model is at 1/1/1745 (cf. #177 ) and the Ftot, FCO2, and Tgav are all zero. (And with the year fixed so it's correctly showing 1745 — see #604 — I think clear.)

@bpbond bpbond linked a pull request Apr 3, 2022 that will close this issue
@bpbond bpbond added this to the v3.0 milestone Apr 3, 2022
@bpbond bpbond closed this as completed Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant