urbanopt / geojson-modelica-translator

GeoJSON to Modelica Translator that is focused on district energy system design and analysis.
https://www.nrel.gov/buildings/urbanopt.html
Other
18 stars 11 forks source link

Create a Batch File Version of the om_docker.sh That Can be Run on Windows #598

Closed chriswmackey closed 8 months ago

chriswmackey commented 10 months ago

Currently, when trying to run the GMT on Windows, we aren't able to call Docker since a shell script is being used to do this and Windows cannot run .sh files natively (typically, this is done with a batch script in Windows instead of shell). So, to get this to work on Windows we need a om_docker.bat version of this om_docker.sh.

Or it may be better practice to move some of the logic in that shell script to be run using Python in the GMT package and just use Python subprocess to call docker run, which seems to be the main part of the shell script that is calling docker:

https://github.com/urbanopt/geojson-modelica-translator/blob/develop/geojson_modelica_translator/modelica/lib/runner/om_docker.sh#L107

Whatever the case, calling a .sh file using Python subprocess as what happens on this line here will definitely fail in Windows: https://github.com/urbanopt/geojson-modelica-translator/blob/develop/geojson_modelica_translator/modelica/modelica_runner.py#L176

So this either needs to change to call a batch file or another executable that will be recognizable on both operating systems (like docker run). I'm happy to look into this and come up with something that will work on Windows.

vtnate commented 10 months ago

@chriswmackey Yes, let's discuss. If we can do it all in Python and eliminate the shell script altogether I'd be delighted. The need for the shell script may have passed when we got pushed off JModelica.