Skip to content

[Bug] Local host SED fitting fails due to uninitialized variable use_re #365

@manning-ncsa

Description

@manning-ncsa

🐞 Bug Report

Describe the bug

As of v1.7.3, the local host SED fitting task can fail due to the lack of variable initialization in sbi_pp.py.

[ERROR/ForkPoolWorker-24] Task Local Host SED Fitting[139ef8df-41c3-4e4d-a7f1-f36a5b575f81] raised unexpected: UnboundLocalError("cannot access local variable 'use_res' where it is not associated with a value")
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/celery/app/trace.py", line 479, in trace_task
    R = retval = fun(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/celery/app/trace.py", line 779, in __protected_call__
    return self.run(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/host/transient_tasks.py", line 1651, in local_host_sed_fitting
    LocalHostSEDFitting(transient_name).run_process()
  File "/app/host/transient_tasks.py", line 262, in run_process
    status_message = self._run_process(transient)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/host/transient_tasks.py", line 1202, in _run_process
    status_message = super()._run_process(
                     ^^^^^^^^^^^^^^^^^^^^^
  File "/app/host/transient_tasks.py", line 1114, in _run_process
    posterior, errflag = fit_model(
                         ^^^^^^^^^^
  File "/app/host/prospector.py", line 754, in fit_model
    output, errflag = fit_sbi_pp(observations, fit_type=fit_type)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/host/SBI/run_sbi_blast.py", line 281, in fit_sbi_pp
    chain, obs, flags = sbi_pp.sbi_pp(
                        ^^^^^^^^^^^^^^
  File "/app/host/SBI/sbi_pp.py", line 896, in sbi_pp
    ) = sbi_missing_and_noisy(obs=obs, run_params=run_params, sbi_params=sbi_params)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/host/SBI/sbi_pp.py", line 696, in sbi_missing_and_noisy
    return ave_theta, use_res, timeout_flag, cnt
           ^^^^^^^^^
UnboundLocalError: cannot access local variable 'use_res' where it is not associated with a value

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions