Skip to content

Conversation

@ihsaan-ullah
Copy link
Collaborator

@ihsaan-ullah ihsaan-ullah commented May 26, 2023

@ mention of reviewers

@Didayolo

A brief description of the purpose of the changes contained in this PR.

Now users can see file size in readable format in Resources -> Datasets
Screenshot 2023-05-26 at 2 44 26 PM

Issues this PR resolves

#713 -> Interfaces -> Point 1

Add the size of the files

Checklist

  • Code review by me
  • Hand tested by me
  • I'm proud of my work
  • Code review by reviewer
  • Hand tested by reviewer
  • CircleCi tests are passing
  • Ready to merge

@ihsaan-ullah ihsaan-ullah mentioned this pull request May 26, 2023
42 tasks
@ihsaan-ullah ihsaan-ullah changed the title Resources -> Datasets : file sizes added in readable format File size added in readable format in Resources -> Datasets May 26, 2023
@Didayolo
Copy link
Member

Thank you for the PR.

I think it breaks the buttons to navigate through pages in the resources interface (bottom right):

Capture d’écran 2023-05-26 à 15 38 43

@Didayolo
Copy link
Member

Nice work!

@Didayolo Didayolo merged commit 61830da into develop May 26, 2023
@Didayolo Didayolo deleted the resource_interface_dataset_size branch May 26, 2023 14:44
@ihsaan-ullah
Copy link
Collaborator Author

@Didayolo

When a submissions file is stored, the standard used for Kilobytes (KB) is 1024 and not 1000.
https://github.com/codalab/codabench/blob/develop/src/apps/datasets/models.py#L67

In the change I have made, I use 1000.

// loop over n until it is greater than 1000
while(n >= 1000 && ++i){
     n = n/1000;
 }

Should this be changed to 1024?

@Didayolo
Copy link
Member

Didayolo commented May 27, 2023

@ihsaan-ullah

So I guess right now we showing MiB, GiB, etc. instead of MB or GB.

Yes, maybe it is better to change this to 1024.

@ihsaan-ullah
Copy link
Collaborator Author

I think KiB, MiB, GiB are multiples of 1024 while KB, MB, GB are multiples of 1000.

my change is showing KB, MB, Gb.

@Didayolo
Copy link
Member

OK then we can let it as it is, because the information provided is accurate.

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