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

Packaging the visualizer #134

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ venv*
venv3.11/
.idea/*
.pytest_cache/*
build/*
*.egg-info
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()
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Date : 2024_05_23_08h10m05s
Date : 2024_06_10_14h38m10s
Processing files...
file= nidmresults-examples/afni_alt_onesided_proc.sub_001
file= nidmresults-examples/afni_alt_onesided_proc.sub_001
Expand Down Expand Up @@ -69,4 +69,4 @@ Processing files...
file= nidmresults-examples/spm_thr_voxelfdrp05_batch.m
file= nidmresults-examples/spm_thr_voxelfwep05_batch.m
file= nidmresults-examples/spm_thr_voxelunct4_batch.m
End of processed files. Results in dir : 'examples/from_parsers'. Time required: 0:00:01.882820
End of processed files. Results in dir : 'examples/from_parsers'. Time required: 0:00:01.877882
56 changes: 56 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "bids_prov"
authors = [
"Camille Maumet",
"Satrajit Ghosh",
"Stefan Appelhoff",
"Chris Markiewicz",
"Yaroslav Halchenko",
"Jean-Baptiste Poline",
"Rémi Adon",
"Hermann Courteille",
"Thomas Betton",
"Cyril Regan",
"Boris Clénet"
]
description = "BIDS extension proposal 28 : BIDS Provenance"
version = "0.1.0"
readme = "README.md"
requires-python = ">=3.10, <3.11"
license = "CC-BY-4.0"
classifiers = [
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Medical Science Apps."
]
include = ["bids_prov/visualize.py"]
exclude = ["bids_prov*"]

[tool.poetry.dependencies]
python = "^3.10.0"
beautifulsoup4 = "^4.12.3"
boutiques = "^0.5.26"
click = "^8.1.7"
deepdiff = "^7.0.1"
graphviz = "^0.20.3"
rdflib = "^7.0.0"
rdflib-jsonld = "^0.6.2"
prov = "^2.0.0"
pydot = "^2.0.0"
pyld = "^2.0.4"
pyyaml = "^6.0.1"
requests = "^2.32.3"

[tool.poetry.group.dev.dependencies]
black = "^24.4.2"
markdownify = "^0.12.1"
pre-commit = "^3.7.1"
pytest-cov = "^5.0.0"

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