Skip to content

Commit

Permalink
Remove padding in merges.
Browse files Browse the repository at this point in the history
  • Loading branch information
czwa committed Apr 18, 2024
1 parent 8d2e78b commit 8761466
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions python/lsst/cp/verify/mergeResults.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,28 +293,6 @@ def mergeTable(inputResults, newStats=None):
if inputResults is None:
return Table()

testTable = inputResults[0] # This has the default set of columns.
defaults = {key: -1 for key in testTable.columns}

# Identify vector columns:
for column in defaults.keys():
if len(testTable[column].shape) > 1:
defaults[column] = max(defaults[column],
*[table[column].shape[1] for table in inputResults])

# Pad vectors shorter than this:
for column, length in defaults.items():
if length > -1: # is a vector
for table in inputResults:
tableLength = table[column].shape[1]
if tableLength < length: # this table is short
newColumn = []
for row in table[column]:
newColumn.append(np.pad(row,
(0, length-tableLength),
constant_values=np.nan))
table[column] = Column(newColumn, name=column, unit=table[column].unit)

if len(inputResults) > 0:
outputResults = vstack(inputResults)
else:
Expand Down

0 comments on commit 8761466

Please sign in to comment.