Skip to content

Commit

Permalink
Switching legends to upper right (what best used to mean) (#54)
Browse files Browse the repository at this point in the history
* Switching legends to upper right (what best used to mean)

* Switching to new iter() function from removed getiterator().

* Switching to iter(x) from x.getchildren()

* Sorting set so that it has a consistent order.
  • Loading branch information
joshua-cogliati-inl authored Oct 6, 2022
1 parent 3ec137a commit 3a73200
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/PostProcessors/ETStructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def checkLinkedTree(self, root):
seqID = []

for node in root.findall('define-sequence'):
for child in node.getiterator():
for child in node.iter():
if 'event-tree' in child.tag:
dependencies.append(child.get('name'))
seqID.append(node.get('name'))
Expand Down Expand Up @@ -458,7 +458,7 @@ def constructPointDFS(self, node, inputMap, stateMap, outputMap, X, rowCounter):
## fill in the details under this branch, later iterations will
## correct lower rows if a path does change
X[rowCounter, col] = val
for fork in path.getchildren():
for fork in iter(path):
newCounter = self.constructPointDFS(fork, inputMap, stateMap, outputMap, X, rowCounter)
for i in range(newCounter-rowCounter):
X[rowCounter+i, col] = val
Expand Down
20 changes: 10 additions & 10 deletions tests/CRAFT/test_sept_milestone.xml
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@
<xlabel>time [days]</xlabel>
<ylabel>Failure Probability V1</ylabel>
<legend>
<loc>best</loc>
<loc>upper right</loc>
</legend>
</plotSettings>
<actions>
Expand Down Expand Up @@ -755,7 +755,7 @@
<xlabel>time [days]</xlabel>
<ylabel>cost V1</ylabel>
<legend>
<loc>best</loc>
<loc>upper right</loc>
</legend>
</plotSettings>
<actions>
Expand Down Expand Up @@ -822,7 +822,7 @@
<xlabel>time [days]</xlabel>
<ylabel>Failure Probability V2</ylabel>
<legend>
<loc>best</loc>
<loc>upper right</loc>
</legend>
</plotSettings>
<actions>
Expand Down Expand Up @@ -889,7 +889,7 @@
<xlabel>time [days]</xlabel>
<ylabel>cost V2</ylabel>
<legend>
<loc>best</loc>
<loc>upper right</loc>
</legend>
</plotSettings>
<actions>
Expand Down Expand Up @@ -956,7 +956,7 @@
<xlabel>time [days]</xlabel>
<ylabel>Failure Probability SG</ylabel>
<legend>
<loc>best</loc>
<loc>upper right</loc>
</legend>
</plotSettings>
<actions>
Expand Down Expand Up @@ -1023,7 +1023,7 @@
<xlabel>time [days]</xlabel>
<ylabel>cost SG</ylabel>
<legend>
<loc>best</loc>
<loc>upper right</loc>
</legend>
</plotSettings>
<actions>
Expand Down Expand Up @@ -1090,7 +1090,7 @@
<xlabel>time [days]</xlabel>
<ylabel>Failure Probability P1</ylabel>
<legend>
<loc>best</loc>
<loc>upper right</loc>
</legend>
</plotSettings>
<actions>
Expand Down Expand Up @@ -1157,7 +1157,7 @@
<xlabel>time [days]</xlabel>
<ylabel>cost P1</ylabel>
<legend>
<loc>best</loc>
<loc>upper right</loc>
</legend>
</plotSettings>
<actions>
Expand Down Expand Up @@ -1224,7 +1224,7 @@
<xlabel>time [days]</xlabel>
<ylabel>Failure Probability P1 and P2</ylabel>
<legend>
<loc>best</loc>
<loc>upper right</loc>
</legend>
</plotSettings>
<actions>
Expand Down Expand Up @@ -1291,7 +1291,7 @@
<xlabel>time [days]</xlabel>
<ylabel>cost P1 and P2</ylabel>
<legend>
<loc>best</loc>
<loc>upper right</loc>
</legend>
</plotSettings>
<actions>
Expand Down
4 changes: 2 additions & 2 deletions tests/unitTests/testMCSReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def checkArray(comment,first,second,dtype,tol=1e-10,update=True):
'ACCUMLATOR 2 DISCHARGE CKV 002 FAILS TO OPEN','480 VAC BUS 1A2 FAILS',
'ACCUMLATOR 3 DISCHARGE CKV 003 FAILS TO OPEN','480 VAC BUS 1A3 FAILS',
'ACCUMULATOR CKVS 2 OF 3 FAIL FROM COMMON CAUSE TO OPEN'}
checkArray('check BE list', list(beList), list(desired), dtype=str)
checkArray('check BE list', sorted(beList), sorted(desired), dtype=str)

fileName = 'cutset_saphire.txt'
mcsIDs, probability, mcsList, beList = mcsReader(fileName, type='saphire')
Expand All @@ -126,7 +126,7 @@ def checkArray(comment,first,second,dtype,tol=1e-10,update=True):
for i in range(len(desired)):
checkArray('check MCS list', mcsList[i], desired[i], dtype=str)
desired = {'S-DGN-FR-B','C-PMP-FS-B','S-DGN-FR-A', 'S-TNK-FC-T1', 'C-CKV-CC-B','C-CKV-CF', 'C-PMP-FR-B', 'S-DGN-FS-A'}
checkArray('check BE list', list(beList), list(desired), dtype=str)
checkArray('check BE list', sorted(beList), sorted(desired), dtype=str)
print(results)

sys.exit(results["fail"])
Expand Down

0 comments on commit 3a73200

Please sign in to comment.