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

Add read_metadata() function #26

Merged
merged 4 commits into from
Jan 25, 2023

Conversation

alexdewar
Copy link
Contributor

Closes #25.

It would be handy to be able to read just the metadata from a data file without having to load everything else. I've added a new read_metadata() function to do this.

It could be useful outside the submodule.
This is essentially a small wrapper to read_header, which just returns
the metadata from the specified file.

Closes ImperialCollegeLondon#25.
@alexdewar
Copy link
Contributor Author

It looks like #24 needs to be merged first.

@codecov
Copy link

codecov bot commented Jan 24, 2023

Codecov Report

Merging #26 (58c09d0) into develop (9f57a54) will increase coverage by 0.11%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop      #26      +/-   ##
===========================================
+ Coverage    92.24%   92.36%   +0.11%     
===========================================
  Files            3        3              
  Lines          129      131       +2     
===========================================
+ Hits           119      121       +2     
  Misses          10       10              
Impacted Files Coverage Δ
csvy/__init__.py 100.00% <100.00%> (ø)
csvy/readers.py 91.42% <100.00%> (+0.25%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Collaborator

@dalonsoa dalonsoa left a comment

Choose a reason for hiding this comment

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

I understand this is just a convenience function, but is it really that much advantage compared to just doing read_header(filename, marker, **kwargs)[0], which is all it is?

If you think it is, then you will need to add the corresponding test.

@alexdewar alexdewar requested a review from dalonsoa January 25, 2023 13:22
@alexdewar
Copy link
Contributor Author

I think it is useful as a convenience function, though that's obviously a bit subjective!

I've added a test now.

@dalonsoa dalonsoa merged commit 0a7e760 into ImperialCollegeLondon:develop Jan 25, 2023
@alexdewar alexdewar deleted the read_metadata branch January 25, 2023 16:43
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.

Allow for just reading a file's metadata
2 participants