Read the doc for more information.
Alternatively you can generate the documentation yourself if you have sphinx installed:
cd <to the root of the project> sphinx-apidoc -o doc/ openDAM/ -f --separate cd doc; make html; cd ..
The html doc is in _build/html
- Download the code from Github
- We highly recommend to use an Anaconda distribution
- download and install Anaconda for Python 2.7 and your specific OS.
- Create one environement for this project
conda create --name python_DAM --file conda-{platform}.txtwhere "{platform}" must match your OS. Checkout this reference for more information about how to manage Anaconda environments.
- Activate the environment
For Windows:
activate python_DAMFor OSX and Linux,
source activate python_DAM
The code is currently tuned for CPLEX.
- First, run
create_dam_db_from_csv.py
fromopenDAM/dataio/
to generate an sqlite database, taking as default source scripts the CSV files in folder data/tests. The resulting sqlite database can be browsed using any client for Sqlite.- You can modify the call to
create_dam_db_from_csv.py
if you want to use other input CSV files.
- You can modify the call to
- Run
python openDAM
from the master directory with either the--all
option, or another option if you want to run a particular day.
The Italian market data can be freely downloaded from the website of the Italian market operator. The raw data required to run the model is stored in 4 different XML files, named:
- YYYYMMDDMGPOffertePubbliche.xml, located in a zip file named YYYYMMDDMGPOffertePubbliche.zip, contained in another zip file named YYYYMMDDOfferteFree_Pubbliche.zip. The xml file contains the real market order data;
- YYYYMMDDMGPLimitiTransito.xml, containing the network capacity limits;
- YYYYMMDDMGPPrezzi.xml , containing the official prices used for comparison;
- YYYYMMDDMGPQuantita, containing the flows coming from the non-GME zones;
where YYYYMMDD is the date of the requested day in the format: year, month and day. These files can be freely downloaded from the following links, for example for January 27th, 2018:
- https://www.mercatoelettrico.org/en/Download/DownloadDati.aspx?val=OfferteFree_Pubbliche
- https://www.mercatoelettrico.org/It/WebServerDataStore/MGP_LimitiTransito/20180127MGPLimitiTransito.xml
- https://www.mercatoelettrico.org/It/WebServerDataStore/MGP_Prezzi/20180127MGPPrezzi.xml
- https://www.mercatoelettrico.org/It/WebServerDataStore/MGP_Quantita/20180127MGPQuantita.xml
Then, they can be imported into a suitable SQL database by running the Python script GME_xml_importer.py.
Assuming your data is in the folder data
, you can do this by running python openDAM/dataio/GME_xml_importer.py --split -p data/ -d test.sqlite3 --from_date=20180110 --to_date=20180110
.
The --split
option generates a problem per period.
Then you can run from the master directory
python openDAM -p openDAM\dataio -d test.sqlite3 -c 2018011019 --pun_strategy=Advanced
See also GME_xml_importer.py --help
for further details.
Random block orders can be added to a database by running python openDAM/dataio/generate_block_orders.py
.
Parameters defining block properties must be modified directly inside this file (they are not accessible through command line arguments).