-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
JSON (and CBOR/MessagePack) Tabular and Timeseries Outputs #6192
Conversation
Initial time series data in JSON, output using cJSON
Conflicts: CMakeLists.txt src/EnergyPlus/CMakeLists.txt
Conflicts: tst/EnergyPlus/unit/PurchasedAirManager.unit.cc
Conflicts: CMakeLists.txt
# Conflicts: # cmake/CompilerFlags.cmake # src/EnergyPlus/CMakeLists.txt # src/EnergyPlus/EconomicLifeCycleCost.cc # src/EnergyPlus/EconomicTariff.cc # src/EnergyPlus/EnergyPlusPgm.cc # src/EnergyPlus/OutputProcessor.cc # src/EnergyPlus/OutputReportTabular.cc
Had to clear states before test runs.
@mbadams5 it has been 8 days since this pull request was last updated. |
This is a hacky fix but I don't have time to investigate a proper fix at this point.
@Myoldmopar @mjwitte I think this is nearly done. The encoding fixes I did on the inputs side were needed on the outputs side as well, as I have mentioned previously. One remaining issue that is solvable, but I don't particularly want to do it in this PR, is when the weather stats file has a different encoding than UTF-8. Many (or all) of the included stats files in the weather directory are HTML output with HTML output with Note the bad encoding of the degree symbol for latitude and longitude. Also all the lines related to Köppen classification and ASHRAE Handbook CDD/HDD are missing with the It can't find the Köppen classification because it is searching the |
For this particular table, it seems worthwhile to work around it. Would it work to search just parts of the string, leaving out the offending characters, and then output the full utf-8 string, not what's in the stat file? In fact, I'd prefer to see the line show up in the table with a blank value even if the data isn't found in the stat file. |
@mjwitte I get that, but this isn't specific to this PR. I just compiled develop which has the stat file at Stat: Stat: |
@mbadams5 Sure, it can be a separate issue to make this table more robust, just do the right thing here for now and post a followup. |
@mbadams5 I pulled this locally, merged in latest develop, and am going to test it out. I am in the process of pointing E+ CI to the updated regression scripts, so that UTF-8 issue should go away very soon. Other than some final testing, are you ready for this to go in? @mjwitte anything else on your end? |
@Myoldmopar The only part of this I've looked at/commented on is the encoding issue related to the Climatic Data Summary noted above. I've posted #7102 as a followup issue to fix this. |
I just ran the UTF8 test file on the new regression scripts with this branch and develop and it passes nicely. Which means that once CI is totally using the new scripts (later this week - maybe tomorrow), that error will go away. Nothing to be concerned about with this branch. Otherwise this branch seems OK. I'll do a final pass over the code and confirm it on the call in a few minutes before merging. |
@mbadams5 I tried this out this morning. I pulled latest develop in and re-built. I'll put some findings here as I go.
Spot checked some results and everything looks good and ran well. I think this is ready to drop in if you can address that issue. I'm still perusing the code one final time right now but it's good so far. |
@Myoldmopar I just pushed up a fix. See if that works. |
Pulled, built, and tested. JSON now outputs properly even if nothing is entered for field A2. I also reported cbor outputs, and imported them in python using a cbor package. It looks good when reported back out as normal JSON. I am happy with this. I will let CI have a pass over it this afternoon and if it looks good, I'll merge it in. Thanks @mbadams5 ! |
All green! Merging. |
The link goes to a page that says "There isn’t anything to compare." Is there an updated way to do that? |
Pull request overview
This PR is dependent on #5893 going in first since this is built off that branch. The following link provides a more accurate comparison of the features in this specific PR, seen here.
This PR adds JSON outputs for Tabular and Timeseries outputs. Due to the JSON library we are using for the JSON input processing, we can also output CBOR and MessagePack binary formats. Both of these formats provide faster serialization/deserialization and much smaller file sizes.
The JSON output format was built off of work completed a couple years ago and updated to current EnergyPlus source code and JSON library.
Running the Outpatient Reference Model for an annual simulation has the following file sizes:
eplusout.mtr - 2.1M
eplusmtr.csv - 1.6M
eplusout.eso - 31M
eplusout.csv - 24M
eplusout.sql - 31M
eplusout_hourly.json - 42M
eplusout_hourly.cbor - 12M (~71% reduction to JSON, 50% compared to CSV)
eplusout.json - 5.0M
eplusout.cbor - 1.2M (76% reduction)
Work Checklist
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
Review Checklist
This will not be exhaustively relevant to every PR.