First time here? Check out the Help page!
1 | initial version |
I agree with the above, but there are other options as well, which you might find either easier or more flexible:
"Schedule:Constant, heating_sch, !- Name Temperature, !- Schedule Type Limits Name {htg_stpt}; !- Hourly Value"
You need to be a little careful with this, though, because IDFs also use the "{ }" characters to define units. So, everywhere EnergyPlus uses "{ }" to define units, I just change them to "{{" and "}}". That way Python will not try to interpret the units as f-strings as well.
I have an open source project on GitHub called REEDR (https://github.com/PtarmiganConsulting/REEDR) that is essentially all Python code to build and run IDF files. If you look at the file "genmodels.py", you can see where I use the f-string trick, because it will look like this:
"with open(TextFile, 'r') as f: TextString = f"{f.read()}".format(**locals())"
This code opens a text file, substitutes any f-strings you have defined, and saves it to a new text string. You can then save this new text string as a new IDF file, which you would pass to your subprocess command.
2 | No.2 Revision |
I agree with the above, but there are other options as well, which you might find either easier or more flexible:
"Schedule:Constant,
Schedule:Constant,
heating_sch, !- Name
You need to be a little careful with this, though, because IDFs also use the "{ }" characters to define units. So, everywhere EnergyPlus uses "{ }" to define units, I just change them to "{{" and "}}". That way Python will not try to interpret the units as f-strings as well.
I have an open source project on GitHub called REEDR (https://github.com/PtarmiganConsulting/REEDR) that is essentially all Python code to build and run IDF files. If you look at the file "genmodels.py", you can see where I use the f-string trick, because it will look like this:
"with
with
open(TextFile, 'r') as f:
This code opens a text file, substitutes any f-strings you have defined, and saves it to a new text string. You can then save this new text string as a new IDF file, which you would pass to your subprocess command.