在本地运行e+的一些有用函数

energyplus_wrapper的Python项目详细描述


能量+包装器

这个小库是为了以线程安全的方式在linux和windows中运行energy+模拟而编写的。

主要目标是确保跨平台和版本的稳定行为,以及 将用python编写的e+构建模型工具与不同的分析和优化工具联系起来。

安装

目前,这个包可以在pypi上使用,也可以通过github repo使用。

pip install energyplus-wrapper
pip install git+git://github.com/locie/energy_plus_wrapper.git

以满足要求。

用法

非常简单的使用:

fromenergyplus_wrapperimportrunresult=run('in.idf','in.epw')

API

defrun(idf_file,weather_file,working_dir=".",idd_file=None,simulname=None,prefix="eplus",out_dir=tempfile.gettempdir(),keep_data=False,keep_data_err=True,bin_path=None,eplus_path=None):"""
    energyplus runner using local installation.

    Run an energy-plus simulation with the model file (a .idf file),
    a weather file (should be a .epw) as required arguments. The output will be
    a pandas dataframe or a list of dataframe or None, depending of how many
    csv has been generated during the simulation, and requested in the model
    file. The run is multiprocessing_safe

    Parameters
    ----------
    idf_file : str
        the file describing the model (.idf)
    weather_file : str
        the file describing the weather data (.epw)
    working_dir : str, optional
        working directory (default: ".")
    idd_file : None, optional
        base energy-plus file (default: None, find Energy+.idd in the
        e+ install directory if $EPLUS_DIR set, else find it on working
        dir.)
    simulname : str or None, optional (default None)
        this name will be used for temp dir id and saved outputs.
        If not provided, uuid.uuid1() is used. Be careful to avoid naming
        collision : the run will alway be done in separated folders, but the
        output files can overwrite each other if the simulname is the same.
    prefix : str, optional
        prefix of output files (default: "eplus")
    out_dir : str, optional
        temporary output directory (default: OS default temp folder).
    keep_data : bool, optional
        if True, do not remove the temporary folder after the simulation
        (default: False)
    keep_data_err : bool, optional
        if True, copy the temporary folder on out_dir / "failed" if the
        simulation fail. (default: True)
    bin_path : None, optional
        if provided, path to the EnergyPlus binary. If not provided (default),
        find it on eplus_path / EnergyPlus (if eplus_path set), or
        use the global variable EPLUS_PATH (id set), or finally
        consider that EnergyPlus is on the path
    eplus_path : None, optional
        if provided, path to the EnergyPlus.


    Returns
    -------
    pandas.DataFrame or list of pandas.DataFrame or None
        Only the csv outputs are handled : the output of the
        function will be None if any csv are generated, a pandas DataFrame
        if only one csv is generated (which seems to be the usual user
        case) or a list of DataFrames if many csv are generated.
    """

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
junit有没有办法在Java中重新初始化静态类?   在浏览器中点击应用程序时java Play框架挂起   文件Java错误中的NullPointerException   使用Java中的SNMP查找网络中计算机的登录名   java包装服务器引导程序已弃用,有什么替代方案?   当客户在等待理发时,java信号量值是否存在问题?   java如何使用JavaMail仅下载特定类型的附件   如何在java中将十进制转换为十六进制   java Slick2D粒子系统不会生成粒子   java检测更改事件来自何处   将Java集合类型参数类设置为数组   java如何从eclipse导出为可运行JAR文件?   java EntityManager对象未注入Glassfish和Spring   swing从actionPerformed和actionListener Java返回字符串   java在给定另一个等价键对象的情况下获取映射项的当前键   无论输入如何,java网络都会产生相同的输出