Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TXTExport features #676

Merged
merged 3 commits into from
Jan 15, 2024
Merged

Conversation

KulaginVladimir
Copy link
Collaborator

@KulaginVladimir KulaginVladimir commented Jan 7, 2024

Proposed changes

This PR implements several minor modifications to TXTExport & TXTExports classes:

  1. Based on Formatting Issues With Exporting Mobile Concentration Files in Workshop task1 #672, TXTExport was modified to accept a user-defined format for column headers in the output files.
  2. Based on TXTExports & TXTExport features #675:
    • At the initialisation stage, TXTExport.times are passed to Stepsize.milestones (if they are not present) in order to ensure that data is actually exported at these times.
    • TXTExports was modified to allow users export data at all timesteps. Also, a deprication warning was added.

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)

Copy link

codecov bot commented Jan 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (22ecf3e) 98.92% compared to head (7c6ca17) 98.93%.
Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #676      +/-   ##
==========================================
+ Coverage   98.92%   98.93%   +0.01%     
==========================================
  Files          57       57              
  Lines        2130     2154      +24     
==========================================
+ Hits         2107     2131      +24     
  Misses         23       23              

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

@jhdark
Copy link
Collaborator

jhdark commented Jan 8, 2024

This could be a good opportunity to add in filename as a parameter of the TXTExport class same as the 'XDMFExport' class, rather than just as a property. What do you think @RemDelaporteMathurin ? Even if not, the doc strings of the class should be updated to include the attributes.

@RemDelaporteMathurin
Copy link
Collaborator

@jhdark that's an excellent idea! We didn't have a file name initially since it was defined from the label (and we had several files per export) but now we can definitely have a file name argument!

@KulaginVladimir do you think you could add this?

Copy link
Collaborator

@RemDelaporteMathurin RemDelaporteMathurin left a comment

Choose a reason for hiding this comment

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

Hi @KulaginVladimir a few comments. Also as @jhdark said maybe we could get rid of label and simply expose filename just like we do for other exports.

test/unit/test_exports/test_txt_exports.py Outdated Show resolved Hide resolved
festim/generic_simulation.py Show resolved Hide resolved
festim/exports/txt_export.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@RemDelaporteMathurin RemDelaporteMathurin left a comment

Choose a reason for hiding this comment

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

This looks great to me! Thanks @KulaginVladimir

I'll let @jhdark review this before merging since he suggested the filename property

Copy link
Collaborator

@jhdark jhdark left a comment

Choose a reason for hiding this comment

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

Looks good to me

@RemDelaporteMathurin RemDelaporteMathurin merged commit 621769f into festim-dev:main Jan 15, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants