I’ve been digging a bit further and I think I found answers already.
I read (can’t find the source anymore) that the year in the timestamps is not used so it doesn’t matter that 2016 and 2017 are hardcoded. My point is to ensure simulation calendars will match actual weeks, but there must be another mechanism for this, although I’m confused whether or not this should be addresses by the weather file.
It seems LadyBug can generate files spanning across two years with a max length of one year. So I can simulate a complete heating season (say October to March in northern hemisphere), but not two successive years. While this might be a limitation, it might not be that bad in our case.
However, I’m building the EPW files from real data using from_missing_values which creates Jan-01 -> Dec-31 periods by calling AnalysisPeriod with only is_leap_year as argument. I guess I’ll have to adapt from_missing_values to create arbitrary periods (with the limitation discussed above).
Yes, it’s possible with E+ but it’s intentionally not possible with Ladybug Tools. The value that Ladybug Tools gains by dealing with timeseries data in units of a year (or smaller) is just too great for us to change the Ladybug Tools data structures. EnergyPlus can do it because it’s an engine and it’s primarily concerned with running simulations. It doesn’t have to worry as much about the aftermath of how you analyze, visualize, manage, and usefully interpret the simulation results. But it’s just not worth the sacrifice of analysis capabilities we would have to make in Ladybug Tools to support something like this. We can support leap years (that’s why you have both 2016 and 2017 hard-coded there) but Ladybug Tools data is always in units of a year or smaller.
From another perspective, the ability to simulate a multi-year EPW is also not all that useful to design decisions. I know that the EnergyPlus developers added it primary for validation/calibration purposes and I know this is what you are doing here. But, 99% of the simulations that people run with Ladybug Tools don’t need the results to perfectly match real-world measurements for the first week of January.
In fact, if someone were running a multi-year simulation to inform design decisions, it’s probably more useful to generate a few EPWs (one for each year) and then run a few EnergyPlus simulations for each of the years. At least with that approach, you can run the EnergyPlus simulations in parallel, which could save a lot of time. And, at the end of the simulation, you get results in chunks of a year, which are much easier to manage, analyze, and visualize.
For these few cases where you really need those first few days of the simulation to match reality within a few percent, I don’t think it’s that much to ask you to write your own script that stiches together the annual EPWs that you export from Ladybug. Hopefully, the Ladybug Tools SDK already gets you 90% of the way towards making your own EPWs and writing the “stitching script” to run at the end is not that much of an extra effort. FYI, you can still overwrite the years of the exported EPW by setting the values of the years data collection on the EPW object . So this should get you those starting EPWs in the format you want and it really is a matter of just stitching files together.
I understand that design choice. I’ve been discussing this with our engineers and in fact, this might be more of a theoretical issue. We might have to deal with multi-year simulations but then, as you say, it’s nice already if Ladybug gets us close and we only have a few steps remaining to stitch the files together.
Moving on with Ladybug, I’ve been trying to extend my “one year weather data -> EPW file” tool to manage shorter periods and I’m almost done except I just stumbled upon an exception which seem to mean explicitly that only full year periods can be exported to EPW files.
Can you please clarify whether Ladybug can export files shorter than a full year?
I’ve been overriding EPW.from_missing_values to allow it to create shorter periods (still with full days):
st_month=1, st_day=1, end_month=12, end_day=31,
# Initialize the class with all data missing
epw_obj = cls(None)
epw_obj._is_leap_year = is_leap_year
epw_obj._location = Location()
# create an analysis period
analysis_period = AnalysisPeriod(
Then I got this length error exception while writing the EPW file.
I managed to override to_file_string to reuse the analysis period created in from_missing_values rather than creating an annual analysis period here:
After this, I could output an EPW file, but there is still at least one thing wrong with the generated file as DATA_PERIODS is hard-coded as well:
(New user, can only add two links… Perhaps the forum could accept a regex whitelist including github links.)