Skip to content

Commit 77ee3da

Browse files
authored
Merge pull request #8 from brown170/post-6.7.1-fixes
Post 6.7.1 fixes
2 parents 0dae179 + 4753e80 commit 77ee3da

124 files changed

Lines changed: 4845 additions & 3295 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/makefile.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
os: [ubuntu-latest, macos-latest, windows-latest]
16-
python-version: ["3.8", "3.12", "3.x"]
16+
python-version: ["3.8", "3.12", "3.13"]
1717

1818
steps:
1919
- uses: actions/checkout@v4
@@ -22,7 +22,7 @@ jobs:
2222
run: python -m pip install --upgrade pip setuptools wheel numpy h5py matplotlib
2323

2424
- name: Build
25-
run: make PYTHON=python
25+
run: make PYTHON=python CC=gcc
2626

2727
- name: Run check
2828
run: |

.github/workflows/python-app.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
matrix:
1111
os: [ubuntu-latest, macos-latest, windows-latest]
12-
python-version: ["3.8", "3.12", "3.x"]
12+
python-version: ["3.8", "3.12", "3.13"]
1313

1414
steps:
1515
- name: Set up Python ${{ matrix.python-version }}
@@ -24,5 +24,10 @@ jobs:
2424
run: python -m pip install --upgrade pip setuptools wheel numpy h5py
2525

2626
- name: Install FUDGE
27-
run: python -m pip install git+https://github.com/LLNL/fudge.git@ci_dev
27+
run: |
28+
if [ "$RUNNER_OS" == "Windows" ]; then
29+
export CC=gcc
30+
fi
31+
python -m pip install git+https://github.com/LLNL/fudge.git
32+
shell: bash
2833

Merced/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# SPDX-License-Identifier: BSD-3-Clause
66
# <<END-copyright>>
77

8-
subDirs = Doc Src TestSuite bin
8+
subDirs = Doc MonteCarlo Src TestSuite bin
99

1010
.PHONY: default bin clean realclean check doc doSubDirs prefixDeploy
1111

README.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,26 @@ Optional packages matplotlib and PyQT5 are also recommended to support plotting.
4444

4545
- Install FUDGE:
4646

47-
pip install git+https://github.com/LLNL/fudge.git@6.7.1
47+
# Install latest available version:
48+
pip install git+https://github.com/LLNL/fudge.git
49+
50+
Or,
51+
52+
# Install a tagged release:
53+
pip install git+https://github.com/LLNL/fudge.git@fudge6.8.0
4854

4955

5056
- Installation by cloning the git repository and building with the unix `make` command:
5157
This is the typical mode for active FUDGE maintenance and development.
5258
The following steps are recommended:
5359

54-
- Ensure that NumPy (version 1.15 or later) is installed
60+
- Ensure that NumPy (version 1.15 or greater) is installed
5561

5662
- Clone FUDGE in the current directory:
5763

58-
```
5964
git clone https://github.com/LLNL/fudge.git
60-
# or using SSH (requires creating a github account and registering an ssh key):
61-
git clone git@github.com:LLNL/fudge.git
62-
```
65+
# or using SSH (requires creating a github account and registering an ssh key):
66+
git clone git@github.com:LLNL/fudge.git
6367

6468
- Build FUDGE:
6569

