Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example Issue #71

Open
swaroopguggilam opened this issue May 23, 2023 · 1 comment
Open

Example Issue #71

swaroopguggilam opened this issue May 23, 2023 · 1 comment

Comments

@swaroopguggilam
Copy link

I have setup a virtual environment as suggested in the instructions.
I am running "getting_started_cli.ipynb" as it is.
Windows Operating System, Python 3.10.7
I am getting the following error (Redacted my System Paths):

seeds for scenario: Scenario_0
{'loads': 876582525, 'renewables': 876582525, 'dispatch': 876582525}
scenario_path: ~\Chronix2grid\ChroniX2Grid\getting_started\example\output\generation\case118_l2rpn_wcci\2012-01-01\Scenario_0
=====================================================================================================================================
============================================== CHRONICS GENERATION ==================================================================
=====================================================================================================================================
================ Generating Scenario_0 ================
Computing global auto-correlated spatio-temporal noise for thermosensible demand...
Computing loads ...
case118_l2rpn_wcci
initial_seeds
{'loads': 876582525, 'renewables': 876582525, 'dispatch': 876582525}
~\Chronix2grid\venv_chronix2grid\lib\site-packages\lightsim2grid\securityAnalysis.py:76: FutureWarning: In the future `np.str` will be defined as the corresponding NumPy scalar.
  STR_TYPES = (str, np.str, np.str_)
~\Chronix2grid\venv_chronix2grid\lib\site-packages\lightsim2grid\securityAnalysis.py:76: FutureWarning: In the future `np.str` will be defined as the corresponding NumPy scalar.
  STR_TYPES = (str, np.str, np.str_)
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "~\AppData\Local\Programs\Python\Python310\lib\multiprocessing\pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "~\AppData\Local\Programs\Python\Python310\lib\multiprocessing\pool.py", line 48, in mapstar
    return list(map(*args))
  File "~\Chronix2grid\venv_chronix2grid\lib\site-packages\chronix2grid\main.py", line 168, in generate_per_scenario
    generate_inner(
  File "~\Chronix2grid\venv_chronix2grid\lib\site-packages\chronix2grid\main.py", line 194, in generate_inner
    params, loads_charac, prods_charac = gen.main(generator,
  File "~\Chronix2grid\venv_chronix2grid\lib\site-packages\chronix2grid\generation\generate_chronics.py", line 38, in main
    return generator.run(case, n_scenarios, input_folder, output_folder, scen_names, time_params, mode, scenario_id, seed_for_loads, seed_for_res,
  File "~\Chronix2grid\venv_chronix2grid\lib\site-packages\chronix2grid\GeneratorBackend.py", line 185, in run
    load, load_forecasted = self.do_l(scenario_folder_path, seed_load, params_load, loads_charac, load_config_manager)
  File "~\Chronix2grid\venv_chronix2grid\lib\site-packages\chronix2grid\GeneratorBackend.py", line 245, in do_l
    load, load_forecasted = generator_loads.run()
  File "~\Chronix2grid\venv_chronix2grid\lib\site-packages\chronix2grid\generation\consumption\ConsumptionGeneratorBackend.py", line 47, in run
    return main(self.out_path, self.seed, self.params, self.loads_charac, load_weekly_pattern, self.write_results,
  File "~\Chronix2grid\venv_chronix2grid\lib\site-packages\chronix2grid\generation\consumption\generate_load.py", line 68, in main
    loads_series = conso.compute_loads(loads_charac,
  File "~\Chronix2grid\venv_chronix2grid\lib\site-packages\chronix2grid\generation\consumption\consumption_utils.py", line 36, in compute_loads
    loads_series[name] = compute_residential(locations, Pmax, temperature_noise, params, weekly_pattern, index=i, day_lag=day_lag, add_dim=add_dim)
  File "~\Chronix2grid\venv_chronix2grid\lib\site-packages\chronix2grid\generation\consumption\consumption_utils.py", line 62, in compute_residential
    start_year = pd.to_datetime(str(params['start_date'].year) + '/01/01', format='%Y-%m-%d')
  File "~\Chronix2grid\venv_chronix2grid\lib\site-packages\pandas\core\tools\datetimes.py", line 1084, in to_datetime
    result = convert_listlike(np.array([arg]), format)[0]
  File "~\Chronix2grid\venv_chronix2grid\lib\site-packages\pandas\core\tools\datetimes.py", line 453, in _convert_listlike_datetimes
    return _array_strptime_with_fallback(arg, name, utc, format, exact, errors)
  File "~\Chronix2grid\venv_chronix2grid\lib\site-packages\pandas\core\tools\datetimes.py", line 484, in _array_strptime_with_fallback
    result, timezones = array_strptime(arg, fmt, exact=exact, errors=errors, utc=utc)
  File "pandas\_libs\tslibs\strptime.pyx", line 530, in pandas._libs.tslibs.strptime.array_strptime
  File "pandas\_libs\tslibs\strptime.pyx", line 351, in pandas._libs.tslibs.strptime.array_strptime
ValueError: time data "2012/01/01" doesn't match format "%Y-%m-%d", at position 0. You might want to try:
    - passing `format` if your strings have a consistent format;
    - passing `format='ISO8601'` if your strings are all ISO8601 but not necessarily in exactly the same format;
    - passing `format='mixed'`, and the format will be inferred for each element individually. You might want to use `dayfirst` alongside this.
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "~\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "~\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "~\Chronix2grid\venv_chronix2grid\Scripts\chronix2grid.exe\__main__.py", line 7, in <module>
  File "~\Chronix2grid\venv_chronix2grid\lib\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "~\Chronix2grid\venv_chronix2grid\lib\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "~\Chronix2grid\venv_chronix2grid\lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "~\Chronix2grid\venv_chronix2grid\lib\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "~\Chronix2grid\venv_chronix2grid\lib\site-packages\chronix2grid\main.py", line 61, in generate_mp
    generate_mp_core(prng, case, start_date, weeks, by_n_weeks, n_scenarios, mode,
  File "~\Chronix2grid\venv_chronix2grid\lib\site-packages\chronix2grid\main.py", line 124, in generate_mp_core
    pool.map(multiprocessing_func, iterable)
  File "~\AppData\Local\Programs\Python\Python310\lib\multiprocessing\pool.py", line 367, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "~\AppData\Local\Programs\Python\Python310\lib\multiprocessing\pool.py", line 774, in get
    raise self._value
ValueError: time data "2012/01/01" doesn't match format "%Y-%m-%d", at position 0. You might want to try:
    - passing `format` if your strings have a consistent format;
    - passing `format='ISO8601'` if your strings are all ISO8601 but not necessarily in exactly the same format;
    - passing `format='mixed'`, and the format will be inferred for each element individually. You might want to use `dayfirst` alongside this.

Any help is appreciated.
I am happy to provide more information if needed.

@swaroopguggilam
Copy link
Author

After some investigation, I found this is happening with the latest Pandas version 2.0
I downgraded to 1.5, and this error disappeared.

However, it is stuck at
image

Any information on

  1. How long does it take to run this example?
  2. How would we know when the simulation has ended? [i.e. Will there be a message that the simulation is complete?]

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant