Open joseph-robertson opened 1 month ago
After a bit of digging, it appears that realYear
(and therefore epw.isActual
) gets set to false
here since we have a delta greater than 1 day in the epw file. I'm assuming this works as intended for TMY where months jump years.
Therefore we fall into this block instead of this one.
If epw.isActual
were set to true
, is the issue resolved here? If so, perhaps we could provide some type of override on isActual
(either in the epw ctor, or as a setter somewhere)?
Ah ha, here's the core issue. For all 3 of the above scenarios, m_data
has dateTimes that look like:
2012-Feb-28 20:00:00
2012-Feb-28 21:00:00
2012-Feb-28 22:00:00
2012-Feb-28 23:00:00
2012-Feb-29 00:00:00 => Bad Date: year = 2009, month = Feb(2), day = 29.
2012-Mar-01 01:00:00
2012-Mar-01 02:00:00
2012-Mar-01 03:00:00
2012-Mar-01 04:00:00
This is the line that fails. The assumedYear in the Data ctor here is 2009, and so fails on the line above.
Why doesn't the EpwDataPoint have a dateTime of 2012-Mar-01 00:00:00
instead of 2012-Feb-29 00:00:00
?
Answer:
pt = OpenStudio::EpwDataPoint.fromEpwStrings(2012, 2, 28, 24, 0, ["foo"] * 35)
pt.dateTime => 2012-Feb-29 00:00:00
CI Results for 17d344f9327a96d078cc0a19ac0ac63ecc9f1c2c:
Ubuntu 20.04:
Ubuntu 22.04:
Darwin:
Windows:
Code Coverage:
The fix looks good. I tried it on Windows with a couple of different weather files that had the issue before and everything seems to work. Thanks for resolving this.
Pull request overview
As far as I can tell, the
Bad Date: year = 2009, month = Feb(2), day = 29.
error is thrown for each of the following scenarios:Possible solutions:
isActualOverride
bool supplied toEpwFile::getTimeSeries
(demonstrated in this PR)m_data
to change xxxx-Feb-29 00:00:00 to xxxx-Mar-01 00:00:00 for TMY with leap FebPull Request Author
src/model/test
)src/energyplus/Test
)src/osversion/VersionTranslator.cpp
)Labels:
IDDChange
APIChange
Pull Request - Ready for CI
so that CI builds your PRReview Checklist
This will not be exhaustively relevant to every PR.