arras-energy / gridlabd

Arras Energy simulator
https://www.arras.energy/
BSD 3-Clause "New" or "Revised" License
5 stars 5 forks source link

Problem with JSON 2 CSV conversion #162

Closed aivanova5 closed 6 months ago

aivanova5 commented 7 months ago

Problem description

gridlabd model get IEEE/13  
gridlabd -C 13.glm -D csv_save_options='-t pandas -f class="node|load" -f bustype=PQ' -o 13.csv

generates error:

gridlabd -C 13.glm -D csv_save_options='-t pandas -f class="node|load" -f bustype=PQ' -o 13.csv
Traceback (most recent call last):
  File "/usr/local/opt/gridlabd/4.3.3-240126-develop_xlsx_fix-darwin_22-x86_64/share/gridlabd/json2csv.py", line 30, in <module>
    opts, args = getopt.getopt(sys.argv[1:],"hci:o:t:",["help","config","ifile=","ofile=","type="])
  File "/usr/local/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/getopt.py", line 95, in getopt
    opts, args = do_shorts(opts, args[0][1:], shortopts, args[1:])
  File "/usr/local/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/getopt.py", line 195, in do_shorts
    if short_has_arg(opt, shortopts):
  File "/usr/local/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/getopt.py", line 211, in short_has_arg
    raise GetoptError(_('option -%s not recognized') % opt, opt)
getopt.GetoptError: option -f not recognized
ERROR    [INIT] : GldMain::subcommand(format='%s %s -i %s -o %s %s',...): command '/usr/local/opt/gridlabd/4.3.3-240126-develop_xlsx_fix-darwin_22-x86_64/bin/python3 /usr/local/opt/gridlabd/4.3.3-240126-develop_xlsx_fix-darwin_22-x86_64/share/gridlabd/json2csv.py -i 13.json -o 13.csv -t pandas -f class="node|load" -f bustype=PQ' returns code 1
ERROR    [INIT] : conversion from '13.json' to output file '13.csv' failed (code 1)
ERROR    [INIT] : save to '13.csv' failed
dchassin commented 7 months ago

@aivanova5, after creating develop for 4.3.4 and updating the affected branch, this no longer seems to be a problem. But I don't see why that would fix it.

MacBook-Pro-2:source david$ docker pull lfenergy/arras:develop
develop: Pulling from lfenergy/arras
29202e855b20: Already exists 
65fd7650112d: Pull complete 
06a045a53685: Pull complete 
39846ad639a6: Pull complete 
4f4fb700ef54: Pull complete 
8f789dc71c9d: Pull complete 
6a3d89dc2732: Pull complete 
5cc5618bd95f: Pull complete 
Digest: sha256:ef419777dadbf8b55e90f91b5af798164775166421451b641b682b506e053745
Status: Downloaded newer image for lfenergy/arras:develop
docker.io/lfenergy/arras:develop

What's Next?
  View summary of image vulnerabilities and recommendations → docker scout quickview lfenergy/arras:develop
MacBook-Pro-2:source david$ docker run -it lfenergy/arras:develop gridlabd --version
HiPAS GridLAB-D 4.3.4-240201
MacBook-Pro-2:source david$ docker run -it lfenergy/arras:develop
root@89415fffcacc:/app# gridlabd model get IEEE/13
root@89415fffcacc:/app# gridlabd -C 13.glm -D csv_save_options='-t pandas -f class="node|load" -f bustype=PQ' -o 13.csv
root@89415fffcacc:/app#