Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to ray2 and some other libraries. #1981

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dependencies.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ Note all install methods after "main" take
<h5py/>
<numpy>1.18</numpy>
<scipy>1.5</scipy>
<scikit-learn>0.24</scikit-learn>
<scikit-learn>1.0</scikit-learn>
<pandas>1.1</pandas>
<xarray>0.16</xarray>
<netcdf4>1.5</netcdf4>
<matplotlib>3.2</matplotlib>
<statsmodels>0.12</statsmodels>
<statsmodels>0.13</statsmodels>
<cloudpickle>1.6</cloudpickle>
<tensorflow os='windows,linux'>2.3</tensorflow>
<tensorflow os='mac'>2.7</tensorflow>
Expand All @@ -60,7 +60,7 @@ Note all install methods after "main" take
<nomkl os='linux' skip_check='True'/>
<numexpr os='linux'/>
<cmake skip_check='True' optional='True'/>
<ray source="pip" pip_extra="[default]">1.12</ray>
<ray source="pip" pip_extra="[default]">2.0</ray>
<!-- redis is needed by ray, but on windows, this seems to need to be explicitly stated -->
<redis source="pip" os='windows'/>
<imageio>2.9</imageio>
Expand Down
8 changes: 4 additions & 4 deletions ravenframework/CodeInterfaceClasses/PHISICS/MaterialParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ def dictFormatingFromXmlToPerturbed(self):
matList = []
isotopeList = []
XMLdict['density'] = {}
for matXML in self.root.getiterator('mat'):
for isotopeXML in self.root.getiterator('isotope'):
for matXML in self.root.iter('mat'):
for isotopeXML in self.root.iter('isotope'):
matList.append(matXML.attrib.get('id'))
isotopeList.append(self.noDash(isotopeXML.attrib.get('id')))
matList = self.unifyElements(matList)
Expand All @@ -96,7 +96,7 @@ def dictFormatingFromXmlToPerturbed(self):
XMLdict['density'][mat] = {}
for isotope in isotopeList:
XMLdict['density'][mat][isotope] = {}
for matXML in self.root.getiterator('mat'):
for matXML in self.root.iter('mat'):
for isotopeXML in matXML.findall('isotope'):
XMLdict['density'][matXML.attrib.get('id')][self.noDash(isotopeXML.attrib.get('id'))] = isotopeXML.attrib.get('density')
return XMLdict
Expand Down Expand Up @@ -148,7 +148,7 @@ def printInput(self,workingDir):
newXMLDict = self.replaceValues(genericXMLdict)
templatedNewXMLdict = self.fileReconstruction(newXMLDict)
open(self.inputFiles, 'w')
for matXML in self.root.getiterator('mat'):
for matXML in self.root.iter('mat'):
for isotopeXML in matXML.findall('isotope'):
isotopeXML.attrib['density'] = templatedNewXMLdict.get('DENSITY').get(matXML.attrib.get('id').upper()).get(self.noDash(isotopeXML.attrib.get('id')).upper())
self.tree.write(self.inputFiles)
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def outputFileNames(self, pathFile):
'flux', 'repository'
]
for xmlNodeNumber in range(0, len(xmlNodes)):
for xmlNode in pathRoot.getiterator(xmlNodes[xmlNodeNumber]):
for xmlNode in pathRoot.iter(xmlNodes[xmlNodeNumber]):
self.outputFileNameDict[xmlNodes[xmlNodeNumber]] = xmlNode.text

def syncLibPathFileWithRavenInp(self, pathFile, currentInputFiles,
Expand All @@ -85,7 +85,7 @@ def syncLibPathFileWithRavenInp(self, pathFile, currentInputFiles,
]

for typeNumber in range(len(typeList)):
for libPathText in pathRoot.getiterator(libPathList[typeNumber]):
for libPathText in pathRoot.iter(libPathList[typeNumber]):
libPathText.text = os.path.join(
currentInputFiles[keyWordDict[typeList[typeNumber].lower()]]
.subDirectory, currentInputFiles[keyWordDict[typeList[typeNumber]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def depTime(self,inputXML,searchDict,dictKeys):
libraryTree = ET.parse(inputXML)
libraryRoot = libraryTree.getroot()
for key in searchDict:
for child in libraryRoot.getiterator(searchDict[key]):
for child in libraryRoot.iter(searchDict[key]):
timeDict[dictKeys[key]] = child.text
return timeDict

Expand Down
4 changes: 2 additions & 2 deletions ravenframework/CodeInterfaceClasses/PHISICS/XSCreator.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ def tabMapping(self,tab,tabMapFileName):
"""
mappingTree = ET.parse(tabMapFileName)
mappingRoot = mappingTree.getroot()
for tabulationXML in mappingRoot.getiterator('tabulation'):
for tabulationXML in mappingRoot.iter('tabulation'):
if tab == tabulationXML.attrib.get('set'):
tabList = []
valueList = []
for tabXML in tabulationXML.getiterator('tab'):
for tabXML in tabulationXML.iter('tab'):
tabList.append(tabXML.attrib.get('name'))
valueList.append(tabXML.text)
return tabList, valueList
Expand Down
6 changes: 3 additions & 3 deletions ravenframework/CodeInterfaceClasses/PHISICS/phisicsdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,11 @@ def getAbsoluteXS(self, xsOutput):
valueList = []
tree = ET.parse(os.path.join(self.workingDir, xsOutput))
root = tree.getroot()
for materialXML in root.getiterator('library'):
for isotopeXML in materialXML.getiterator('isotope'):
for materialXML in root.iter('library'):
for isotopeXML in materialXML.iter('isotope'):
reactionList = [j.tag for j in isotopeXML]
for react in reactionList:
for groupXML in isotopeXML.getiterator(react):
for groupXML in isotopeXML.iter(react):
individualGroup = [
x.strip() for x in groupXML.attrib.get('g').split(',')
]
Expand Down
3 changes: 2 additions & 1 deletion ravenframework/utils/Debugging.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"""
import sys
from numbers import Number
from collections import Set, Mapping, deque
from collections import deque
from collections.abc import Set, Mapping
import numpy as np

# these types have no depth, so should not be searched for subitems
Expand Down
Loading