E+ scripting using epJSON file format
Project description
eppy3000
E+ scripting using epJSON file format
Free software: Mozilla Public License, v. 2.0
Documentation: https://eppy3000.readthedocs.io.
Home Page: https://github.com/pyenergyplus/eppy3000
Features - so far :-)
Background
E+ has been moving from the IDD/IDF text format to a JSON format. Eppy reads the old IDD/IDF format. There is a need to have eppy read the JSON format and/or have a new package that will read the JSON format.
Whats in a name
Why is this package called eppy3000 ?
It is a play on the word python3000. Guido van van Rossum said about python in 2007 “The first time I came up with the idea of Python 3000 was probably at a Python conference in the year 2000. The name was a take on Windows 2000. …<snip>… The idea was that Python 3000 would be the first Python release to give up backwards compatibility in favor of making it the best language going forward.”
Eppy3000 will also break backward compatibility with eppy. Also eppy3000 will be written only for python3. Eppy3000 and eppy will continue to remain the best scripting language for modelling :-)
So what is eppy3000
This project is an attempt to read JSON file formats and work like eppy. There is some value in trying to do this from scratch. The dot syntax that makes the original eppy useful can be recreated with a couple of lines in eppy3000. It took a lot of deep hacking to make the dot syntax work in the original eppy. Eppy3000 reads the JSON format as a dictionary. The package Munch (what was Bunch) allows the use of dot format syntax with a dictionary. The code is as simple as:
as_json = json.load(open(fname, 'r')) for_dot_syntax = DefaultMunch.fromDict(as_json)
At this point eppy3000 is an exploration to find out what is possible. The API in eppy3000 will not be stable as we explore the possibilities. So, don’t use it as production code yet :-)
What about eppy
Eppy will be continue to be developed and maintained. A major task will be to make eppy read the new JSON formats. Initial investigations shows that it is not too hard to develop this functionality. Internally eppy will continue to use the old format. Hopefully this will make the JSON reading functionality trivially easy. At the moment, E+ maintains a one to one mapping between the old IDD/IDF format and the new JSON format. This mapping is embedded in the file Energy+.schema.epJSON, pointing to an easy compatibility strategy.
In the long term, this may not be a viable strategy, as E+ may totally abandon the IDD/IDF file format breaking the link between JSON and IDD/IDF. Discussion thread at unmethours seems to indicate that this is about 5 yers in the future.
Future possibilites
A number of possibilites came up in discussions at Simbuild 2018 in Chicago. The biggest takeaway was that the code base for the JSON format and the dot syntax can lead to a universal translator between modelling file formats. The thinking here is that if there exists a schema.JSON for two modelling file structures, the possibility of translating between the two exists.
Of course the proof is in the pudding. So we are going to write some quick and dirty translators between E+ and DOE2.1E (or EQuest) as well as between the older idds and the new epJSON. Lets see how that goes.
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
Releases
0.1.1 (2019-06-06)
2019-06-06
- functions to read and write IDF files
issue #20
0.1.0 (2018-10-15)
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for eppy3000-0.1.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78b369e2b9f7e0a2fefc840a7c71b4ead34859421570c2fb09d24a43dd1fb181 |
|
MD5 | a4125e34303e7b2b7437e98b2a232c32 |
|
BLAKE2b-256 | 91a28750ce2714caedb007b32081455a956ed1404cb46a91ab13b8c1ee04cfc8 |