Commit 57963c89 authored by Marc Betoule's avatar Marc Betoule
Browse files

cleanning utils

parent 5d6e2581
......@@ -21,7 +21,6 @@ import shutil
import threading
import Queue
import logging
from utils import str_date
from contextlib import closing
logger = logging.getLogger("scheduler")
......
......@@ -313,37 +313,6 @@ def create_pipe(pipename, prefix=[]):
print "You should be able to browse the result on the web page http://localhost:8080\n"
print "Retype the current command line to get those instructions back."
def hash_file(codefile):
"""Use cheksum algorithm to return a unique key for file.
DEPRECATED: use crc32
Parameters
----------
codefile: string.
Returns
-------
string
Examples
--------
>>> print(hash_file('../test/codesample.py'))
3DDAAEC1
"""
if not path.exists(codefile):
print('Try to compute checksum of non existing file %s.'%codefile)
return None
sum_binary = "cksum"
# Computes checksum
sp = subprocess.Popen([sum_binary, codefile], stdout=subprocess.PIPE)
res = sp.communicate()[0]
key = "%X" % int(res.split(' ')[0])
if sp.returncode != 0:
print('Error while computing checksum of file %s.'%codefile)
return key
def get_hashkey(s, starthash):
"""Return a unique key which identify code string
......@@ -522,3 +491,4 @@ def make_dict(l):
if __name__ == "__main__":
import doctest
doctest.testmod()
......@@ -20,7 +20,6 @@ from environment import *
from glob import glob
import cPickle as pickle
from datetime import datetime
from utils import str_web
import subprocess
import threading
import traceback
......
......@@ -97,15 +97,12 @@ def main(print_info=print_info):
## Build pipeline instance
P = Pipeline(pipe_dot, code_dir=code_dir, prefix=prefix, matplotlib=True, matplotlib_interactive=True)
<<<<<<< HEAD:test/cmb/main.py
=======
P.to_dot('cmb.dot')
cmbin = []
for sim_id in sim_ids:
cmbin.append((nside, sim_id))
P.push(cmb=cmbin)
P.push(noise=[nside])
>>>>>>> c5354a8... Fix bugs in flatten, but compute_hash remain tbd:test/cmb/main.py
## Interactive mode
if options.debug:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment