Skip to content

permit corrupt MRC files #1292

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

permit corrupt MRC files #1292

wants to merge 1 commit into from

Conversation

garrettwrong
Copy link
Collaborator

lots of published datasets are full of junk metadata ...

This should allow us to still open them. We had fixed this in a few places, but I found one more trying to load a new dataset. Looking around I spotted an additional one as well.

lots of published datasets are full of junk metadata
@garrettwrong garrettwrong self-assigned this Jun 11, 2025
@garrettwrong garrettwrong added enhancement New feature or request cleanup labels Jun 11, 2025
@garrettwrong
Copy link
Collaborator Author

Noting this will emit a warning about the MRC file's metadata, but still allow us to read the data.

/scratch/gbwright/miniconda3/envs/smca/lib/python3.12/site-packages/mrcfile/mrcinterpreter.py:206: RuntimeWarning: Map ID string not found - not an MRC file, or file is corrupt
  warnings.warn(msg, RuntimeWarning)
/scratch/gbwright/miniconda3/envs/smca/lib/python3.12/site-packages/mrcfile/mrcinterpreter.py:216: RuntimeWarning: Unrecognised machine stamp: 0x00 0x00 0x00 0x00
  warnings.warn(str(err), RuntimeWarning)

Copy link

codecov bot commented Jun 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.60%. Comparing base (c255119) to head (834ec5d).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1292   +/-   ##
========================================
  Coverage    90.60%   90.60%           
========================================
  Files          132      132           
  Lines        14181    14181           
========================================
  Hits         12849    12849           
  Misses        1332     1332           

☔ 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.

@garrettwrong garrettwrong requested a review from j-c-c June 11, 2025 15:26
@garrettwrong garrettwrong marked this pull request as ready for review June 11, 2025 15:29
@garrettwrong garrettwrong requested a review from janden as a code owner June 11, 2025 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant