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

osl_func utility: run any function from the command line #257

Merged
merged 1 commit into from
Jan 11, 2024
Merged

Conversation

matsvanes
Copy link
Collaborator

@matsvanes matsvanes commented Jan 11, 2024

This is a utility function addition to run any osl function (with limitations) from the terminal command line, i.e., osl_func function_name arg1 arg2.
Example:
osl_func osl.source_recon.rhino.polhemus.delete_headshape_points None None polhemus_headshape.txt will iteratively load the (sub-) module until it reaches the function, and then run the function with the function arguments. This example will run osl.source_recon.rhino.polhemus.delete_headshape_points(recon_dir=None, subject=None, polhemus_headshape_file='polhemus_headshape.txt').

This is especially useful for interactive functions, which often don't work very well in Jupyter Notebook. Because I expect that this is an issue that many people will face, I thought this would be useful (so users don't have to make separate scripts for this purpose every time). The main limitation currently is that you can only use functions with string, boolean, or None arguments.

@matsvanes matsvanes changed the title first commit osl_func utility: run any function from the command line Jan 11, 2024
@matsvanes matsvanes merged commit 6238342 into main Jan 11, 2024
1 check passed
@matsvanes matsvanes deleted the run_func branch January 11, 2024 15:01
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

Successfully merging this pull request may close these issues.

1 participant