Error on export of RF study

Issue #418 resolved
David Platten created an issue

OpenSkin export fails. The following is in the default.log:

[2016-07-13 16:35:43,549: ERROR/MainProcess] Task remapp.exports.rf_export.rfopenskin[16c6caf1-f8d9-4ec4-b951-d6d1091bad77] raised unexpected: AttributeError("'NoneType' object has no attribute 'code_meaning'",) Traceback (most recent call last): File "c:\python27\lib\site-packages\celery\app\trace.py", line 240, in trace_task R = retval = fun(args, kwargs) File "c:\python27\lib\site-packages\celery\app\trace.py", line 438, in protected_call return self.run(args, **kwargs) File "c:\Python27\Lib\site-packages\openrem\remapp\exports\rf_export.py", line 1070, in rfopenskin if "Copper" in filter.xray_filter_material.code_meaning: AttributeError: 'NoneType' object has no attribute 'code_meaning'

It seems that the export routine can't cope when there is no filter data.

The reason I was trying to export this was that the in-built openSkin calculations failed - possibly for the same reason.

Comments (4)

  1. Ed McDonagh

    Why is it raising an AttributeError? If there were no filters, then it should raise an ObjectDoesNotExist error I think, which would be caught and dealt with.

    This seems to have a filter, but xray_filter_material is set to None. 😕

  2. David Platten reporter

    There is already a check for this in make_skin_map.py (lines 129 to 136), so I don't think that this can be the reason that the skin dose maps are failing for certain studies:

    filter_cu = 0.0
    if irrad.irradeventxraysourcedata_set.get().xrayfilters_set.all():
        for xray_filter in irrad.irradeventxraysourcedata_set.get().xrayfilters_set.all():
            try:
                if xray_filter.xray_filter_material.code_value == 'C-127F9':
                    filter_cu += float(xray_filter.xray_filter_thickness_minimum)
            except AttributeError:
                pass
    
  3. Log in to comment