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

Allow comma seperated list of names for inits, output files, etc. #1255

Open
SteveBronder opened this issue Mar 12, 2024 · 4 comments
Open

Comments

@SteveBronder
Copy link
Contributor

Summary:

Right now we have a very ad hoc approach to figure out the names for multiple chains. For a users id and the number of chains they have requested we just append _1..{num_chains} to the end of the file name for output. For inits we look if the user gave us a file ending with _id. and if so we search for num_chain arguments ending in _1...{num_chains}.

We chose this scheme at the time because I was calling cmdstan myself from the terminal and it was a clever shorthand so I didn't have to write out a bunch of file names.

But with the number of upstream packages calling Stan it might be easier for them to programatically generate the names of the files they want and pass a comma separated list of file names.

Additional Information:

Provide any additional information here.

Current Version:

v2.34.1

@mitzimorris
Copy link
Member

what if the comma separated list of file names doesn't match the number of chains?

this makes more work for the user, since they'd need to pass in lists of file names for the output file and diagnostic file?

@SteveBronder
Copy link
Contributor Author

what if the comma separated list of file names doesn't match the number of chains?

Then we would throw an error

this makes more work for the user, since they'd need to pass in lists of file names for the output file and diagnostic file?

Yes that's why we originally didn't do it. But now upstream packages are just writing the bash command with code so it might be easier for them to just supply the actual filenames instead of having to deal with the shorthand logic

@mitzimorris
Copy link
Member

you're suggesting that the code that generates the command supply full file names? this feels like pushing bumps around under a rug. it's the same amount of work for the interfaces. as for CmdStan, don't want to touch the argument parser, which can't really handle lists - it would have to do a buncha processing to grab the filenames.

@WardBrian
Copy link
Member

The parser wouldn't need to handle lists, just return the string which we can then split on ','

I think it would be nice from a cmdstan standpoint to remove all the implicit filename stuff we currently do. This would definitely create more work for users on the command line, but lead to more obvious behavior once they do that work.

The in-code interfaces need to generate the names anyway to read them, so it's 0 extra effort for those

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

3 participants