OMPython icon indicating copy to clipboard operation
OMPython copied to clipboard

Move all generated files to a temporary directory

Open dietmarw opened this issue 8 years ago • 5 comments

Running examples in OMPython will place all generated files in the current directory. This is not very nice and clutters up the workspace. OMPython should generate all files in some temporary directory instead.

dietmarw avatar Jun 16 '17 16:06 dietmarw

Note that the tempfile module in the standard library can be used to create and automatically clean up temporary directories.

bilderbuchi avatar Jun 16 '17 17:06 bilderbuchi

I disagree. I usually read the generated files such as result files for example for plotting. It would really mess up scripts if files were suddenly not generated in the same location as previously.

Could be an option when creating the object though.

⁣Sent from BlueMail ​

On 16 Jun 2017, 18:10, at 18:10, Dietmar Winkler [email protected] wrote:

Running examples in OMPython will place all generated files in the current directory. This is not very nice and clutters up the workspace. OMPython should generate all files in some temporary directory instead.

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/OpenModelica/OMPython/issues/34

sjoelund avatar Jun 16 '17 17:06 sjoelund

Being able to specify the location would probably be a good enhancement then. E.g. Instead of a system temp into a subfolder. OMedit uses a system temp as far as i know.

  1. jun. 2017 7.45 p.m. skrev "Martin Sjölund" [email protected]:

I disagree. I usually read the generated files such as result files for example for plotting. It would really mess up scripts if files were suddenly not generated in the same location as previously.

Could be an option when creating the object though.

⁣Sent from BlueMail ​

On 16 Jun 2017, 18:10, at 18:10, Dietmar Winkler [email protected] wrote:

Running examples in OMPython will place all generated files in the current directory. This is not very nice and clutters up the workspace. OMPython should generate all files in some temporary directory instead.

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/OpenModelica/OMPython/issues/34

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OpenModelica/OMPython/issues/34#issuecomment-309089962, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAkdJT_bvN8CGNbsd_aW7mvzLTlfIChks5sEr8ggaJpZM4N8psg .

dietmarw avatar Jun 16 '17 17:06 dietmarw

One of the first things OMEdit does is call cd("/tmp/OpenModelica_userName/OMEdit/"). It's quite explicit in that.

sjoelund avatar Nov 14 '17 13:11 sjoelund

@adeas31 you "recently" added some new flag for simulations to deal with this, right? So new you can set fileNamePrefix to generate files in one location (which ModelSystem could default to a temp directory) and use a different directory for output files generated by the simulation.

sjoelund avatar May 24 '19 09:05 sjoelund