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

Suggestion: command-line interface #239

Open
alexlyttle opened this issue May 21, 2020 · 0 comments
Open

Suggestion: command-line interface #239

alexlyttle opened this issue May 21, 2020 · 0 comments

Comments

@alexlyttle
Copy link
Collaborator

Since the session class is a pretty good do-it-all script, it wouldn't be too difficult to add a command-line interface (CLI) to PBjam - useful when running on remote workstations or via job schedulers. I'd be happy to have a crack at this when I have time, converting some things from my repo https://github.com/alexlyttle/jam-ensemble (with the recent help from @nielsenmb). I have recently done something like this, albeit lightweight, on a personal repo. However, I've posted this issue here in case anyone else is more experienced to write something like this.

I'd imagine this is not high priority at the minute, just a suggestion.

It would work something like this (similar to https://github.com/danxhuber/isoclassify CLI) for an individual star, e.g

$ pbjam star <star_id> -i /path/to/inputs.csv -o /path/to/output --make-plots TRUE

for a single jam session on all the stars in inputs.csv, e.g.

$ pbjam session -i /path/to/inputs.csv -o /path/to/output --make-plots FALSE

or generate batch scripts for multiple sessions, e.g.

$ pbjam batch --njobs=100 -i /path/to/inputs.csv -o /path/to/output > pbjam-session.tot

where --njobs could default to the length of the input csv if not specified (i.e. one job per star). Could have a --template option for custom script templates and an option to write scripts to individual files in the output directory as opposed to pbjam-session.tot.

Once we have a module which does this (e.g. named pipeline.py) it can be added to setup.py as the following argument, e.g.

from setuptools import setup
...
setup(
    ...
    entry_points = {
        console_scripts = [
            'pbjam = pbjam.pipeline:main',
        ],
    },
    ...
)

allowing it to be added to the user's path upon install (something I have done in https://github.com/alexlyttle/isoclassify).

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

1 participant