[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EnergyPlus_Support] Re: Way forward on writing Perl scripts for Energy Plus



A few posts earlier in this thread mentioned an interest in a shared repository for scripts to create/manipulate IDF files. You may want to consider the Building Component Library (BCL). Initially created as a place to share energy modeling components, it has been expanded to contain energy conservation measures, and it now accepts user content. Instead of a block of text representing a schedule, or construction, a measure is a set of instructions on how to create or manipulate a model. For example - finding all building shading surfaces and adding simple PV objects, with a number variables exposed as arguments such as the fraction of a surface containing PV and cell efficiency. Using these measures require OpenStudio to be installed on your machines, but measures can be written to operate on either OSM or IDF files. So you can use this without ever making an OSM file. Our ruby based measures can be used in OpenStudio GUIs as well as by command line. They are intended to be sharable reusable blocks that can be strung together to create complex workflows for automated modeling or parametric analysis.

While the OpenStuido GUI's uses measures written in ruby, and that is what we support on BCL; OpenStudio does have experimental python bindings. The python bindings are not currently in our installer, so you have to build the software if you want to use them. The python bindings can access the same methods that ruby can, there just isn't testing for them. If you want to use python instead of ruby you can write scripts that you can run via command line or your own GUI's, however OpenStudio's GUI's won't recognize them. Before you dismiss using ruby though, it is worth noting that you really don't need to know that many ruby methods to write measures. You need to make arrays, create variables, if statements, and loops. Beyond that maybe some basic math and string methods, if your measures needs them. By using measures instead of unstructured scripts, OpenStudio handles file management, so you don't need to know  ruby file management methods. To apply the measures you don't even need to know ruby or use a command line. The OpenStudio GUI's  display measure arguments as text fields, pull-down lists, and check-boxes. It is a very polish experience for the user.

Below is a link the an example EnergyPlus measure. It includes a test directory that can run the measure via command line. We don't have many measure on BCL yet, but it we will be continually adding our own, and expect other users will be adding some as well.
https://bcl.nrel.gov/node/37368

David

--
David Goldwasser, LEED AP
National Renewable Energy Laboratory
david.goldwasser@xxxxxxxx


