Skip to content

Conversation

@RemDelaporteMathurin
Copy link
Collaborator

Proposed changes

we recently added a __del__ method to HydrogenTransportProblemDiscontinuous for properly closing the VTX writers when the execution was ended abruptly.

However, sometimes these writers won't even created yet, so we were trying to close something that didn't exist, leading to the error message always being:

Traceback (most recent call last):
  File "/home/remidm/FESTIM/src/festim/hydrogen_transport_problem.py", line 1886, in __del__
AttributeError: 'VTXSpeciesExport' object has no attribute 'writer'

This PR fixes it by first checking if the export has a writer or not

Types of changes

What types of changes does your code introduce to FESTIM?

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code refactoring
  • Documentation Update (if none of the other choices apply)
  • New tests

Checklist

  • Black formatted
  • Unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@RemDelaporteMathurin RemDelaporteMathurin changed the base branch from main to fenicsx September 19, 2025 13:23
@codecov
Copy link

codecov bot commented Sep 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.95%. Comparing base (f01ed4b) to head (4a62b14).
⚠️ Report is 78 commits behind head on fenicsx.

Additional details and impacted files
@@           Coverage Diff            @@
##           fenicsx    #1034   +/-   ##
========================================
  Coverage    94.95%   94.95%           
========================================
  Files           44       44           
  Lines         3111     3112    +1     
========================================
+ Hits          2954     2955    +1     
  Misses         157      157           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@RemDelaporteMathurin RemDelaporteMathurin merged commit 0783ddc into fenicsx Sep 19, 2025
8 checks passed
@RemDelaporteMathurin RemDelaporteMathurin deleted the fix-del branch September 19, 2025 13:28
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.

2 participants