intelligent-environments-lab / CityLearn

Official reinforcement learning environment for demand response and load shaping
MIT License
462 stars 167 forks source link

CityLearn competitin missing info on the online evaluation #27

Closed MrRobot2211 closed 1 year ago

MrRobot2211 commented 2 years ago

Hi I noticed that for the competition we are given building_info and observation_space in the online evaluation you could for example see it here

I added this in the OrderEnforcingWrapper

class OrderEnforcingAgent:
    """
    Emulates order enforcing wrapper in Pettingzoo for easy integration
    Calls each agent step with agent in a loop and returns the action
    """
    def __init__(self):
        self.num_buildings = None
        self.agent = UserAgent()
        self.action_space = None

    def register_reset(self, observation):
        """Get the first observation after env.reset, return action""" 
        action_space = observation["action_space"]
        self.action_space = [dict_to_action_space(asd) for asd in action_space]
        obs = observation["observation"]
        self.num_buildings = len(obs)

        print(f'building_info_in_keys : {"building_info" in observation.keys()}')

if I look at the logs I see this

Warning: Gym version v0.24.1 has a number of critical issues with `gym.make` such that environment observation and action spaces are incorrectly evaluated, raising incorrect errors and warning . It is recommend to downgrading to v0.23.1 or upgrading to v0.25.1
/srv/conda/envs/notebook/lib/python3.8/site-packages/sklearn/linear_model/_least_angle.py:34: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  method='lar', copy_X=True, eps=np.finfo(np.float).eps,
/srv/conda/envs/notebook/lib/python3.8/site-packages/sklearn/decomposition/_lda.py:28: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  EPS = np.finfo(np.float).eps
/srv/conda/envs/notebook/lib/python3.8/site-packages/sklearn/ensemble/_gb.py:33: DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  from ._gradient_boosting import predict_stages
2022-08-15 21:48:35.016 | INFO     | aicrowd_gym.clients.base_oracle_client:register_agent:210 - Registering agent with oracle...
2022-08-15 21:48:35.020 | SUCCESS  | aicrowd_gym.clients.base_oracle_client:register_agent:226 - Registered agent with oracle
building_info_in_keys : False
Device:cpu
building_info_in_keys : False
Device:cpu
building_info_in_keys : False
Device:cpu
building_info_in_keys : False
Device:cpu
building_info_in_keys : False
Device:cpu
building_info_in_keys : False
Device:cpu

Will they will be added at some point in time or we will have to use only what is passed? Thank you in advance.

kingsleynweye commented 1 year ago

@MrRobot2211 They have now been added in the online evaluator.