Skip to content

Potential revision to optimise convert_byte_size #14

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

Merged
merged 1 commit into from
Apr 9, 2025

Conversation

benjamindonnachie
Copy link
Contributor

I've been optimising a lot of Python code recently and offer this as a potential alternative to convert_byte_size(). Removing the nested if.. elif... statements and making it easier to add additional si prefixes in the future if desired.

I've been optimising a lot of Python code recently and offer this as a potential alternative to convert_byte_size().  Removing the nested if.. elif... statements and making it easier to add additional si prefixes in the future if desired.
@cklunch
Copy link
Collaborator

cklunch commented Apr 2, 2025

This looks like a great improvement!

@bhass-neon It looks like we're currently duplicating the convert_byte_size() function in aop_download.py and metadata_helpers.py. Can you take a look and see if we can implement the improved version just in metadata_helpers.py, so the function can be used in both aop_download and tabular_download from the same source?

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.

3 participants