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

Check the consistency of number of items in metadata and data in dry_load_files function #824

Merged
merged 1 commit into from
Apr 16, 2024

Conversation

dachengx
Copy link
Collaborator

What is the problem / what does the code in this PR do

In strax/storage/common.py, the number of items in metadata and data is checked:

if len(data) != chunk_info["n"]:
raise strax.DataCorrupted(
f"Chunk {chunk_info['filename']} of {chunk_info['run_id']} has {len(data)} items, "
f"but chunk_info {chunk_info} says {chunk_info['n']}"
)

This PR also checks this in dry_load_files function

Can you briefly describe how it works?

Can you give a minimal working example (or illustrate with a figure)?

Please include the following if applicable:

  • Update the docstring(s)
  • Update the documentation
  • Tests to check the (new) code is working as desired.
  • Does it solve one of the open issues on github?

Please make sure that all automated tests have passed before asking for a review (you can save the PR as a draft otherwise).

@dachengx dachengx marked this pull request as ready for review April 16, 2024 14:11
@coveralls
Copy link

Coverage Status

coverage: 91.504% (+0.01%) from 91.494%
when pulling 179ede4 on check_n_dry_load_files
into 208d530 on master.

@dachengx dachengx requested a review from yuema137 April 16, 2024 15:01
@dachengx dachengx merged commit 4305e99 into master Apr 16, 2024
9 checks passed
@dachengx dachengx deleted the check_n_dry_load_files branch April 16, 2024 15:01
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