-
Notifications
You must be signed in to change notification settings - Fork 43
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
make sure that years are not lost when reading in worldsteel #431
Conversation
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.
Do you know since when this failed?
In the spirit of more functional programming, I would have gone with
pivot_longer(c(-'country', -'name'), names_to = 'year',
names_transform = list(year = function(x) {
as.integer(sub('^X', '', x)) }))
but you do you.
@@ -51,6 +51,8 @@ calcIEA_EVOutlook <- function() { | |||
# set 0s in other CHA countries than China to approximate CHA as China | |||
x[c("HKG", "MAC", "TWN"),,] <- 0 | |||
|
|||
x <- add_dimension(x, dim = 3.1, add = "scenario", nm = "historical") |
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.
Sorry, sneaked in another minor fix.
I went with your solution, as it matches the overall coding style of this function and looks more elegant.
I am not sure. My theory is that it was hidden behind caching of calcHistorical until yesterday, when I made changes in that calc function, causing recalculations that revealed this problem. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #431 +/- ##
======================================
Coverage 0.00% 0.00%
======================================
Files 265 265
Lines 17282 17285 +3
======================================
Hits 1 1
- Misses 17281 17284 +3
☔ View full report in Codecov by Sentry. |
OK, that makes sense. I was under the erroneous impression that |
In theory, it should. So my theory is actually that it should have noticed changes when it did not. But in order to confirm that suspicion, I'd have to do some more experiments and dig deeper. |
Is that a positive or a normative statement? :p The code only checks for readSource/calcOutput and tool functions. |
What I have learnt from asking around over the years (but not validated by looking at the code): if you only changed the underlying file But this does not explain why a change in |
Are we talking about the same thing? There was a change in the (upstream)
The
And it at least claims that changes to the source directory do affect the caching:
But the hashes are calculated based on file names and the first 300 bytes of the files, which might work on binaries, or might not.
Three theories:
|
Thanks for pointing out that file changes do indeed affect the caching, wasn't aware. |
Currently input data generation fails because years are lost when reading in worldsteel. Expects column names as numbers, but they are read in as X2005, X2010 ...