@@ -82,6 +86,18 @@ Optional packages matplotlib and PyQT5 are also recommended to support plotting.
8286
- on Windows, the environment variable should be added to the registry (see for
8387
example <http://www.support.tabs3.com/main/R10463.htm>)
8488

89+
### Notes for Windows users:
90+
91+
FUDGE installations are now regularly tested on Github CI using Windows with the MinGW environment.
92+
Compiling C extensions on Windows may require an extra step: if command 'cc.exe' is not available,
93+
locate a C compiler and set environment variable CC to that compiler. For example,
94+
```
95+
set CC=gcc
96+
pip install git+https://github.com/LLNL/fudge.git
97+
```
98+
99+
Please let us know if you run into trouble installing or using FUDGE on Windows!
100+
85101
### Differences between FUDGE installed via `pip install` vs. via `make`:
86102

87103
When FUDGE is installed via `pip install`, several executable scripts are installed into

bin/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ merced:
1414
mv ../Merced/bin/merced .
1515

1616
upscatter:
17-
cd ../fudge/processing/deterministic/upscatter; $(MAKE) CC=gcc
17+
cd ../fudge/processing/deterministic/upscatter; $(MAKE)
1818
mv ../fudge/processing/deterministic/upscatter/bin/calcUpscatterKernel .
1919

2020
check:

bin/buildMapFile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def sortFiles(files):
201201
try :
202202
name, data = GNDS_fileModule.type(file)
203203
except :
204-
if args.verbose > 2: print(' WARNING: Invalid file "%s".' % file)
204+
print(' WARNING: Invalid file "%s".' % file)
205205
continue
206206
if( name == reactionSuiteModule.ReactionSuite.moniker ) :
207207
if data['interaction'] is None:

bin/crossSections.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from fudge.reactionData import crossSection as crossSectionModule
2323
from fudge.reactionData.doubleDifferentialCrossSection.photonScattering import coherent as coherentModule
2424
from fudge.reactionData.doubleDifferentialCrossSection.photonScattering import incoherent as incoherentModule
25+
from fudge.reactionData.doubleDifferentialCrossSection.photonScattering import incoherentDoppler as incoherentDopplerModule
2526

2627
summaryDocString__FUDGE = '''Outputs the evaluated cross section for each reaction and total for a GNDS reactionSuite. The processed data are written to files if the "-o" and "--processed" options are used.'''
2728

@@ -171,7 +172,7 @@ def outputLabel(crossSection, MT, reactionStr, reactionIndex):
171172

172173
crossSections = []
173174
if args.verbose > 0: print(protare.sourcePath)
174-
total = crossSectionModule.XYs1d(axes=protare.reactions[0].crossSection[-1].axes)
175+
total = crossSectionModule.XYs1d(axes=crossSectionModule.defaultAxes(energyUnit=protare.domainUnit))
175176
for reactionCounter, reaction in enumerate(protare.reactions):
176177
if args.verbose > 1: print(' %s' % reaction)
177178
crossSection = reaction.crossSection.toPointwise_withLinearXYs(lowerEps=1e-6, upperEps=1e-6)
@@ -192,7 +193,8 @@ def outputLabel(crossSection, MT, reactionStr, reactionIndex):
192193
reactionCounterOffset = reactionCounter + 1
193194

194195
if len(protare.sums.crossSectionSums) > 0:
195-
outputLog.write('\nData in crossSectionSums:\n')
196+
if outputDir is not None:
197+
outputLog.write('\nData in crossSectionSums:\n')
196198

197199
for reactionCounter2, reaction in enumerate(protare.sums.crossSectionSums):
198200
reactionCounter = reactionCounterOffset + reactionCounter2
@@ -224,6 +226,10 @@ def outputLabel(crossSection, MT, reactionStr, reactionIndex):
224226
prefix = 'incoherentScatteringFactor'
225227
formClass = incoherentModule.Form
226228
dataName = 'scatteringFactor'
229+
elif reaction.ENDF_MT >= 1534 and reaction.ENDF_MT <= 1572:
230+
prefix = 'incoherentDoppler'
231+
formClass = incoherentDopplerModule.Form
232+
dataName = 'ComptonProfile'
227233
else:
228234
continue
229235
for form in reaction.doubleDifferentialCrossSection:

bin/cullProcessedData.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@
1515

1616
summaryDocString__FUDGE = """This script removed all processed data (except resonance reconstructed data) for the specified GNDS protare file."""
1717

18-
description = summaryDocString__FUDGE
18+
description = summaryDocString__FUDGE + """ If option "--outputDir" is present, the directory is striped from the output path and replaced
19+
with the specified path."""
1920

2021
parser = argparse.ArgumentParser(description=description, allow_abbrev=False)
2122
singleProtareArguments = argumentsForScriptsModule.SingleProtareArguments(parser)
22-
parser.add_argument('output', nargs='?', default=None, help='Output file name.')
23+
parser.add_argument('outputPath', default=None, type=pathlib.Path, help='Output file name.')
24+
parser.add_argument('--outputDir', action='store', default=None, type=pathlib.Path, help='The output directory to write the output file to.')
2325

2426
args = parser.parse_args()
2527

2628
protare = singleProtareArguments.protare(args)
29+
protare.cullProcessedData()
2730

28-
stylesToRemove = []
29-
preProcessingStyles = protare.styles.preProcessingStyles()
30-
for style in protare.styles :
31-
if not isinstance(style, preProcessingStyles):
32-
stylesToRemove.append(style.label)
33-
protare.removeStyles(stylesToRemove)
31+
outputPath = args.outputPath
32+
if outputPath is None:
33+
outputPath = pathlib.Path(protare.sourcePath).with_suffix('.culled.xml')
34+
if args.outputDir is not None:
35+
outputPath = args.outputDir / outputPath.name
3436

35-
output = args.output
36-
if output is None: output = pathlib.Path(protare.sourcePath).with_suffix('.culled.xml')
37-
protare.saveToFile(output)
37+
protare.saveToFile(outputPath)

bin/energyBalance.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ def output(reactionOutputDir, fileName, curve, crossSection=None):
131131
priorEnergy = energy
132132
if priorEnergy is not None: # Add a point at the last zero cross section point.
133133
curve.setValue(priorEnergy, curve.evaluate(priorEnergy))
134+
elif fileName == 'Q.dat':
135+
curve = curve * crossSection.domainSlice(domainMin=curve.domainMin)
134136

135137
weighted = []
136138
for index, (xValue, yValue) in enumerate(curve):
@@ -216,14 +218,17 @@ def process(reaction, isReaction):
216218
crossSection = reaction.crossSection.toPointwise_withLinearXYs(lowerEps=1e-6)
217219
output(reactionOutputDir, 'crossSection.dat', crossSection)
218220

221+
outputChannel = reaction.outputChannel
219222
if isReaction:
223+
Q = outputChannel.Q[0].toPointwise_withLinearXYs(accuracy=1e-5, lowerEps=1e-6)
224+
output(reactionOutputDir, 'Q.dat', Q, crossSection)
220225
availableEnergy = reaction.availableEnergy[apdLabel]
221226
output(reactionOutputDir, 'availableEnergy.dat', availableEnergy, crossSection)
222227

223-
checkTwoBody(reactionOutputDir, crossSection, reaction.outputChannel)
228+
checkTwoBody(reactionOutputDir, crossSection, outputChannel)
224229

225230
productSums = {}
226-
outputProductData(reactionOutputDir, crossSection, reaction.outputChannel, productSums, 0)
231+
outputProductData(reactionOutputDir, crossSection, outputChannel, productSums, 0)
227232

228233
totalProductEnergy = XYs1dModule.XYs1d(axes=averageProductEnergyAxes)
229234
for pid in productSums:

bin/peek.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from fudge import outputChannel as outputChannelModule
1919
from fudge import product as productModule
2020
from fudge import sums as sumsModule
21+
from fudge import institution as institutionModule
2122
from fudge.reactionData import crossSection as crossSectionModule
2223
from fudge.productData import multiplicity as multiplicityModule
2324
from fudge.productData.distributions import unspecified as unspecifiedModule
@@ -45,6 +46,7 @@
4546
parser.add_argument('--doNotShowProducts', action='store_true', help='If present, no product data are displayed.')
4647
parser.add_argument('--skipProductions', action='store_true', help='If present, skips the "productions" node.')
4748
parser.add_argument('--skipIncompleteReactions', action='store_true', help='If present, skips the "incompleteReactions" node.')
49+
parser.add_argument('--skipPhotoAtomicIncoherentDoppler', action='store_true', help='If present, skips the photo-atomic incoherent Doppler reactions.')
4850
parser.add_argument('--products', action='append', default=[], help='Only show reactions with these products in their list. If empty, all reactions are shown.')
4951
parser.add_argument('--MT', action='append', type=int, default=[], help='Only show reactions with these MTs. If empty, all reactions are shown.')
5052
parser.add_argument('--crossSectionSums', action='store_true', help='If present, also show crossSectionSum information.')
@@ -176,8 +178,8 @@ def reactionPeek(self, prefix, index, indent, reactionIndex):
176178
QStr = 'Q_threshold = %11s' % self.outputChannel.Q[0].evaluate(self.domainMin)
177179
except:
178180
QStr = '"Q_threshold issue, please report to FUDGE developers"'
179-
print('%s%-36s (%4d): %s domainMin = %11s domainMax = %10s %s%s' %
180-
(indent, prefix % str(self), index, QStr, self.domainMin, self.domainMax, self.domainUnit, crossSectionStr))
181+
print('%s%-36s (%4d): %s domainMin = %11.6g domainMax = %10.6g %s MT = %s%s' %
182+
(indent, prefix % str(self), index, QStr, self.domainMin, self.domainMax, self.domainUnit, self.ENDF_MT, crossSectionStr))
181183
productPath = [str(index)]
182184
if not args.doNotShowProducts:
183185
self.outputChannel.__peek(indent + indentIncrement, [str(reactionIndex)])
@@ -202,12 +204,14 @@ def crossSectionSum(self, index, indent):
202204
print('%s%-32s (%4d): domainMin = %s, domainMax = %s %s%s' % (indent, str(self), index, crossSection.domainMin,
203205
crossSection.domainMax, crossSection.domainUnit, crossSectionStr))
204206

205-
def showChildren(node, skip):
207+
def showChildren(node, skip, label=None):
206208

207209
if skip:
208210
return
209211
if len(node) > 0:
210-
print('%s%s:' % (indent, node.moniker))
212+
if label is None:
213+
label = node.moniker
214+
print('%s%s:' % (indent, label))
211215
for reactionIndex, reaction in enumerate(node):
212216
reaction.__peek('%s', reactionIndex, 2 * indentIncrement, reactionIndex)
213217

@@ -236,3 +240,10 @@ def showChildren(node, skip):
236240
print('%sCross section sums:' % indent)
237241
for crossSectionSumIndex, crossSectionSum in enumerate(protare.sums.crossSectionSums):
238242
crossSectionSum.__peek(crossSectionSumIndex, 2 * indentIncrement)
243+
244+
try:
245+
photoAtomicIncoherentDoppler = protare.applicationData[institutionModule.photoAtomicIncoherentDoppler]
246+
showChildren(photoAtomicIncoherentDoppler.data[0], args.skipPhotoAtomicIncoherentDoppler,
247+
label='Photo-atomic incoherent doppler reactions')
248+
except:
249+
pass

0 commit comments

Comments
 (0)