ratt-ru / pyxis

Python Extensions for Interferometry Scripting
3 stars 5 forks source link

RunTimeError when setting MS variable if MS doesn't exist. #24

Closed SpheMakh closed 9 years ago

SpheMakh commented 9 years ago

This is not good when running a simulation, because I usually set the MS name before I create the MS. I'm not sure why this happens since the line in question (line 462 in ms.py) is within a try-catch clause. ms_issue

o-smirnov commented 9 years ago

Ah, but there's a traceback.print_exc() in the except clause there which prints the exception anyway, just for the user's reference. So this is annoying but harmless. I should add a print statement after print_exc() though to clarify this situation, since the output looks exactly like a fatal error.

Better yet: add this at line 460 (can't check it myself at the moment)

if not exists(MS):
  warn("$MS doesn't exist"); 
  return None;

for a kinder, gentler output in this simple case. That way the exception only shows up for the really screwy situations such as corrupt MSs.

SpheMakh commented 9 years ago

Done

o-smirnov commented 9 years ago

Wow, quick. :)

On Wed, Jan 28, 2015 at 8:08 PM, Sphesihle Makhathini < notifications@github.com> wrote:

Closed #24 https://github.com/ska-sa/pyxis/issues/24.

— Reply to this email directly or view it on GitHub https://github.com/ska-sa/pyxis/issues/24#event-226264037.