You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A better description of the errors found during a .inp file execution
Motivation
Currently when one of the CNS-based modules fail to produce it's output, the error is caught later during the tolerancy check, raising this RuntimeError exception which is not very informative (#1011 and others)
[2024-09-09 20:04:33,709 libutil ERROR] 100.00% of output was not generated for this module and tolerance was set to 5.00%.
Traceback (most recent call last):
File "/data/foldseek/af-data/haddock3/src/haddock/libs/libutil.py", line 335, in log_error_and_exit
yield
File "/data/foldseek/af-data/haddock3/src/haddock/clis/cli.py", line 192, in main
workflow.run()
File "/data/foldseek/af-data/haddock3/src/haddock/libs/libworkflow.py", line 43, in run
step.execute()
File "/data/foldseek/af-data/haddock3/src/haddock/libs/libworkflow.py", line 162, in execute
self.module.run() # type: ignore
File "/data/foldseek/af-data/haddock3/src/haddock/modules/base_cns_module.py", line 61, in run
self._run()
File "/data/foldseek/af-data/haddock3/src/haddock/modules/sampling/rigidbody/__init__.py", line 246, in _run
self.export_io_models(faulty_tolerance=self.params["tolerance"])
File "/data/foldseek/af-data/haddock3/src/haddock/modules/__init__.py", line 300, in export_io_models
self.finish_with_error(_msg)
File "/data/foldseek/af-data/haddock3/src/haddock/modules/__init__.py", line 308, in finish_with_error
raise RuntimeError(reason)
RuntimeError: 100.00% of output was not generated for this module and tolerance was set to 5.00%.
Description
The CNS-based modules can fail to produce output for multiple reasons, however over the years @amjjbonvin has collected several outputs related to a specific reason for failure. See here haddock25/tools/check-error-messages.sh (only for @haddocking/haddock-developers)
These checks can be added with a new parse_errors method of CNSJob, and integrated into it's run method, parsing the stdout of the p.communicate call
Additional context
When implementing this it's important to consider efficiency as these .out files can be quite large and with a lot of lines.
Since the errors are going to be at the end, it's a good idea to read the file backwards and stop when an error is found - for example:
error_dict= {
"exceeded allocation for NOE-restraints": "check your active/passive definition",
"ROTMAT error encountered: rotation vector has zero length": "try turning off the sampling of 180 degrees rotattion"# ... etc
}
defparse_errors(filename: str) ->str:
withopen(filename, 'rb') asfile:
file.seek(0, 2)
size=file.tell()
chunk_size=4096buffer=b''foriinrange(size-1, -1, -chunk_size):
file.seek(max(i-chunk_size, 0))
chunk=file.read(min(chunk_size, i+1))
buffer=chunk+bufferlines=buffer.split(b'\n')
forlineinreversed(lines[1:]):
decoded_line=line.decode('utf-8', errors='replace')
forerror, causeinerror_dict.items():
# Check if this error is knowniferrorindecoded_line:
# return the causereturncause
The text was updated successfully, but these errors were encountered:
Desired feature/enhancement
A better description of the errors found during a
.inp
file executionMotivation
Currently when one of the CNS-based modules fail to produce it's output, the error is caught later during the tolerancy check, raising this
RuntimeError
exception which is not very informative (#1011 and others)Description
The CNS-based modules can fail to produce output for multiple reasons, however over the years @amjjbonvin has collected several outputs related to a specific reason for failure. See here
haddock25/tools/check-error-messages.sh
(only for @haddocking/haddock-developers)These checks can be added with a new
parse_errors
method ofCNSJob
, and integrated into it'srun
method, parsing the stdout of thep.communicate
callAdditional context
When implementing this it's important to consider efficiency as these
.out
files can be quite large and with a lot of lines.Since the errors are going to be at the end, it's a good idea to read the file backwards and stop when an error is found - for example:
The text was updated successfully, but these errors were encountered: