outerport / paramit

Parameterize Python scripts/notebooks all from the command line and run on cloud GPUs
Apache License 2.0
96 stars 11 forks source link

fixed __file__ variable to have the original file path #74

Closed 4cardbot closed 3 months ago

4cardbot commented 3 months ago

This change resolves #72 by assigning the file variable equal to the original script path at the start of temp_file script.

tovacinni commented 3 months ago

Hi thanks so much for the contrib!!!! Much appreciated.

Just one small thing- I think this causes one small issue which is that when you run paramit run reports/..../main.toml on the generated config files, it'll use that as the path.

I think the behaviour makes sense if we make it such that if the .toml file is being used as a input, it should look in config.meta.script_path and use that path instead of the path to the .toml file.

Do you think you could make this small change to the PR?

Thank you!!

4cardbot commented 3 months ago

@tovacinni I love the work that you folks are doing to simplify this tedious process.

I missed the use-case where .toml is being used. Have fixed it as you suggested.

4cardbot commented 3 months ago

A similar issue occurs if I use os.getcwd() in the script to fetch the current directory for a similar use-case.

Trying to fix it as well.

4cardbot commented 3 months ago

Fixed the issue with os.getcwd() as well.

tovacinni commented 3 months ago

LGTM- thanks again for the contribution!!