[Python] Why can't I implement ENERGYM?

Discussão em 'Python' iniciado por Stack, Maio 1, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to implement the ENERGYM library in Python as per the following paper: https://www.mdpi.com/2076-3417/11/8/3518 and https://bsl546.github.io/energym-pages/sources/install_min.html

    After successfully having gone through the path in the second link (minimal installation of energyplus and adding it to the path), I am now able to run the following

    import energym


    The next step is the following loop:

    env = energym.make("Apartments2Grid-v0")
    out = env.get_output()
    for i in range(100):
    forecast = env.get_forecast(forecast_length=10);
    inp = get_input(out, forecast);
    out = env.step(inp);
    kpis = env.get_kpi();
    env.close()


    However, this gives a long loop of error: starting with about a million lines that look like this:

    C:\Users\mf635543\AppData\Local\anaconda3\envs\citylearn_env\lib\site-packages\energym-0.1-py3.10.egg\energym\schedules\EVSchedule.py:281: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '[0.14101058 0.14101058 0.14101058 0.14101058 0.14101058 0.14101058
    0.14101058 0.14101058 0.14101058 0.14101058 0.14101058 0.14101058
    0.14101058 0.14101058 0.14101058 0.14101058 0.14101058 0.14101058
    0.14101058 0.14101058 0.14101058 0.14101058 0.14101058 0.14101058
    0.14101058 0.14101058 0.14101058 0.14101058 0.14101058 0.14101058
    0.14101058 0.14101058 0.14101058 0.14101058 0.14101058 0.14101058
    0.14101058 0.14101058 0.14101058 0.14101058 0.14101058 0.14101058
    0.14101058 0.14101058 0.14101058 0.14101058 0.14101058 0.14101058
    0.14101058 0.14101058 0.14101058 0.14101058 0.14101058 0.14101058
    0.14101058 0.14101058 0.14101058 0.14101058 0.14101058 0.14101058
    0.14101058 0.14101058 0.14101058 0.14101058 0.14101058 0.14101058
    0.14101058 0.14101058 0.14101058 0.14101058 0.14101058 0.14101058
    0.14101058 0.14101058 0.14101058 0.14101058 0.14101058 0.14101058
    0.14101058 0.14101058 0.14101058 0.14101058 0.14101058 0.14101058
    0.14101058 0.14101058 0.14101058 0.14101058 0.14101058 0.14101058


    enter image description here

    Then, after a countless number of iterations virtually indistinguishable from that, it gives the following finally:

    [OK] fmi2Instantiate: The Resource location of FMU with instance name instance1746118692 is file:///C:/Users/mf635543/Energym_runs/1746118692_2715543/resources.

    [WARNING] fmi2Instantiate: Argument loggingOn is set to 1
    . This is not supported. loggingOn will default to '0'.

    [OK] The current working directory is C:\Users\mf635543

    [OK] fmi2Instantiate: Path to fmuUnzipLocation is not ///C:/Users/mf635543/Energym_runs/1746118692_2715543.

    [OK] fmi2Instantiate: Path to fmuUnzipLocation is not //C:/Users/mf635543/Energym_runs/1746118692_2715543.

    [OK] fmi2Instantiate: Path to fmuUnzipLocation is not /C:/Users/mf635543/Energym_runs/1746118692_2715543.

    [OK] fmi2Instantiate: Path to fmuUnzipLocation C:/Users/mf635543/Energym_runs/1746118692_2715543\

    [OK] fmi2Instantiate: Path to fmuResourceLocation C:/Users/mf635543/Energym_runs/1746118692_2715543\resources\

    [OK] Command executes to copy content of resources folder: xcopy "C:\Users\mf635543\Energym_runs\1746118692_2715543\resources\"variables.cfg "C:\Users\mf635543\Output_EPExport_instance1746118692\" /Y /I

    [OK] fmi2Instantiate: Path to model description file is C:\Users\mf635543\Energym_runs\1746118692_2715543\modelDescription.xml.

    [OK] fmi2Instantiate: The FMU modelIdentifier is Apartments2_heavy_insulated.

    [OK] fmi2Instantiate: The FMU modelGUID is 8564d8036a2644db6898d43db8787bbc.

    [OK] fmi2Instantiate: Slave instance1746118692 is instantiated.

    [OK] fmi2Instantiate: Instantiation of instance1746118692 succeded.

    ---------------------------------------------------------------------------
    AttributeError Traceback (most recent call last)
    Cell In[2], line 2
    1 env = energym.make("Apartments2Grid-v0")
    ----> 2 out = env.get_output()
    3 for i in range(100):
    4 forecast = env.get_forecast(forecast_length=10);

    AttributeError: 'NoneType' object has no attribute 'get_output'


    What might be the issue? ChatGPT is not able to figure it out, and neither am I.

    Continue reading...

Compartilhe esta Página