aiidalab / aiidalab-widgets-base

Reusable widgets for AiiDAlab applications
MIT License
6 stars 17 forks source link

Fix download of binary files in FolderDataViewer #579

Closed danielhollas closed 2 months ago

danielhollas commented 3 months ago

Retrieved folder of CalcJobs may contain binary files. FolderDataViewer would except if the user tried to display / download such file.

Fixes #350

danielhollas commented 3 months ago

@sphuber would mind taking a quick look at this one?

Essentially, we're trying to download files from the file repository via the FolderData interface, without knowing upfront whether it is a binary or text file. I am wondering if there is a better approach than I took here.

sphuber commented 3 months ago

@sphuber would mind taking a quick look at this one?

Essentially, we're trying to download files from the file repository via the FolderData interface, without knowing upfront whether it is a binary or text file. I am wondering if there is a better approach than I took here.

Seems reasonable to me. AiiDA doesn't store any information about the encoding in the repository. It just works with byte streams. It is up to the client to know and how to deal with it.

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 96.17%. Comparing base (cc4291b) to head (468383a). Report is 2 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #579 +/- ## ========================================== + Coverage 87.07% 96.17% +9.10% ========================================== Files 27 11 -16 Lines 4649 1177 -3472 ========================================== - Hits 4048 1132 -2916 + Misses 601 45 -556 ``` | [Flag](https://app.codecov.io/gh/aiidalab/aiidalab-widgets-base/pull/579/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab) | Coverage Δ | | |---|---|---| | [python-3.10](https://app.codecov.io/gh/aiidalab/aiidalab-widgets-base/pull/579/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab) | `96.17% <100.00%> (+9.10%)` | :arrow_up: | | [python-3.9](https://app.codecov.io/gh/aiidalab/aiidalab-widgets-base/pull/579/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab) | `96.17% <100.00%> (+9.07%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.