open-research / sumatra

http://neuralensemble.org/sumatra/
BSD 2-Clause "Simplified" License
127 stars 48 forks source link

parameter file changes to relative path #350

Open ylubarsk opened 8 years ago

ylubarsk commented 8 years ago

-- reposting here the conversation from google groups as per request by Andrew --

Hi,

I notice that when a JSON file is given as an argument to smt run, the actual file that is passed to the executable has a different name - e.g. 20160817-021752.json . Is there a way to turn off this behavior and make it so the original path is given as input? Or alternatively, to use the full (absolute) path to this intermediate JSON file.

The reason it is problematic for me is that the given path is relative. I am using a wrapper bash script as the executable (-e), and another script as the main (-m). The wrapper creates a directory for an experiment, changes dir to that directory and then runs the main script, passing to it all the original parameters. In the original call, the path to the JSON was absolute so it worked, but when run from smt the path is relative, so unless the wrapper parses the arguments and updates the path, the main script will not find the file.

Regards, Jacob

-- original reply:

Hi Jacob,

On Wednesday, 17 August 2016 01:45:46 UTC+2, Jacob wrote:

Hi,

I notice that when a JSON file is given as an argument to smt run, the actual file that is passed to the executable has a different name - e.g. 20160817-021752.json . 

Yes; the intention of this is to allow parameters to be modified from the command line.

Is there a way to turn off this behavior and make it so the original path is given as input? Or alternatively, to use the full (absolute) path to this intermediate JSON file.

It is not currently possible to turn this behaviour off. However, there is a "--plain" option to "smt configure" which does something similar, and my first impression is that we could extend the meaning of "--plain" to include your use case. Please could you post your message as a ticket in the issue tracker (https://github.com/open-research/sumatra/issues/new) to ensure it gets followed up?

Juggling absolute and relative paths has always been a challenge in Sumatra development (symbolic links, network file systems, remote execution all complicate the issue); at some point there should be a systematic attempt to solve the problem properly but no one has yet taken this on.

Regards,

Andrew