Bill of Materials Error caused by Dust emission
tjamartin opened this issue · 4 comments
An error occurs when loading the "Bill of Materials" page, this in turn causes the webpage to only display "Internal Server Error". Debugging efforts point to the input for Dust emissions being the problem. Have to find where in the code it is getting caught up. I have also attached a screenshot of the error retrieved from debugging process.
Just an update, I believe I found the particular try and except block where this error is coming from. Can be found here:
bgexplorer/bgexplorer/modelviewer/billofmaterials.py
Lines 84 to 87 in 11390b5
A possible solution (that I don't particularly like) is to change this line:
to:
rate = sum(spec.ratewitherr for spec in specmatch if spec.category != "Dust")
I don't like this solution because we are omitting the contribution of dust in the Bill of Materials list/page (but it does fix the page errors)
The BoM table is intended to only show the intrinsic specs at a glance, so your suggested change would be OK in that respect. (It's meant to be a quick way to compare e.g. grades of copper or tell at a glance which assay a component is pegged to. If we really want to show dust, we should add more columns).
My concern is it's a bandaid that fixes this particular problem but not the underlying cause: it's not being careful with units and it's not catching the right exception(s). I should have some time today or tomorrow to take a look
Okay great! I had the exact same thought of it being a bandaid rather than a fix for the actual emission rate unit. If you don't have the time to take a look just let me know and I can help as much as I can!