Skip to content

Fix behaviour of p7_trace_Compare on failed comparison#344

Open
althonos wants to merge 1 commit intoEddyRivasLab:developfrom
althonos:patch-1
Open

Fix behaviour of p7_trace_Compare on failed comparison#344
althonos wants to merge 1 commit intoEddyRivasLab:developfrom
althonos:patch-1

Conversation

@althonos
Copy link
Contributor

p7_trace_Compare is a comparison function and is reported to return eslOK on equality and eslFAIL otherwise, like other comparison functions (e.g. p7_hmm_Compare). This is also the intended behaviour according to the function documentation:

hmmer/src/p7_trace.c

Lines 788 to 793 in bb7c3e1

/* Function: p7_trace_Compare()
* Synopsis: Compare two traces for identity
* Incept: SRE, Wed Aug 20 09:05:24 2008 [Janelia]
*
* Purpose: Compare two tracebacks; return <eslOK> if they
* are identical, <eslFAIL> if not.

However, the current implementation instead calls esl_fatal on any failed equality test and exits the current process.

This is not really a problem anywhere given that AFAICT p7_trace_Compare is only used in unit tests (where the failed comparison would then trigger the same esl_fatal("FAIL") call anyway), but I noticed in PyHMMER after trying to use p7_trace_Compare to compare traces and seeing my test program forcefully exit.

althonos added a commit to althonos/pyhmmer that referenced this pull request Dec 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant