Skip to content

Patch derived quantity overwriting csv file#706

Merged
jhdark merged 4 commits into
festim-dev:fenicsxfrom
RemDelaporteMathurin:patch-overwrite-csv
Mar 7, 2024
Merged

Patch derived quantity overwriting csv file#706
jhdark merged 4 commits into
festim-dev:fenicsxfrom
RemDelaporteMathurin:patch-overwrite-csv

Conversation

@RemDelaporteMathurin
Copy link
Copy Markdown
Collaborator

Proposed changes

This is a patch to #705

I just reworked the logic to check if it's the first time we write the csv and if so write the file and write the header, otherwise just append to it.

That requires to add another attribute ._first_time_export, I don't know if we should document it or not but I added _ to say it's a private attribute. What do you think @jhdark ?

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 linked an issue Mar 6, 2024 that may be closed by this pull request
@RemDelaporteMathurin RemDelaporteMathurin added bug Something isn't working fenicsx Issue that is related to the fenicsx support labels Mar 6, 2024
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.10%. Comparing base (154a1f8) to head (2e60697).

Additional details and impacted files
@@           Coverage Diff            @@
##           fenicsx     #706   +/-   ##
========================================
  Coverage    99.09%   99.10%           
========================================
  Files           24       24           
  Lines         1110     1112    +2     
========================================
+ Hits          1100     1102    +2     
  Misses          10       10           

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

@jhdark
Copy link
Copy Markdown
Collaborator

jhdark commented Mar 7, 2024

Yeah don't think anything is needed in the doc strings for this hidden attribute as it should get a given, we could potentially add a note in the docs later down the line, but otherwise this is good

@jhdark jhdark merged commit 36ff1fb into festim-dev:fenicsx Mar 7, 2024
@RemDelaporteMathurin RemDelaporteMathurin deleted the patch-overwrite-csv branch March 7, 2024 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working fenicsx Issue that is related to the fenicsx support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Derived quantities append to file instead of overwriting

2 participants