Skip to content

Make participant argument optional, analyze all if omitted#24

Merged
fsimonis merged 9 commits intoprecice:mainfrom
AdityaGupta716:issue-7-optional-participant
Mar 9, 2026
Merged

Make participant argument optional, analyze all if omitted#24
fsimonis merged 9 commits intoprecice:mainfrom
AdityaGupta716:issue-7-optional-participant

Conversation

@AdityaGupta716
Copy link
Contributor

Fixes #7

Problem

Running precice-cli profiling analyze with no participant argument led to an
error instead of showing stats for all participants.

Fix

  • Made participant an optional positional argument (nargs="?", default=None)
  • If no participant is provided, analyzeCommand now loops over all participants
    and displays analysis for each one

Now both of these work correctly:

  • precice-cli profiling analyze <participant> — analyze a single participant
  • precice-cli profiling analyze — analyze all participants

@AdityaGupta716

This comment was marked as spam.

@precice-bot
Copy link

This pull request has been mentioned on preCICE Forum on Discourse. There might be relevant details there:

https://precice.discourse.group/t/gsoc-2026-aditya-gupta/2773/1

@MakisH MakisH added the GSoC Contributed in the context of the Google Summer of Code label Mar 6, 2026
@AdityaGupta716
Copy link
Contributor Author

hi @fsimonis, addressed both of your points Extracted the DataFrame computation into a separate computeAnalysis() function so analyzeCommand is purely control flow with no recursion. Also added an early error with a clear message to stderr when --output is provided without a participant. Added two tests covering both behaviors all 26 tests pass.

@AdityaGupta716
Copy link
Contributor Author

Hi @fsimonis , addressed all three points:Moved print(f"Output timings are in {unit}.") to analyzeCommand so it prints once per invocation,computeAnalysis now purely computes and returns the DataFrame all printing is handled by the caller ,Moved the assertion directly below all_participants
All 26 tests still pass.

@fsimonis
Copy link
Member

fsimonis commented Mar 9, 2026

Tested locally and looks good.
Thanks for the contribution!

@fsimonis fsimonis changed the title Fix: make participant argument optional, analyze all if omitted (#7) Make participant argument optional, analyze all if omitted Mar 9, 2026
@fsimonis fsimonis merged commit 1fc325a into precice:main Mar 9, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GSoC Contributed in the context of the Google Summer of Code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Analyze with optional participant argument

4 participants