fudge icon indicating copy to clipboard operation
fudge copied to clipboard

Update plot_evaluation for new x4i

Open brown170 opened this issue 1 year ago • 0 comments

When retrieving EXFOR data using the new version of x4i, it does not go well:

Traceback (most recent call last):
  File "/Users/dbrown/Desktop/fudge/brownies/bin/plot_evaluation.py", line 449, in <module>
    makeCrossSectionPlot(
  File "/Users/dbrown/Desktop/junk/venv/lib/python3.12/site-packages/brownies/BNL/plot_evaluation/__init__.py", line 702, in makeCrossSectionPlot
    generatePlot(observable='crossSection',
  File "/Users/dbrown/Desktop/junk/venv/lib/python3.12/site-packages/brownies/BNL/plot_evaluation/__init__.py", line 284, in generatePlot
    plot2d.makePlot2d(
  File "/Users/dbrown/Desktop/junk/venv/lib/python3.12/site-packages/fudge/vis/matplotlib/plot2d.py", line 752, in makePlot2d
    __makePlot2d(_datasets, xAxisSettings, yAxisSettings, theTitle=theTitle, legendOn=legendOn, legendXY=legendXY,
  File "/Users/dbrown/Desktop/junk/venv/lib/python3.12/site-packages/fudge/vis/matplotlib/plot2d.py", line 644, in __makePlot2d
    raise err
  File "/Users/dbrown/Desktop/junk/venv/lib/python3.12/site-packages/fudge/vis/matplotlib/plot2d.py", line 638, in __makePlot2d
    dataset.convertUnits(xUnit=xAxisSettings.unit, yUnit=yAxisSettings.unit)
  File "/Users/dbrown/Desktop/junk/venv/lib/python3.12/site-packages/fudge/vis/matplotlib/plot2d.py", line 443, in convertUnits
    self.xUnit = convertUnit(self.xUnit, xUnit, self.x, self.xerr, self.legend)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dbrown/Desktop/junk/venv/lib/python3.12/site-packages/fudge/vis/matplotlib/plot2d.py", line 115, in convertUnit
    xErrs[i1] = conversionFactor * x1
                ~~~~~~~~~~~~~~~~~^~~~
TypeError: can't multiply sequence by non-int of type 'float'

Caleb should have the updated file. I tested it and it works.

brown170 avatar Sep 18 '24 17:09 brown170