From 70fada5e8e60b6b4f069de7c002302e36de396e0 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 28 Jun 2023 16:46:22 -0400 Subject: [PATCH 01/14] add contol for capture DOF --- brownies/bin/mcres.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brownies/bin/mcres.py b/brownies/bin/mcres.py index e9117b9c..771e8354 100755 --- a/brownies/bin/mcres.py +++ b/brownies/bin/mcres.py @@ -271,7 +271,7 @@ def get_DOFs(__spingroups, __config, __urr): if __urr is None: raise ValueError("Need URR region in evaluation to use ENDF file to initialize DOFs") return dict(__urr.DOFs) - return {find_matching_spingroup(cfgsg, __spingroups).lj: {'elastic': cfgsg["nDOF"], 'capture': 0} + return {find_matching_spingroup(cfgsg, __spingroups).lj: {'elastic': cfgsg["nDOF"], 'capture': cfgsg.get('gDOF', 0)} for cfgsg in __config['spingroups']} From 70eb83b765ff8b2934c8e243cc687a9027f30ffd Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 28 Jul 2023 14:03:28 -0400 Subject: [PATCH 02/14] try to sync up the covariance filenames --- brownies/bin/endf2gnds.py | 6 +++--- brownies/bin/gnds2endf.py | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/brownies/bin/endf2gnds.py b/brownies/bin/endf2gnds.py index 0ef18a33..3faea9b6 100755 --- a/brownies/bin/endf2gnds.py +++ b/brownies/bin/endf2gnds.py @@ -52,11 +52,11 @@ def process_args( ) : outFile = args.outputFile if outFile is None: outFile = os.path.basename(inFile) + '.gnds.xml' - outCovFile = os.path.basename(inFile) + '.gnds-covar.xml' + outCovFile = os.path.basename(inFile) + '.gndsCov.xml' elif '.xml' in outFile: - outCovFile = outFile.replace('.xml', '-covar.xml') + outCovFile = outFile.replace('.xml', '.gndsCov.xml') else: - outCovFile = outFile + "-covar.xml" + outCovFile = outFile + ".gndsCov.xml" try: kwargs = {} diff --git a/brownies/bin/gnds2endf.py b/brownies/bin/gnds2endf.py index a828f158..10a3ffa8 100755 --- a/brownies/bin/gnds2endf.py +++ b/brownies/bin/gnds2endf.py @@ -21,7 +21,7 @@ description = """Translate a GNDS file to ENDF-6. Sample use: python gnds2endf.py n-001_H_001.xml n-001_H_002.endf -If file n-001_H_001-covar.xml exists, covariances will automatically be read from it. +If file n-001_H_001.gndsCov.xml exists, covariances will automatically be read from it. The output file name is optional, defaults to the input file with '.endf' appended.""" __doc__ = description @@ -38,7 +38,8 @@ parser.add_argument('gnds', help='GNDS file to translate.') parser.add_argument('output', nargs='?', default=None, help='The translated ENDF file.') -if( __name__ == '__main__' ) : + +if __name__ == '__main__': args = parser.parse_args( ) gndsCov = None From c41aa8fa25a6893f0e480b6c076641ad746ea625 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 8 Jan 2025 12:49:02 -0500 Subject: [PATCH 03/14] latex escapes in comments --- .../CoulombPlusNuclearElastic.py | 14 +++++----- .../RutherfordScattering.py | 28 +++++++++---------- .../chargedParticleElastic/misc.py | 2 +- .../nuclearAmplitudeExpansion.py | 8 +++--- .../nuclearPlusInterference.py | 20 ++++++------- 5 files changed, 36 insertions(+), 36 deletions(-) diff --git a/fudge/reactionData/doubleDifferentialCrossSection/chargedParticleElastic/CoulombPlusNuclearElastic.py b/fudge/reactionData/doubleDifferentialCrossSection/chargedParticleElastic/CoulombPlusNuclearElastic.py index b4f8739f..7a0cf2bb 100644 --- a/fudge/reactionData/doubleDifferentialCrossSection/chargedParticleElastic/CoulombPlusNuclearElastic.py +++ b/fudge/reactionData/doubleDifferentialCrossSection/chargedParticleElastic/CoulombPlusNuclearElastic.py @@ -118,14 +118,14 @@ def spin( self ) : @property def etaCoefficient( self ) : - """This function returns the parameter :math:`\eta \, \sqrt{E} = Z_1 \, Z_2 \, sqrt{\alpha^2 \mu m_1 / 2}`.""" + """This function returns the parameter :math:`\\eta \\, \\sqrt{E} = Z_1 \\, Z_2 \\, sqrt{\\alpha^2 \\mu m_1 / 2}`.""" self.initialize( ) return( self.__etaCoefficient ) @property def kCoefficient( self ) : - """This function returns the coefficient for the particle wave number (i.e., :math:`k(E) / \sqrt{E}`).""" + """This function returns the coefficient for the particle wave number (i.e., :math:`k(E) / \\sqrt{E}`).""" self.initialize( ) return( self.__kCoefficient ) @@ -220,15 +220,15 @@ def initialize( self ): def dSigma_dMu(self, energy, muCutoff, accuracy=1e-3, epsilon=1e-6, excludeRutherfordScattering=False, probability=False): """ - This function returns :math:`d\sigma / d\mu` at the specified incident energy if *probability* is False and :math:`P(\mu)` otherwise - if True.. The :math:`\mu` domain goes from muMin to *muCutoff*. For identical particles, muMin is set to -*muCutoff* otherwise it is -1. + This function returns :math:`d\\sigma / d\\mu` at the specified incident energy if *probability* is False and :math:`P(\mu)` otherwise + if True.. The :math:`\\mu` domain goes from muMin to *muCutoff*. For identical particles, muMin is set to -*muCutoff* otherwise it is -1. :param energy: Energy of the projectile. - :param muCutoff: The maximum (and maybe minimum) value of :math:`\mu` for the returned function. + :param muCutoff: The maximum (and maybe minimum) value of :math:`\\mu` for the returned function. :param accuracy: The accuracy of the returned function. :param epsilon: This variable is not used. :param excludeRutherfordScattering: If True, Rutherford scattering is not added to the returned function, otherwise it is. - :param probability: If True :math:`P(\mu)` is returned otherwise :math:`d\sigma / d\mu` is returned. + :param probability: If True :math:`P(\\mu)` is returned otherwise :math:`d\\sigma / d\\mu` is returned. :return: An instance of :py:class:`angularModule.XYs1d`. """ @@ -290,7 +290,7 @@ def calculateAverageProductData( self, style, indent = '', **kwargs ) : def processCoulombPlusNuclearMuCutoff( self, style, energyMin = None, accuracy = 1e-3, epsilon = 1e-6, excludeRutherfordScattering = False ) : """ - This function returns the cross section and angular distribution for :math:`\mu` from muMin to muMax. + This function returns the cross section and angular distribution for :math:`\\mu` from muMin to muMax. For identical particles, muMin is set to -muMax otherwise it is -1. The value of muMax is the *muCufoff* member of *style*. diff --git a/fudge/reactionData/doubleDifferentialCrossSection/chargedParticleElastic/RutherfordScattering.py b/fudge/reactionData/doubleDifferentialCrossSection/chargedParticleElastic/RutherfordScattering.py index 1e1f7f97..1cdc918b 100644 --- a/fudge/reactionData/doubleDifferentialCrossSection/chargedParticleElastic/RutherfordScattering.py +++ b/fudge/reactionData/doubleDifferentialCrossSection/chargedParticleElastic/RutherfordScattering.py @@ -52,7 +52,7 @@ def __init__(self, domainMin=None, domainMax=None, domainUnit=None ): @property def etaCoefficient( self ) : - r"""This method returns the parameter :math:`\eta \, \sqrt{E} = Z_1 \, Z_2 \, sqrt{\alpha^2 \mu m_1 / 2}`.""" + """This method returns the parameter :math:`\\eta \\, \\sqrt{E} = Z_1 \\, Z_2 \\, sqrt{\\alpha^2 \\mu m_1 / 2}`.""" return( self.ancestor.etaCoefficient ) @@ -64,7 +64,7 @@ def spin( self ) : @property def kCoefficient( self ) : - r"""This function returns the coefficient for the particle wave number (i.e., :math:`k(E) / \sqrt{E}`).""" + """This function returns the coefficient for the particle wave number (i.e., :math:`k(E) / \\sqrt{E}`).""" return( self.ancestor.kCoefficient ) @@ -89,11 +89,11 @@ def convertUnits( self, unitMap ): self.domainUnit = newUnit def crossSectionVersusEnergy(self, muMax, accuracy=1e-3, energyMin=None, energyMax=None): - r""" - Returns the partial Rutherford cross section by Integrating :math:`d\sigma / d\mu` from muMin to *muMax*. For identical particles, muMin + """ + Returns the partial Rutherford cross section by Integrating :math:`d\\sigma / d\\mu` from muMin to *muMax*. For identical particles, muMin is set to -*muMax* otherwise it is -1. - :param muMax: The upper limit for the :amth:`\mu` integration. + :param muMax: The upper limit for the :amth:`\\mu` integration. :param accuracy: The lin-lin interpolation accuracy of the returned cross section. :param energyMin: The minimum projectile energy for the returned cross section. :param energyMax: The maximum projectile energy for the returned cross section. @@ -130,10 +130,10 @@ def evaluateAtX(self, energy): def dSigma_dMuVersusEnergy(self, muMax, accuracy=1e-3, energyMin=None, energyMax=None): - r""" - Returns :math:`d\sigma(E) / d\mu`. + """ + Returns :math:`d\\sigma(E) / d\\mu`. - :param muMax: The upper limit for the :amth:`\mu` integration. + :param muMax: The upper limit for the :amth:`\\mu` integration. :param accuracy: The lin-lin interpolation accuracy of the returned cross section. :param energyMin: The minimum projectile energy for the returned cross section. :param energyMax: The maximum projectile energy for the returned cross section. @@ -159,13 +159,13 @@ def dSigma_dMuVersusEnergy(self, muMax, accuracy=1e-3, energyMin=None, energyMax return xys2d def dSigma_dMu(self, energy, accuracy=1e-3, muMax=0.999, probability=False): - r""" - Returns :math:`d\sigma / d\mu` at the specified projdctile energy if *probability* is False, otherwise :math:`P(mu)` is returned.. + """ + Returns :math:`d\\sigma / d\\mu` at the specified projdctile energy if *probability* is False, otherwise :math:`P(mu)` is returned.. :param energy: Energy of the projectile. :param accuracy: The lin-lin interpolation accuracy of the returned data. :param muMax: Slices the upper domain mu to this value. - :param probability: If True :math:`P(mu)` is returned instead of :math:`d\sigma / d\mu`. + :param probability: If True :math:`P(mu)` is returned instead of :math:`d\\sigma / d\\mu`. :return: A :py:class:`angularModule.XYs1d` instance. """ @@ -224,10 +224,10 @@ def energyDomain(self, energyMin=None, energyMax=None): return energyUnit, energyMin, energyMax def evaluate( self, energy, mu, phi = 0.0 ) : - r""" - Returns the :math:`d\sigma / d \Omega(energy,\mu,\phi) for Rutherford scattering. Note, Rutherford + """ + Returns the :math:`d\\sigma / d \\Omega(energy,\\mu,\\phi) for Rutherford scattering. Note, Rutherford scattering is independent of phi but phi is listed as an argument to be consistent with others - :math:`d\sigma / d\Omega` that may depend on phi. + :math:`d\\sigma / d\\Omega` that may depend on phi. :param energy: Projectile energy. :param mu: Scattering angle cosine. diff --git a/fudge/reactionData/doubleDifferentialCrossSection/chargedParticleElastic/misc.py b/fudge/reactionData/doubleDifferentialCrossSection/chargedParticleElastic/misc.py index 9266f7e0..8cdce6ef 100644 --- a/fudge/reactionData/doubleDifferentialCrossSection/chargedParticleElastic/misc.py +++ b/fudge/reactionData/doubleDifferentialCrossSection/chargedParticleElastic/misc.py @@ -149,7 +149,7 @@ def fixMuRange(data, epsilon=1e-6): """ This function ensures that the range of mu in *data* is [-1, 1] by adding 0.0's to the missing ranges. Note, *data* is modified. - :param data: A python list of :math:`P(\mu)`. + :param data: A python list of :math:`P(\\mu)`. :param epsilon: The relative amount to add a point below (above) the first (last) point in addition to the point at -1 (1). """ diff --git a/fudge/reactionData/doubleDifferentialCrossSection/chargedParticleElastic/nuclearAmplitudeExpansion.py b/fudge/reactionData/doubleDifferentialCrossSection/chargedParticleElastic/nuclearAmplitudeExpansion.py index a7983b09..faf4cb55 100644 --- a/fudge/reactionData/doubleDifferentialCrossSection/chargedParticleElastic/nuclearAmplitudeExpansion.py +++ b/fudge/reactionData/doubleDifferentialCrossSection/chargedParticleElastic/nuclearAmplitudeExpansion.py @@ -96,7 +96,7 @@ def __init__( self, nuclearTerm = None, realInterference = None, imaginaryInterf @property def etaCoefficient( self ) : - """This method returns the parameter :math:`\eta \, \sqrt{E} = Z_1 \, Z_2 \, sqrt{\alpha^2 \mu m_1 / 2}`.""" + """This method returns the parameter :math:`\\eta \\, \\sqrt{E} = Z_1 \\, Z_2 \\, sqrt{\\alpha^2 \\mu m_1 / 2}`.""" return( self.ancestor.etaCoefficient ) @@ -207,7 +207,7 @@ def convertUnits( self, unitMap ): def dSigma_dMu(self, energy, accuracy=1e-3, muMax=0.999, probability=False): """ - This function returns :math:`d\sigma / d\mu` at the specified incident energy. + This function returns :math:`d\\sigma / d\\mu` at the specified incident energy. :param energy: Energy of the projectile. :param accuracy: The accuracy of the returned *dSigma_dMu*. @@ -219,7 +219,7 @@ def dSigma_dMu(self, energy, accuracy=1e-3, muMax=0.999, probability=False): class Tester : """ - This class is used to added point to :math:`d\sigma / d\mu` until the desired lin-lin interpolation is met. + This class is used to added point to :math:`d\\sigma / d\\mu` until the desired lin-lin interpolation is met. This class is for internal use. """ @@ -238,7 +238,7 @@ def __init__( self, evaluate, energy, relativeTolerance, absoluteTolerance ) : def evaluateAtX( self, mu ) : """ - This function returns *self* evaluated at a projectile energy and outgoing :math:`\mu`. + This function returns *self* evaluated at a projectile energy and outgoing :math:`\\mu`. :param mu: The mu point to evaluate *self* at. """ diff --git a/fudge/reactionData/doubleDifferentialCrossSection/chargedParticleElastic/nuclearPlusInterference.py b/fudge/reactionData/doubleDifferentialCrossSection/chargedParticleElastic/nuclearPlusInterference.py index ed4c70ec..e779cd2d 100644 --- a/fudge/reactionData/doubleDifferentialCrossSection/chargedParticleElastic/nuclearPlusInterference.py +++ b/fudge/reactionData/doubleDifferentialCrossSection/chargedParticleElastic/nuclearPlusInterference.py @@ -36,7 +36,7 @@ class CrossSection(miscModule.ChargedParticleElasticTerm): """ - This class represents the :math:`\sigma(E)` part of :math:`\sigma(E) \, P(\mu|E)` + This class represents the :math:`\\sigma(E)` part of :math:`\\sigma(E) \\, P(\\mu|E)` """ moniker = 'crossSection' @@ -45,7 +45,7 @@ class CrossSection(miscModule.ChargedParticleElasticTerm): class Distribution( miscModule.ChargedParticleElasticTerm): """ - This class represents the :math:`P(\mu|E)` part of :math:`\sigma(E) \, P(\mu|E)`. + This class represents the :math:`P(\\mu|E)` part of :math:`\\sigma(E) \\, P(\\mu|E)`. """ moniker = 'distribution' @@ -56,8 +56,8 @@ class Distribution( miscModule.ChargedParticleElasticTerm): class NuclearPlusInterference( ancestryModule.AncestryIO ): """ This class represents the nuclear + interference term of the elastic scattering of two nuclei and - stores the double differential cross section as the product :math:`\sigma(E) \, P(\mu|E)`. - In :math:`P(\mu|E)` the :math:`\mu` ranges from muMin to muCutoff where muCutoff is a member of this + stores the double differential cross section as the product :math:`\\sigma(E) \\, P(\\mu|E)`. + In :math:`P(\\mu|E)` the :math:`\\mu` ranges from muMin to muCutoff where muCutoff is a member of this class and muMin is -muCutoff for identical particles and -1 otherwise. The following table list the primary members of this class: @@ -65,7 +65,7 @@ class and muMin is -muCutoff for identical particles and -1 otherwise. +-------------------+-------------------------------------------------------------------------------+ | Member | Description | +===================+===============================================================================+ - | muCutoff | The maximum :math:`\mu` value the data represent. | + | muCutoff | The maximum :math:`\\mu` value the data represent. | +-------------------+-------------------------------------------------------------------------------+ | crossSection | The cross section part of the nuclear + interference term. | +-------------------+-------------------------------------------------------------------------------+ @@ -77,7 +77,7 @@ class and muMin is -muCutoff for identical particles and -1 otherwise. def __init__( self, muCutoff, crossSection = None, distribution = None ): """ - :param muCutoff: The maximum :math:`\mu` value the data represent. + :param muCutoff: The maximum :math:`\\mu` value the data represent. :param crossSection: The cross section part of the nuclear + interference term. :param distribution: The distribution part of the nuclear + interference term. """ @@ -175,7 +175,7 @@ def convertUnits( self, unitMap ): def dSigma_dMu(self, energy, accuracy=1e-3, muMax=None, probability=False): """ - Returns :math:`d\sigma / d\mu` at the specified projdctile energy. + Returns :math:`d\\sigma / d\\mu` at the specified projdctile energy. :param energy: Energy of the projectile. :param accuracy: This argument is not used. @@ -207,10 +207,10 @@ def dSigma_dMu(self, energy, accuracy=1e-3, muMax=None, probability=False): return _dSigma_dMu def evaluate( self, E, mu, phi = 0.0 ) : - r""" - Returns the :math:`d\sigma / d \Omega(energy,\mu,\phi) for Rutherford scattering. Note, Rutherford + """ + Returns the :math:`d\\sigma / d \\Omega(energy,\\mu,\\phi) for Rutherford scattering. Note, Rutherford scattering is independent of phi but phi is listed as an argument to be consistent with others - :math:`d\sigma / d\Omega` that may depend on phi. + :math:`d\\sigma / d\\Omega` that may depend on phi. :param energy: Projectile energy. :param mu: Scattering angle cosine. From 9cca874992c37b351c447a72666a8a9039f8eb96 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 8 Jan 2025 12:52:00 -0500 Subject: [PATCH 04/14] np.mat obsolute, use np.asmatrix --- fudge/covariances/mixed.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fudge/covariances/mixed.py b/fudge/covariances/mixed.py index 1de2fef5..9a07017c 100644 --- a/fudge/covariances/mixed.py +++ b/fudge/covariances/mixed.py @@ -221,11 +221,11 @@ def add_values(v1,v2): commonColAxis.values.values = add_values(commonColAxis.values, cc.matrix.axes[1].values) # Now sum up the components - commonMatrix = numpy.mat( firstCovMtx.group( ( commonRowAxis.values.values, commonColAxis.values.values ), + commonMatrix = numpy.asmatrix( firstCovMtx.group( ( commonRowAxis.values.values, commonColAxis.values.values ), ( commonRowAxis.unit, commonColAxis.unit ) ).matrix.array.constructArray() ) for c in summands[1:]: cc = make_common_type(c) - commonMatrix += numpy.mat( cc.group( ( commonRowAxis.values.values, commonColAxis.values.values ), + commonMatrix += numpy.asmatrix( cc.group( ( commonRowAxis.values.values, commonColAxis.values.values ), ( commonRowAxis.unit, commonColAxis.unit ) ).matrix.array.constructArray() ) # Now create the instance of the resulting CovarianceMatrix From c0729eca02f6a9d69c6541e360340c29737e528e Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 8 Jan 2025 13:16:57 -0500 Subject: [PATCH 05/14] port to newer x4i version --- brownies/BNL/plot_evaluation/__init__.py | 40 +++++++++--------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/brownies/BNL/plot_evaluation/__init__.py b/brownies/BNL/plot_evaluation/__init__.py index 875b8d0c..9c806f57 100644 --- a/brownies/BNL/plot_evaluation/__init__.py +++ b/brownies/BNL/plot_evaluation/__init__.py @@ -303,19 +303,13 @@ def generatePlot(observable, dataSets, xyData=None, xydyData=None, xdxydyData=No def getEXFORSets(sym, A, metastable, reaction=None, quantity="SIG", nox4evals=True, nox4legend=False, forceLegend=False, plotSyle=None, verbose=True): - exforData = [] +exforData = [] try: from x4i import exfor_manager, exfor_entry except ImportError: print('WARNING: x4i not successfully imported (check your PYTHONPATH?), so EXFOR data not plotted') return exforData - def barnsConverter(x): - if x == 'barns': - return 'b' - else: - return x - db = exfor_manager.X4DBManagerPlainFS() i = 0 M = "" @@ -357,30 +351,24 @@ def barnsConverter(x): legend = ds[d].legend() if verbose: print(' ', d, legend) - dat = [] - unc = [] - for line in ds[d].data: - if len(line) != 4: - continue - if line[0] is None or line[1] is None: - continue - dx = 0.0 - dy = 0.0 - if line[2] is not None: - dx = line[2] - if line[3] is not None: - dy = line[3] - dat.append([line[0], line[1]]) - unc.append([dx, dy]) - if None in unc[-1]: - unc[-1][unc[-1].index(None)] = 0.0 - if len(dat) > 0: + if 'Energy' in ds[d].data and 'Data' in ds[d].data: + dat = ds[d].data[['Energy', 'Data']].pint.dequantify().values.tolist() + try: + unc = ds[d].data[['d(Energy)', 'd(Data)']].pint.dequantify().values.tolist() + except KeyError as err: # There was a problem getting uncertainties, so skip it + unc = None + xUnit = str(ds[d].data['Energy'].pint.units) + yUnit = str(ds[d].data['Data'].pint.units) + if yUnit == 'b/sr': + yUnit='b' # newish strange choice in EXFOR management if e.startswith('V') or not suppressEXFORLegend: theLegend = legend + ' (' + str(d[0]) + '.' + str(d[1][-3:]) + ')' else: theLegend = '_noLegend_' exforData.append( - DataSet2d(data=dat, uncertainty=unc, xUnit=ds[d].units[0], yUnit=barnsConverter(ds[d].units[1]), + DataSet2d(data=dat, uncertainty=unc, + xUnit=xUnit, + yUnit=yUnit, legend=theLegend, lineStyle=' ', symbol=plotstyles.getPlotSymbol(i), color=plotstyles.getPlotColor(theLegend, False))) i += 1 From f52122aae8cde56ca2a71398c0b69341c83cc6de Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 8 Jan 2025 13:19:42 -0500 Subject: [PATCH 06/14] oops, indentation error --- brownies/BNL/plot_evaluation/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brownies/BNL/plot_evaluation/__init__.py b/brownies/BNL/plot_evaluation/__init__.py index 9c806f57..0d63cd30 100644 --- a/brownies/BNL/plot_evaluation/__init__.py +++ b/brownies/BNL/plot_evaluation/__init__.py @@ -303,7 +303,7 @@ def generatePlot(observable, dataSets, xyData=None, xydyData=None, xdxydyData=No def getEXFORSets(sym, A, metastable, reaction=None, quantity="SIG", nox4evals=True, nox4legend=False, forceLegend=False, plotSyle=None, verbose=True): -exforData = [] + exforData = [] try: from x4i import exfor_manager, exfor_entry except ImportError: From 0c0caa746c629639d746b8794f6c443aa97b359b Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 8 Jan 2025 13:33:08 -0500 Subject: [PATCH 07/14] clip overly large uncertainties --- fudge/vis/matplotlib/plot2d.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fudge/vis/matplotlib/plot2d.py b/fudge/vis/matplotlib/plot2d.py index f66dd5da..129aa609 100644 --- a/fudge/vis/matplotlib/plot2d.py +++ b/fudge/vis/matplotlib/plot2d.py @@ -664,7 +664,7 @@ def __makePlot2d(datasets, xAxisSettings=None, yAxisSettings=None, theTitle=None else: thePlot.set_xscale('linear') if yAxisSettings.isLog: - thePlot.set_yscale('log') + thePlot.set_yscale('log', nonposy="clip") else: thePlot.set_yscale('linear') if xAxisSettings.autoscale: From 6f7a06dc01f6ed7ae88658ad91f79a4112a60c29 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 8 Jan 2025 13:53:01 -0500 Subject: [PATCH 08/14] bad switch --- fudge/vis/matplotlib/plot2d.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fudge/vis/matplotlib/plot2d.py b/fudge/vis/matplotlib/plot2d.py index 129aa609..f66dd5da 100644 --- a/fudge/vis/matplotlib/plot2d.py +++ b/fudge/vis/matplotlib/plot2d.py @@ -664,7 +664,7 @@ def __makePlot2d(datasets, xAxisSettings=None, yAxisSettings=None, theTitle=None else: thePlot.set_xscale('linear') if yAxisSettings.isLog: - thePlot.set_yscale('log', nonposy="clip") + thePlot.set_yscale('log') else: thePlot.set_yscale('linear') if xAxisSettings.autoscale: From b14887cba5891dd88f94bb198483c9fe1e578bee Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 8 Jan 2025 16:15:21 -0500 Subject: [PATCH 09/14] deal with TypeError caused by change to how range() works --- brownies/BNL/plot_evaluation/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/brownies/BNL/plot_evaluation/__init__.py b/brownies/BNL/plot_evaluation/__init__.py index 0d63cd30..27521341 100644 --- a/brownies/BNL/plot_evaluation/__init__.py +++ b/brownies/BNL/plot_evaluation/__init__.py @@ -1286,8 +1286,8 @@ def makeAngDistMubarPlot(gndsMap={}, xyData={}, xydyData={}, xdxydyData={}, xdxydyData=xdxydyData, plotStyle=plotStyle, suggestTitle=getSuggestTitle(target, projectile, reactionName, mt), - suggestXLog=(mt in [1, 2, 18, 102] + range(501, 574)), - suggestYLog=(mt in [1, 2, 18, 102] + range(501, 574)), + suggestXLog=(mt in [1, 2, 18, 102] + list(range(501, 574))), + suggestYLog=(mt in [1, 2, 18, 102] + list(range(501, 574))), suggestFrame=suggestFrame, figsize=figsize, useBokeh=useBokeh) From aeb281723b98f1c44bdbff956a6c8643d88196cc Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 8 Jan 2025 16:16:30 -0500 Subject: [PATCH 10/14] typo --- brownies/BNL/restools/resonance_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brownies/BNL/restools/resonance_generator.py b/brownies/BNL/restools/resonance_generator.py index a20adffa..438086b3 100644 --- a/brownies/BNL/restools/resonance_generator.py +++ b/brownies/BNL/restools/resonance_generator.py @@ -32,7 +32,7 @@ def getFakeResonanceSet( :param L: orbital angular momentum :param J: total angular momentum :param levelDensity: dictionary containing L/J-specific energy-dependent level densities - :param aveWidthFuncs': dictionary containing L/J-specific energy-dependent widths + :param aveWidthFuncs: dictionary containing L/J-specific energy-dependent widths :param DOFs: Chi-square degrees of freedom for each reaction channel, used for drawing resonance widths. :param widthKeys: column headers for resulting Table :param domainMin: lower bound for generating resonances, usually equal to lower bound for level densities / widths From 068e2ba67b5dfa0b94032e2af365bfa0fd442a91 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 8 Jan 2025 16:17:08 -0500 Subject: [PATCH 11/14] numpy.mat() -> numpy.asmatrix() --- brownies/bin/xs_pdf.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/brownies/bin/xs_pdf.py b/brownies/bin/xs_pdf.py index bbc56b01..086a06ce 100755 --- a/brownies/bin/xs_pdf.py +++ b/brownies/bin/xs_pdf.py @@ -422,15 +422,15 @@ def fit_series(xdata, ydata, yerr, seriesInstance, priorModel=None, priorCov=Non kernel[ix, ic] = seriesInstance.evaluateBasisFunction(x, ic) try: fit, cov, resid, chi2 = fudge.core.math.linearAlgebra.cglsqrSolve( - data=numpy.matlib.mat(ydata), - dataUnc=numpy.matlib.mat(yerr), + data=numpy.asmatrix(ydata), + dataUnc=numpy.asmatrix(yerr), kernel=kernel, prior=priorModel, priorCov=priorCov) except numpy.linalg.linalg.LinAlgError as theError: print('kernel', kernel) - print('data', numpy.matlib.mat(ydata)) - print('unc', numpy.matlib.mat(yerr)) + print('data', numpy.asmatrix(ydata)) + print('unc', numpy.asmatrix(yerr)) raise theError results = {'fit': fit, 'cov': cov, 'residual': resid, 'chi2': chi2} return results From 154f35b31035692606a8d1aa46335d0d5e6eef69 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 8 Jan 2025 16:18:25 -0500 Subject: [PATCH 12/14] numpy.mat() -> numpy.asmatrix() --- fudge/reactionData/crossSection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fudge/reactionData/crossSection.py b/fudge/reactionData/crossSection.py index 24416389..239bc902 100644 --- a/fudge/reactionData/crossSection.py +++ b/fudge/reactionData/crossSection.py @@ -1309,7 +1309,7 @@ def integrateTwoFunctionsWithUncertainty(self, f2, domainMin=None, domainMax=Non # Compute the uncertainty itself import numpy - phi = numpy.mat( phi ) + phi = numpy.asmatrix( phi ) theArray = theCovariance.matrix.array.constructArray() try: coco = (phi * theArray * phi.T)[0,0] From 985784c526d9a8b5219e2b20aa21234f5d4c1d55 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 8 Jan 2025 16:19:14 -0500 Subject: [PATCH 13/14] change to legend handler --- xData/interactivePlot/multiplot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xData/interactivePlot/multiplot.py b/xData/interactivePlot/multiplot.py index 0844a8ca..dc3fabe6 100644 --- a/xData/interactivePlot/multiplot.py +++ b/xData/interactivePlot/multiplot.py @@ -822,7 +822,7 @@ def __init__(self, plotObject): for i in range(len(self.axisHandle.lines)): irow = i + 1 # row variables - legendLabel = self.axisHandle.legend_.legendHandles[i].get_label() + legendLabel = self.axisHandle.legend_.legend_handles[i].get_label() rowName = '%3.3d%s' % (i, legendLabel) # checkbox: toggle plot selection From 9cd89ee31bc3293322f3f4745d5f200a77dc6c9f Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 8 Jan 2025 16:20:03 -0500 Subject: [PATCH 14/14] numpy.mat() -> numpy.asmatrix() --- fudge/core/math/linearAlgebra.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fudge/core/math/linearAlgebra.py b/fudge/core/math/linearAlgebra.py index 983a5a71..94443522 100644 --- a/fudge/core/math/linearAlgebra.py +++ b/fudge/core/math/linearAlgebra.py @@ -1078,7 +1078,7 @@ def get_test_matrix(endfFile=None, MT=None, MF=None): idata += 1 if i != j: aTestMatrix[j].append(aTestMatrix[i][j]) - return numpy.mat(aTestMatrix) + return numpy.asmatrix(aTestMatrix) def get_covariances_from_endf(endfFile, MT, MF=33):