Skip to content

Commit

Permalink
revert inclusion of profiling code in fastspecfit.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jdbuhler committed Sep 5, 2024
1 parent 86414a8 commit 0332207
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions py/fastspecfit/fastspecfit.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
from fastspecfit.singlecopy import sc_data
from fastspecfit.util import BoxedScalar, MPPool

import cProfile as profile
import pstats
pr = profile.Profile()
shot = 0

def fastspec_one(iobj, data, out_dtype, broadlinefit=True, fastphot=False,
constrain_age=False, no_smooth_continuum=False,
Expand All @@ -44,20 +40,11 @@ def fastspec_one(iobj, data, out_dtype, broadlinefit=True, fastphot=False,
# output structure
out = BoxedScalar(out_dtype)

global shot
if shot > 0:
pr.enable()

continuummodel, smooth_continuum = continuum_specfit(
data, out, templates, igm, phot, constrain_age=constrain_age,
no_smooth_continuum=no_smooth_continuum,
fastphot=fastphot, debug_plots=debug_plots)

if shot > 0:
pr.disable()
else:
shot = 1

# Optionally fit the emission-line spectrum.
if fastphot:
emmodel = None
Expand Down Expand Up @@ -224,10 +211,6 @@ def fastspec(fastphot=False, stackfit=False, args=None, comm=None, verbose=False

log.info(f'Fitting {Spec.ntargets} object(s) took {time.time()-t0:.2f} seconds.')

st = pstats.Stats(pr).strip_dirs().sort_stats("cumulative")
st.print_stats()
st.print_callees()

write_fastspecfit(results, meta, modelspectra=modelspectra, outfile=args.outfile,
specprod=Spec.specprod, coadd_type=Spec.coadd_type,
fphotofile=sc_data.photometry.fphotofile,
Expand Down

0 comments on commit 0332207

Please sign in to comment.