Giter Club home page Giter Club logo

give's People

Contributors

bringhurst avatar dmanno avatar ryanday36 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

give's Issues

Address large files being given

Currently large files being given will take a long time using cp. I'm not sure we want to encourage the reproduction of large files that are already stored, so this may be a non-issue.

We should at least check file size before "giving", maybe print an error and exit if the file is too large? Or let the user know the give is going to take too long. If we want give to allow large file sharing, we need to parallelize the copy or let the user know it could take a very long time.

@dayr @jennfshr thoughts?

take reports file sizes in YB in python3

When using python 3, take reports file sizes in YB:

$> python --version
Python 2.7.5
$> take
 jgreen has given:
   189  B May 28 09:36 yum.out
     9 MB Jul 17 14:55 zerolibs.txt
   2 file(s)
You have 2 file(s) to take.
$> module load python/3.6 
$> python --version
Python 3.6.3 :: Anaconda, Inc.
$> take
 jgreen has given:
     0 YB May 28 09:36 yum.out
     0 YB Jul 17 14:55 zerolibs.txt
   2 file(s)
You have 2 file(s) to take.

This is with give version 3.1-4 (as reported via rpm).

I believe the issue is in the list_a_file method in take. It uses a set of conditionals to decide what units to display file sizes in. Between python 2 and 3, the / operator changed from integer to floating point division, so all of the conditionals now return a value greater than 0. This means the first condition evaluates to true all of the time, which leads to YB being the unit.

Here is the division that list_a_file relies on done in both python 2 and 3 to illustrate what is going on:

$> python --version
Python 2.7.5
$> python -c "print(20 / 2**80)"
0
$> module load python/3.6
$> python --version
Python 3.6.3 :: Anaconda, Inc.
$> python -c "print(20 / 2**80)"
1.6543612251060553e-23

I can see two possible ways of fixing this:

  1. Change all of the / operators in the conditionals to // operators (recovers integer division in python 3, and works in python 2.7).
  2. Change all of the the > 0 to > 1 in the conditionals.

There might be other solutions, too.

Thanks,
David

Cleanup repo

Create src, docs, contrib, and so on then put files in appropriate places. Placeholder so I don't forget about this...

Python3 compatability

Need to address python3. Either explicitly require python2, print a friendly message, and exit or make give.py python3 compatible.

Currently, for a user with python3 in their env, give crashes at the print and produces a syntax error.

@dayr has this come up as an issue at LLNL?
@jennfshr @dayr any preference on implementation?

I will merge Ryan's previous changes into master. If we switch to python3 compatibility, we should branch and version up. If we explicitly require python 2, we should minor version up.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.