NSLS-II / nslsii

NSLS-II related devices
BSD 3-Clause "New" or "Revised" License
10 stars 21 forks source link

Add `__main__` #179

Closed danielballan closed 1 month ago

danielballan commented 1 month ago

This enables:

$ python -m nslsii.sync_experiment --help
usage: __main__.py [-h] -b BEAMLINE -p PROPOSAL [-v | --verbose | --no-verbose]

Start or switch beamline experiment and record it in Redis

options:
  -h, --help            show this help message and exit
  -b BEAMLINE, --beamline BEAMLINE
                        Which beamline (e.g. CHX)
  -p PROPOSAL, --proposal PROPOSAL
                        Which proposal (e.g. 123456)
  -v, --verbose, --no-verbose
15:44 dallan@tensorbook:nslsii 

and also usage with pdb like so:

python -m pdb -m nslsii.sync_experiment --help
jwlodek commented 1 month ago

I would suggest also adding a version argument for both sync_experiment, and maybe for the package as a whole, like we did with bluesky.

mrakitin commented 1 month ago

I would suggest also adding a version argument for both sync_experiment, and maybe for the package as a whole, like we did with bluesky.

Decided to do it via a separate PR.