Skip to content

Commit

Permalink
Revert "Revert "Gave up on session-level analysis (see #31)""
Browse files Browse the repository at this point in the history
This reverts commit e7059b0.
  • Loading branch information
glatard committed Aug 30, 2017
1 parent e7059b0 commit 81a1793
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions bids/spark-bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,10 @@ def main():
parser.add_argument("output_dir", help="Output directory.")
# Optional inputs
# Analysis options
parser.add_argument("--skip-session-analysis", action = 'store_true', help="Skips session analysis.")
parser.add_argument("--skip-participant-analysis", action = 'store_true', help="Skips participant analysis.")
parser.add_argument("--skip-group-analysis", action = 'store_true', help="Skips groups analysis.")
parser.add_argument("--skip-participants", metavar="FILE", type=lambda x: is_valid_file(parser, x), help="Skips participant labels in the text file.")
parser.add_argument("--skip-sessions", metavar="FILE", type=lambda x: is_valid_file(parser, x), help="Skips session labels in the text file, for all participants.")

# Performance options
parser.add_argument("--hdfs", action = 'store_true', help="Passes data by value rather than by reference in the pipeline. Use it with HDFS only.")
args=parser.parse_args()
Expand All @@ -179,24 +178,20 @@ def main():
use_hdfs = args.hdfs

# Optional inputs
do_subject_analysis = supports_analysis_level(boutiques_descriptor, "session") and not args.skip_session_analysis
do_participant_analysis = supports_analysis_level(boutiques_descriptor, "participant") and not args.skip_participant_analysis
do_group_analysis = supports_analysis_level(boutiques_descriptor,"group") and not args.skip_group_analysis

skipped_participants = args.skip_participants.read().split() if args.skip_participants else []
skipped_sessions = args.skip_sessions.read().split() if args.skip_sessions else []

# Print analysis summary
print("Computed Analyses: Session [ {0} ] - Participant [ {1} ] - Group [ {2} ]".format(str(do_subject_analysis).upper(),
str(do_participant_analysis).upper(),
str(do_group_analysis).upper()))
if len(skipped_sessions):
print("Skipped sessions: {0}".format(skipped_sessions))
print("Computed Analyses: Participant [ {0} ] - Group [ {1} ]".format(str(do_participant_analysis).upper(),
str(do_group_analysis).upper()))

if len(skipped_participants):
print("Skipped participants: {0}".format(skipped_participants))

# Return if there is nothing to do
if not ( do_subject_analysis or do_participant_analysis or do_group_analysis ):
if not ( do_participant_analysis or do_group_analysis ):
sys.exit(0)

# Spark initialization
Expand Down

0 comments on commit 81a1793

Please sign in to comment.