diff --git a/.circleci/config.yml b/.circleci/config.yml index 827a0cf..4439f7c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,8 +35,8 @@ jobs: # pip-dependency-file: test-requirements.txt # if you have a different name for your requirements file, maybe one that combines your runtime and test requirements. - run: sudo apt-get update - run: sudo apt-get install -y coinor-cbc - - run: pip install . - - run: pip install -r requirements.txt + - run: pip install -r requirements_test.txt + - run: pip install -e . - run: pip freeze - run: name: Run basic tests diff --git a/chronix2grid/__init__.py b/chronix2grid/__init__.py index 154a506..f1e7bde 100755 --- a/chronix2grid/__init__.py +++ b/chronix2grid/__init__.py @@ -6,4 +6,4 @@ # SPDX-License-Identifier: MPL-2.0 # This file is part of Chronix2Grid, A python package to generate "en-masse" chronics for loads and productions (thermal, renewable) -___version__ = "1.1.0.post1" +___version__ = "1.2.0.post1" diff --git a/chronix2grid/generation/dispatch/dispatch_loss_utils.py b/chronix2grid/generation/dispatch/dispatch_loss_utils.py index 75dbc0a..c91451d 100644 --- a/chronix2grid/generation/dispatch/dispatch_loss_utils.py +++ b/chronix2grid/generation/dispatch/dispatch_loss_utils.py @@ -127,14 +127,22 @@ def run_grid2op_simulation_donothing(grid_path, agent_result_path, nb_core = 1, runner = Runner(**env.get_params_for_runner()) # do regular computation as you would with grid2op path_save = None - if(write_results): - path_save=os.path.join(agent_results_path,'agent_results') + if write_results: + path_save = os.path.join(agent_results_path, 'agent_results') os.makedirs(path_save, exist_ok=True) - name_chron, cum_reward, nb_time_step, episode_data =runner.run_one_episode(path_save=path_save, - indx=scen_id, - pbar=True, - detailed_output=True) + try: + # recent grid2op version: run_one_episode has the same signature as runner.run + *_, episode_data = runner.run_one_episode(path_save=path_save, + indx=scen_id, + pbar=True, + detailed_output=True) + except ValueError: + # old grid2op version + name_chron, cum_reward, nb_time_step, episode_data = runner.run_one_episode(path_save=path_save, + indx=scen_id, + pbar=True, + detailed_output=True) #res = runner.run(nb_episode=nb_episode, nb_process=NB_CORE, pbar=True, add_detailed_output=True) # #path_save=simulation_data_folder #id_chron, name_chron, cum_reward, nb_timestep, max_ts, episode_data = res.pop() diff --git a/requirements_test.txt b/requirements_test.txt new file mode 100644 index 0000000..5b486c6 --- /dev/null +++ b/requirements_test.txt @@ -0,0 +1,175 @@ +anyio==3.7.1 +appdirs==1.4.4 +argcomplete==3.1.1 +argon2-cffi==21.3.0 +argon2-cffi-bindings==21.2.0 +arrow==1.2.3 +asttokens==2.2.1 +async-lru==2.0.3 +attrs==23.1.0 +Babel==2.12.1 +backcall==0.2.0 +beautifulsoup4==4.12.2 +bleach==6.0.0 +blosc2==2.0.0 +Bottleneck==1.3.7 +branca==0.6.0 +certifi==2023.7.22 +cffi==1.15.1 +cftime==1.6.2 +charset-normalizer==3.2.0 +click==8.1.6 +cloudpickle==2.2.1 +colorlover==0.3.0 +comm==0.1.3 +contourpy==1.1.0 +cufflinks==0.17.3 +cvxpy==1.3.2 +cycler==0.11.0 +Cython==3.0.0 +dask==2023.5.0 +debugpy==1.6.7 +decorator==5.1.1 +deepdiff==6.3.1 +defusedxml==0.7.1 +deprecation==2.1.0 +distlib==0.3.7 +ecos==2.0.12 +exceptiongroup==1.1.2 +executing==1.2.0 +fastjsonschema==2.18.0 +filelock==3.12.2 +folium==0.14.0 +fonttools==4.41.1 +fqdn==1.5.1 +fsspec==2023.6.0 +idna==3.4 +importlib-metadata==6.8.0 +importlib-resources==6.0.0 +iniconfig==2.0.0 +ipykernel==6.25.0 +ipython==8.12.2 +ipython-genutils==0.2.0 +ipywidgets==8.0.7 +isoduration==20.11.0 +jedi==0.18.2 +Jinja2==3.1.2 +joblib==1.3.1 +json5==0.9.14 +jsonpointer==2.4 +jsonschema==4.18.4 +jsonschema-specifications==2023.7.1 +jupyter==1.0.0 +jupyter-console==6.6.3 +jupyter-events==0.6.3 +jupyter-lsp==2.2.0 +jupyter_client==8.3.0 +jupyter_core==5.3.1 +jupyter_server==2.7.0 +jupyter_server_terminals==0.4.4 +jupyterlab==4.0.3 +jupyterlab-pygments==0.2.2 +jupyterlab-widgets==3.0.8 +jupyterlab_server==2.24.0 +kiwisolver==1.4.4 +linopy==0.2.2 +llvmlite==0.40.1 +locket==1.0.0 +MarkupSafe==2.1.3 +matplotlib==3.7.2 +matplotlib-inline==0.1.6 +mistune==3.0.1 +msgpack==1.0.5 +nbclient==0.8.0 +nbconvert==7.7.3 +nbformat==5.9.1 +nest-asyncio==1.5.6 +netCDF4==1.6.4 +networkx==3.1 +nose==1.3.7 +notebook==7.0.0 +notebook_shim==0.2.3 +numba==0.57.1 +numexpr==2.8.4 +numpy==1.24.4 +ordered-set==4.1.0 +osqp==0.6.3 +overrides==7.3.1 +packaging==23.1 +pandapower==2.13.1 +pandas==2.0.3 +pandocfilters==1.5.0 +parso==0.8.3 +partd==1.4.0 +pathlib==1.0.1 +pexpect==4.8.0 +pickleshare==0.7.5 +Pillow==10.0.0 +pipenv==2023.7.23 +pipx==1.2.0 +pkgutil_resolve_name==1.3.10 +platformdirs==3.9.1 +plotly==5.15.0 +pluggy==1.2.0 +ply==3.11 +prometheus-client==0.17.1 +prompt-toolkit==3.0.39 +psutil==5.9.5 +ptyprocess==0.7.0 +pure-eval==0.2.2 +py-cpuinfo==9.0.0 +pycparser==2.21 +Pygments==2.15.1 +Pyomo==6.6.1 +pyparsing==3.0.9 +pypsa==0.23.0 +pytest==7.4.0 +pytest-tornasync==0.6.0.post2 +python-dateutil==2.8.2 +python-json-logger==2.0.7 +pytz==2023.3 +PyUtilib==6.0.0 +PyYAML==6.0.1 +pyzmq==25.1.0 +qdldl==0.1.7.post0 +qtconsole==5.4.3 +QtPy==2.3.1 +referencing==0.30.0 +requests==2.31.0 +rfc3339-validator==0.1.4 +rfc3986-validator==0.1.1 +rpds-py==0.9.2 +scikit-learn==1.3.0 +scipy==1.10.1 +scs==3.2.3 +seaborn==0.12.2 +Send2Trash==1.8.2 +six==1.16.0 +sniffio==1.3.0 +soupsieve==2.4.1 +stack-data==0.6.2 +tables==3.8.0 +tenacity==8.2.2 +terminado==0.17.1 +threadpoolctl==3.2.0 +tinycss2==1.2.1 +tomli==2.0.1 +toolz==0.12.0 +tornado==6.3.2 +tqdm==4.65.0 +traitlets==5.9.0 +typing_extensions==4.7.1 +tzdata==2023.3 +uri-template==1.3.0 +urllib3==2.0.4 +userpath==1.9.0 +validators==0.20.0 +virtualenv==20.24.2 +virtualenv-clone==0.5.7 +wcwidth==0.2.6 +webcolors==1.13 +webencodings==0.5.1 +websocket-client==1.6.1 +widgetsnbextension==4.0.8 +xarray==2023.1.0 +zipp==3.16.2 \ No newline at end of file diff --git a/setup.py b/setup.py index 2212e5a..3839228 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ setup(name='Chronix2Grid', - version='1.2.0', + version='1.2.0.post1', description='A python package to generate "en-masse" chronics for loads and productions (thermal, renewable)', long_description=long_description, long_description_content_type='text/markdown', @@ -25,6 +25,7 @@ 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", "Intended Audience :: Developers", "Intended Audience :: Education",