Skip to content

Commit

Permalink
Command line / entry point for the visualize module
Browse files Browse the repository at this point in the history
  • Loading branch information
bclenet committed Jun 10, 2024
1 parent 29316ff commit 13539ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions bids_prov/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,15 @@ def main(filename: str, output_file=None, omit_details=True) -> None:
viz_jsonld11(jsonld11, output_file)


if __name__ == "__main__":

def entry_point():
""" A command line tool for the visualize module """
parser = argparse.ArgumentParser()
parser.add_argument("--input_file", type=str, default="res.jsonld", help="data jsonld file ")
parser.add_argument("--output_file", type=str, default="res.png", help="output dir where results are written")
opt = parser.parse_args()

main(opt.input_file, output_file=opt.output_file, omit_details=True)
# >> python -m bids_prov.visualize --input_file ./res_temp.jsonld --output_file res.png

if __name__ == "__main__":
entry_point()
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ pre-commit = "^3.7.1"
pytest-cov = "^5.0.0"

[tool.poetry.scripts]
bids_prov_visualizer = "bids_prov.visualize:main"
bids_prov_visualizer = "bids_prov.visualize:entry_point"

0 comments on commit 13539ab

Please sign in to comment.