OnLocationInc / Building-json-file-for-NEMS-DV

0 stars 0 forks source link

Programming steps #2

Open konica-mulani opened 4 years ago

konica-mulani commented 4 years ago
Steps What Time(hrs)
0 Time invested in python and wx installation 3
1 Extract table names from Layin file file and row names from .API.TXT 1
2 Extract stubname from api.txt file .5
3 Enable the selection of table name and row name in a GUI interface and print the corresponding label and stubname 6
4 Enable the selection of Title, Chart type, Year/s, Operations 6
5 Output the json block for one stub 3
6 Ouput the json block for multiple stubs 4
7 Creating python executable 2
8 Append blocks to existing json 2
9 Add regional tables json 2
10 Build multiple lines per chart 2

@LessGoudarzi

LessGoudarzi commented 4 years ago

@konica-mulani we need to meet and discuss. Another step I didn't see is the design/layout of the UX

konica-mulani commented 4 years ago

1)Drop down for Table number & name 2)Drop down for Row number & name 2)Text input type for Chart Title 3)Radio button for chart type (like line, bar etc.) 4)First year, Last year and interval 5)Text input type for Operations/names

konica-mulani commented 4 years ago

List of inputs needed to create a working json:

Example:

{ "stubs": ["sup_prd_co2eor_NA_NA_NA_usa_millbrlpdy", "sup_prd_NA_NA_cr_NA_usa_millbrlpdy", "trad_NA_lfl_NA_netimp_netimp_usa_millbrlpdy", "sup_NA_lfl_ops_npi_NA_usa_NA", "sup_NA_lfl_onps_rnw_NA_usa_NA", "sup_NA_lfl_onps_lfg_NA_usa_NA", "sup_NA_lfl_onps_lfc_NA_usa_millbrlpdy", "sup_NA_lfl_onps_oth_NA_usa_millbrlpdy" ], "names": { "EOR": ["+0"], "Dom. Non-EOR": ["+1","-0"], "Net Imports": ["+2", "+3"], "Non-Petroleum": ["+4","+5","+6","+7"] }, "title": "Liquids Supply", "type": "bar", "years": ["2025", "2040", "2050"], "xAxis": ["Year", "Scenario"], "xLabel": ["Scenario"], "units": "mill bbl/day" }

{ "stubs": [ "cnsm_enu_comm_NA_lfl_NA_usa_qbtu", "cnsm_enu_comm_NA_ng_NA_usa_qbtu", "cnsm_enu_comm_NA_cl_NA_usa_qbtu", "cnsm_enu_comm_NA_ren_NA_usa_qbtu", "cnsm_enu_comm_NA_elc_NA_usa_qbtu" ], "names": { "Liquid fuels": ["+0"], "Natural gas": ["+1"], "Renewables": ["+3"], "Electricity": ["+4"], "Coal": ["+2"] }, "title": "SCENARIO Commercial Demand", "type": "bar", "scenario": "single" }

{ "stubs": "sup_prd_co2eor_NA_NA_NA_usa_millbrlpdy", "divideValues": 2.7397, "title": "Cumulative CO2 Enhanced Oil Recovery", "units": "Billion Barrels", "type": "cumulativeLine" }

konica-mulani commented 4 years ago

Here is an example of a batch script that activates a virtual environment and runs a Python file. I believe you could adapt this for your project if you just enter the correct path for your venv and the name of the file you wrote.

1) go to the folder where your .py program is saved on Dolphin 2) create an empty text file 3) paste in this script and change the path/filename 4) save the file as "run" 5) change the extension on the file from .txt to .bat

Anyone who goes to this location and double clicks the .bat file should be able to run your program.

pushd %~dp0 call \tuna\d\nenv\Scripts\activate.bat py .\dbemm.py pause

Note: email from Eric @LessGoudarzi