--- In EnergyPlus_Support@xxxxxxxxxxxxxxx, Marcus <jones.0bj3@...> wrote:
>
> Hi all,
> 
> There are people actively working on exactly this topic; to promote Python
> scripting for Building Performance Simulation (BPS). We held a workshop at
> the Building Simulation conference last week with over 15 students. We
> discussed issues such as "why python and not some other language", and then
> presented basic syntax, followed by more in-depth examples. There are
> several reasons why I think Python is the best language for E+ users, the
> strongest is that there are many modules for engineers which make life
> easy, see for example http://www.scipy.org/.
> 
> We do plan on addressing the lack of high quality scripts for the BPS
> community.
> 
> All of this workshop material will be posted as we aim to create a portal
> where people can link in their projects and get basic tutorials and help.
> The site is http://www.pythonpoweredbuilding.com/ and you can get involved
> also by contacting us at info@... The site is quite
> empty so far since we were focused 100% on the workshop, but it will be
> developed over the coming months!
> 
> Cheers,
> Marcus
> 
> 
> 
> 
> On Fri, Sep 6, 2013 at 10:39 PM, Vaib <vaibhav.energyarchitect@...>wrote:
> 
> > **
> >
> >
> > I second with Python as I also have used it for post processing of E+
> > outputs to make sense out of it. Also Shell scripting in Linux is very
> > powerful. It makes life much easier. Also recently, in our university we
> > used Matlab (mainly for modeling a thermal comfort model). There I came
> > across a Matlab library from TU-Eindhoven which they ask to be only used
> > for educational purposes. I am not sure if its allowed to be shared. But I
> > do appreciate the idea of open source sharing of scripts in building
> > science industry.
> >
> > Vaibhav
> >
> >
> > On 6 September 2013 09:15, Yi Zhang <yizhang@...> wrote:
> >
> >> **
> >>
> >>
> >>  Interesting discussions! It seems Python is the unstoppable trend. And
> >> indeed if we all use the same language, it will help form an open-source
> >> community. On the other hand, I have to say that a few of the earlier
> >> comments disregarding the vast amount of effort the E+ community are making
> >> toward openness hurts a bit. OpenStudio, GenOpt, E+ itself and many more
> >> other tools are open source?****
> >>
> >> ** **
> >>
> >> Going back to your original question, Javed, what are the functions you
> >> need but cannot get from existing tools? I think how to choose a language
> >> depends on what you need to do, and what the existing tools you want to use?
> >> ****
> >>
> >> ** **
> >>
> >> Yi****
> >>
> >> ** **
> >>
> >> *From:* EnergyPlus_Support@xxxxxxxxxxxxxxx [mailto:
> >> EnergyPlus_Support@xxxxxxxxxxxxxxx] *On Behalf Of *Javed Iqbal
> >> *Sent:* 06 September 2013 07:57
> >> *To:* EnergyPlus_Support@xxxxxxxxxxxxxxx
> >> *Subject:* Re: [EnergyPlus_Support] RE: Way forward on writing Perl
> >> scripts for Energy Plus****
> >>
> >> ** **
> >>
> >>   ****
> >>
> >> Thanks Murat.****
> >>
> >> ** **
> >>
> >> If Python has direct implications on EnergyPlus then I'm OK with this. It
> >> would be great if you can share your experience on Python. Some resource
> >> sharing would be really helpful.****
> >>
> >> ** **
> >>
> >> Thanks again!****
> >>
> >> ** **
> >>
> >> On Fri, Sep 6, 2013 at 12:09 PM, <mtologlu@...> wrote:****
> >>
> >>   ****
> >>
> >> I say Python, too.****
> >>
> >> ** **
> >>
> >> I am new to E+ and already was looking for a way to switch from Ruby to
> >> Python because I already have a Python background and I don't want to learn
> >> a new language.****
> >>
> >> I was just thinking about finding (or writing) Python scripts equivalent
> >> to ModelToRad.rb DaylightSim.rb etc. for Radiance functionality. ****
> >>
> >> ** **
> >>
> >> If you decide Python then we can share our experience.****
> >>
> >> ** **
> >>
> >> By the way, I appreciate very much to receive advise on how to reach
> >> sources of existing Python scrips for E+ and Python E+ scripting examples.
> >> ****
> >>
> >> ** **
> >>
> >> Kind regards,****
> >>
> >> Murat Tologlu, M.Sc.EE****
> >>
> >> Engineering & Business Consultant****
> >>
> >> Renewable Energies, EE and Power Technique****
> >>
> >> ** **
> >>
> >> ** **
> >>
> >>
> >>
> >> --- In energyplus_support@xxxxxxxxxxxxxxx, <eee.javed@> wrote:****
> >>
> >> Thanks everyone for their valuable comments.****
> >>
> >> ** **
> >>
> >> I'm still in a beginning stage before i decide what to go with, Perl or
> >> Python. My idea is to get feedback from experienced energy modelers on the
> >> way forward. ****
> >>
> >> ** **
> >>
> >> I'm still open to get more comments which will eventually help me to
> >> choose a tool which will best serve my purpose.****
> >>
> >> ** **
> >>
> >> Thanks again!****
> >>
> >> ** **
> >>
> >> ** **
> >>
> >> On Thu, Sep 5, 2013 at 11:14 PM, Chien Si Harriman <chien.harriman@>
> >> wrote:****
> >>
> >>    ****
> >>
> >> Thanks everyone for their comments.  I didn't know about some of these
> >> things.  Now, I have to ask Edwin.  If it is so cool, why does no one do
> >> it?  I'm guessing because people are afraid to share it.  It is a shame,
> >> because I imagine that if the industry could rely on some open source
> >> stuff, that would be helpful for everybody in really profound ways.  I am
> >> not sure why we don't embrace it because we are the perfect candidates.
> >>  Never enough time or money, a really complex project, lots of data...not
> >> sure why it doesn't resonate and there is not already a serious movement
> >> towards open source.  It should be more than just cool to post stuff and
> >> have people look at it.  It should be full community engagement with a
> >> leader and deep conversations.  Writing a text file is not that difficult,
> >> which is why I love energy plus.  I'm sure lots of people have worked on
> >> pieces of code to do it.  So I have to lead myself to the conclusion that
> >> the community doesn't know how to engage each other on this issue or
> >> generally feels threatened or worried to give stuff away.  I do not know of
> >> a single open source repository for code to create idf files.  I do know
> >> there is an open source fork of energy plus and Big Ladder works a lot on
> >> that.****
> >>
> >> ** **
> >>
> >> Is there anyone out there who really believes in open source on this
> >> email thread?  Can anyone even cite the mantras of Linus Torvold?  I know I
> >> am getting nerdy here, and I don't mean to p- anyone off.  Trying to do the
> >> opposite actually.  Would the community benefit from an open-source type of
> >> mindset, and is anyone actually brave enough to post all their hard work on
> >> sourceforge?****
> >>
> >> ** **
> >>
> >> I only know of a handful of people in this industry who are serious about
> >> open source, and they are in the minority.  I only ask to see what kind of
> >> reactions I get, and if people are serious about it, I would set up a
> >> repository on the understanding that other people would contribute to it
> >> and actually check it out.  I would be afraid of being used like a cheap
> >> blow up doll though.  No one would actually contribute anything, just take
> >> and take.  I'm assuming this is everyone's sentiment.****
> >>
> >> ** **
> >>
> >> This is me from the outside, looking in.  I only see a few EnergyPlus
> >> projects on source forge and none of them seem that well-developed.  Am I
> >> wrong?****
> >>
> >> ** **
> >>
> >> ** **
> >>
> >> ** **
> >>
> >> On Thu, Sep 5, 2013 at 10:14 AM, Edwin Lee <leeed2001@> wrote:****
> >>
> >>    ****
> >>
> >> "I have code just sitting around,"****
> >>
> >> "Why not share it on sourceforge?"****
> >>
> >> ** **
> >>
> >> ... good question?  It's always cool to see what other people are doing.
> >>  If you already have code sitting around, why not post it on SourceForge or
> >> GitHub?****
> >>
> >> ** **
> >>
> >> On Thu, Sep 5, 2013 at 11:08 AM, Linda Lawrie <linda@> wrote:****
> >>
> >>    ****
> >>
> >> At 10:46 AM 9/5/2013, Chien Si Harriman wrote:****
> >>
> >> Just curious why all the idf making only happens at the labs and at
> >> DesignBuilder, etc?  More of a general thought that has no answer, but
> >> would be interested to hear people's opinions.****
> >>
> >>  ** **
> >>
> >> Have you looked through the third party software:
> >>
> >> http://apps1.eere.energy.gov/buildings/energyplus/other_tools.cfm****
> >>
> >>  ** **
> >>
> >> ** **
> >>
> >> -- ****
> >>
> >> Edwin Lee, PhD****
> >>
> >> Engineer, Commercial Buildings Research Staff****
> >>
> >> National Renewable Energy Laboratory****
> >>
> >> ** **
> >>
> >>  ** **
> >>
> >> ** **
> >>
> >> ** **
> >>
> >> -- ****
> >>
> >> ** **
> >>
> >> ** **
> >>
> >> Javed Iqbal, LEED AP, CEA****
> >>
> >> Sr. Energy Analyst ****
> >>
> >> ** **
> >>
> >> ** **
> >>
> >> ** **
> >>
> >> ** **
> >>
> >> ** **
> >>
> >>
> >>
> >> ****
> >>
> >> ** **
> >>
> >> -- ****
> >>
> >> ** **
> >>
> >> ** **
> >>
> >> Javed Iqbal, LEED AP, CEA****
> >>
> >> Sr. Energy Analyst ****
> >>
> >> ** **
> >>
> >> ** **
> >>
> >> ** **
> >>
> >> ** **
> >>
> >> ** **
> >>
> >> ****
> >>
> >>
> >  
> >
> 
> 
> 
> -- 
> Marcus Jones,  M.Sc., LEED®AP BD+C
> *Freelance energy consultant*
> *Vienna, Austria*
>



------------------------------------

Primary EnergyPlus support is found at:
http://energyplus.helpserve.com or send a message to energyplus-support@xxxxxxxx

The primary EnergyPlus web site is found at:
http://www.energyplus.gov

The group web site is:
http://groups.yahoo.com/group/EnergyPlus_Support/

Attachments are currently allowed but be mindful that not everyone has a high speed connection.  Limit attachments to small files.

EnergyPlus Documentation is searchable.  Open EPlusMainMenu.pdf under the Documentation link and press the "search" button.
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/EnergyPlus_Support/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/EnergyPlus_Support/join
    (Yahoo! ID required)

<*> To change settings via email:
    EnergyPlus_Support-digest@xxxxxxxxxxxxxxx 
    EnergyPlus_Support-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    EnergyPlus_Support-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://info.yahoo.com/legal/us/yahoo/utos/terms/