Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Passing the output directory as a variable #446

Open
EverettGrethel opened this issue Sep 24, 2024 · 4 comments
Open

Feature Request: Passing the output directory as a variable #446

EverettGrethel opened this issue Sep 24, 2024 · 4 comments

Comments

@EverettGrethel
Copy link

EverettGrethel commented Sep 24, 2024

Apologies if this is already a feature. I understand that the output directory is output_path/prefix_date-time where output_path is the relative directory or a user input. I would like to provide the output directory as a variable in order to pass it to my script during the run step. For example:

study:
    - name: example
      description: example
      run:
          cmd: |
            python $(SCRIPT) \
            --output_directory $(OUTPUT_DIRECTORY)

where OUTPUT_DIRECTORY corresponds to output_path/prefix_date-time.
Any suggestions would be appreciated, thanks!

@jwhite242
Copy link
Collaborator

That is already a feature. Apologies for it being a bit buried in the docs and hard to find though. You're looking for the $(OUTPUT_PATH) token which is always available. https://maestrowf.readthedocs.io/en/latest/Maestro/specification.html#default-tokens

@EverettGrethel
Copy link
Author

EverettGrethel commented Sep 24, 2024

I believe OUTPUT_PATH does not include the timestamped directory, but rather only up to the parent directory of the timestamped directory that is created by Maestro at runtime.

What I would like to pass is the output path plus the timestamped directory, therefore what I have is OUTPUT_PATH, but I would like OUTPUT_PATH/<prefix>_<data>-<time>. Knowing the datetime generated by Maestro would suffice.

@jwhite242
Copy link
Collaborator

Oh, my bad, i thought that one did include the timestamp. In that case I will put a few new tokens on the todo list. Just an initial idea, would the difference between these few tokens make sense:

  • $(STUDY.name): simply the prefix, i.e. the name: key from the study's description
  • $(STUDY.instance): the combo of prefix_timestamp
  • $(STUDY.timestamp): the timestamp on it's own if desired. might need to stew on the format for this so it's useful, or even additional tokens describing that format somehow..

@EverettGrethel
Copy link
Author

EverettGrethel commented Sep 25, 2024

Actually, you were correct, apologies. Whatever you set OUTPUT_PATH to will actually be the parent directory, but the resulting value of OUTPUT_PATH will be OUTPUT_PATH = OUTPUT_PATH + /<prefix>_<date>-<time>. It would probably be good to include that in the docs section on OUTPUT_PATH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants