Skip to content

Conversation

@VGPReys
Copy link
Contributor

@VGPReys VGPReys commented Dec 22, 2023

Solve the dictionary changed size during iteration error in topoaa when

Previous bug:

[2023-12-21 17:24:42,019 libutil ERROR] dictionary changed size during iteration
Traceback (most recent call last):
  File "/trinity/login/vreys/benchmarking/haddock3/src/haddock/libs/libutil.py", line 335, in log_error_and_exit
    yield
  File "/trinity/login/vreys/benchmarking/haddock3/src/haddock/clis/cli.py", line 185, in main
    workflow.run()
  File "/trinity/login/vreys/benchmarking/haddock3/src/haddock/libs/libworkflow.py", line 43, in run
    step.execute()
  File "/trinity/login/vreys/benchmarking/haddock3/src/haddock/libs/libworkflow.py", line 155, in execute
    self.module.run()  # type: ignore
  File "/trinity/login/vreys/benchmarking/haddock3/src/haddock/modules/base_cns_module.py", line 61, in run
    self._run()
  File "/trinity/login/vreys/benchmarking/haddock3/src/haddock/modules/topology/topoaa/__init__.py", line 247, in _run
    self.export_io_models(faulty_tolerance=self.params["tolerance"])
  File "/trinity/login/vreys/benchmarking/haddock3/src/haddock/modules/__init__.py", line 285, in export_io_models
    faulty = io.check_faulty()
  File "/trinity/login/vreys/benchmarking/haddock3/src/haddock/libs/libontology.py", line 214, in check_faulty
    self.remove_missing()
  File "/trinity/login/vreys/benchmarking/haddock3/src/haddock/libs/libontology.py", line 224, in remove_missing
    for key2 in element:
RuntimeError: dictionary changed size during iteration
[2023-12-21 17:24:42,030 libutil ERROR] dictionary changed size during iteration

This bug could appear when input molecules are not PDB compliant.
Now the error is managed and if one of the molecule failed, the tolerance parameter will either accept or terminate the run peroperly.

Closes #759

@codecov
Copy link

codecov bot commented Dec 22, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (00c8ac4) 72.54% compared to head (66656a6) 72.51%.
Report is 1 commits behind head on main.

Files Patch % Lines
src/haddock/libs/libontology.py 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #766      +/-   ##
==========================================
- Coverage   72.54%   72.51%   -0.03%     
==========================================
  Files          80       80              
  Lines        7566     7569       +3     
==========================================
  Hits         5489     5489              
- Misses       2077     2080       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@VGPReys VGPReys added bug Something isn't working enhancement Improving something in the codebase labels Dec 22, 2023
@VGPReys VGPReys requested a review from mgiulini January 4, 2024 13:34
@VGPReys VGPReys self-assigned this Jan 4, 2024
@VGPReys VGPReys changed the title update key deletion logic update key deletion logic in topoaa Jan 5, 2024
Copy link
Contributor

@mgiulini mgiulini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it worked on an example!

@VGPReys VGPReys merged commit f3d89c6 into main Jan 5, 2024
@VGPReys VGPReys deleted the size-changed-issue branch January 5, 2024 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement Improving something in the codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dictionary changed size in iteration in example runs

3 participants