Skip to content

Commit

Permalink
add log to QA
Browse files Browse the repository at this point in the history
  • Loading branch information
moustakas committed Apr 26, 2017
1 parent 83a320d commit c1751ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 4 additions & 1 deletion py/desitarget/QA.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from . import __version__ as desitarget_version

from desiutil import depend
from desiutil.log import get_logger, DEBUG
import warnings

def generate_fluctuations(brickfilename, targettype, depthtype, depthorebvarray, random_state=None):
Expand Down Expand Up @@ -49,6 +50,8 @@ def generate_fluctuations(brickfilename, targettype, depthtype, depthorebvarray,
"""
if random_state is None:
random_state = np.random.RandomState()

log = get_logger()

#ADM check some impacts are as expected
dts = ["DEPTH_G","GALDEPTH_G","DEPTH_R","GALDEPTH_R","DEPTH_Z","GALDEPTH_Z","EBV"]
Expand All @@ -69,7 +72,7 @@ def generate_fluctuations(brickfilename, targettype, depthtype, depthorebvarray,
if not targettype in tts:
fluc = np.ones(nbricks)
mess = "fluctuations for targettype {} are set to one".format(targettype)
warnings.warn(mess, RuntimeWarning)
log.warning(mess)
return fluc

#ADM the target fluctuations are actually called FLUC_* in the model dictionary
Expand Down
8 changes: 2 additions & 6 deletions py/desitarget/mock/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,12 +570,8 @@ def _create_raslices(output_dir, ioutput_dir, brickname):
except:
os.makedirs(thisradir)

try:
from memory_profiler import profile
except:
pass

@profile
#from memory_profiler import profile
#@profile
def targets_truth(params, output_dir, realtargets=None, seed=None, verbose=True,
clobber=False, bricksize=0.25, outbricksize=0.25, nproc=1):
"""
Expand Down

0 comments on commit c1751ca

Please sign in to comment.