Skip to content

Commit

Permalink
Update: TDP finder fixing handling of names
Browse files Browse the repository at this point in the history
Signed-off-by: Gnanakeethan Balasubramaniam <[email protected]>
  • Loading branch information
gnanakeethan committed Sep 25, 2023
1 parent abd9087 commit 59a32f4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/lib/tdp-finder/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ describe('tdp-finder:configure test', () => {
tdp: 6.0,
},
]);
await expect(
model.calculate([
{
'physical-processor': 'Intel Xeon Platinum 8175M',
},
])
).resolves.toStrictEqual([
{
'physical-processor': 'Intel Xeon Platinum 8175M',
tdp: 6.0,
},
]);
await expect(
model.calculate([
{
Expand Down
2 changes: 1 addition & 1 deletion src/lib/tdp-finder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class TdpFinderModel implements IImpactModelInterface {
const result = fs.readFileSync(path.join(__dirname, 'data.csv'), 'utf8');
for (const line of result.split('\n')) {
const [name_w_at, tdp_r] = line.split(',');
const name = name_w_at.split('@')[0];
const name = name_w_at.split('@')[0].trim();
const tdp = parseFloat(tdp_r.replace('\r', ''));
data[name] = tdp;
}
Expand Down

0 comments on commit 59a32f4

Please sign in to comment.