Skip to content
Merged
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
14 changes: 7 additions & 7 deletions APSIM.POStats.Shared/Comparison/ApsimFileComparison.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ private List<TableComparison> GetTables()
var acceptedTable = Accepted?.Tables.Find(t => t.Name == currentTable.Name);
tables.Add(new TableComparison(currentTable, acceptedTable));
}
}

// Add in tables that are in the accepted file but not in the current file.
if (Accepted != null)
{
var tablesNotInCurrent = Accepted.Tables.Except(tables.Select(t => t.Accepted));
foreach (var acceptedTable in tablesNotInCurrent)
tables.Add(new TableComparison(null, acceptedTable));
}
// Add in tables that are in the accepted file but not in the current file.
if (Accepted != null && Accepted.Tables != null)
{
var tablesNotInCurrent = Accepted.Tables.Except(tables.Select(t => t.Accepted));
foreach (var acceptedTable in tablesNotInCurrent)
tables.Add(new TableComparison(null, acceptedTable));
}

return tables.OrderBy(t => t.Name).ToList();
Expand Down
16 changes: 8 additions & 8 deletions APSIM.POStats.Shared/Comparison/TableComparison.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ private List<VariableComparison> GetVariables()
matchingAcceptedVariables.Add(acceptedVariable);
variables.Add(new VariableComparison(currentVariable, acceptedVariable));
}

// Add in variables that are in the accepted table but not in the current table.
if (Accepted != null)
{
var variablesNotInCurrent = Accepted.Variables.Except(matchingAcceptedVariables);
foreach (var acceptedTable in variablesNotInCurrent)
variables.Add(new VariableComparison(null, acceptedTable));
}
}
// Add in variables that are in the accepted table but not in the current table.
if (Accepted != null && Accepted.Variables != null)
{
var variablesNotInCurrent = Accepted.Variables.Except(matchingAcceptedVariables);
foreach (var acceptedTable in variablesNotInCurrent)
variables.Add(new VariableComparison(null, acceptedTable));
}

return variables.OrderBy(v => v.Name).ToList();
}
}
Expand Down
Loading