From 3509ccb3581e917b34a7190ef3a439c94f0cec05 Mon Sep 17 00:00:00 2001 From: jmc Date: Wed, 13 Sep 2023 16:35:29 +0100 Subject: [PATCH] yarn fix --- src/lib/case-studies/eshoppen-model.ts | 23 +++++++++++++---------- src/lib/sci-m/index.ts | 9 ++++++--- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/lib/case-studies/eshoppen-model.ts b/src/lib/case-studies/eshoppen-model.ts index 9f2bac835..83727561a 100644 --- a/src/lib/case-studies/eshoppen-model.ts +++ b/src/lib/case-studies/eshoppen-model.ts @@ -1,5 +1,5 @@ -import { IImpactModelInterface } from '../interfaces'; -import { KeyValuePair } from '../../types/boavizta'; +import {IImpactModelInterface} from '../interfaces'; +import {KeyValuePair} from '../../types/boavizta'; export class EshoppenModel implements IImpactModelInterface { authParams: object | undefined = undefined; @@ -21,11 +21,12 @@ export class EshoppenModel implements IImpactModelInterface { switch (this.modelType) { case 'e-cpu': { // e-cpu = n-hours * n-chips * tdp * tdp-coeff - observation['e-cpu'] = ( - observation['n-hours'] * - observation['n-chips'] * - observation['tdp'] * - observation['tdp-coeff']) / 1000; + observation['e-cpu'] = + (observation['n-hours'] * + observation['n-chips'] * + observation['tdp'] * + observation['tdp-coeff']) / + 1000; if (isNaN(observation['e-cpu'])) { throw new Error('e-cpu not computable'); } @@ -37,7 +38,8 @@ export class EshoppenModel implements IImpactModelInterface { (observation['n-hours'] * observation['n-chips'] * observation['tdp-mem'] * - observation['tdp-coeff']) / 1000; + observation['tdp-coeff']) / + 1000; if (isNaN(observation['e-mem'])) { throw new Error('e-mem not computable'); } @@ -47,7 +49,8 @@ export class EshoppenModel implements IImpactModelInterface { // e-net = data-in + data-out * net-energy observation['e-net'] = ((observation['data-in'] + observation['data-out']) * - observation['net-energy']) / 1000; + observation['net-energy']) / + 1000; if (isNaN(observation['e-net'])) { throw new Error('e-net not computable'); } @@ -56,7 +59,7 @@ export class EshoppenModel implements IImpactModelInterface { case 'e-sum': { // e-sum = e-cpu + e-mem + e-net observation['energy'] = - (observation['e-cpu'] + observation['e-mem'] + observation['e-net']); + observation['e-cpu'] + observation['e-mem'] + observation['e-net']; if (isNaN(observation['energy'])) { throw new Error('energy not computable'); } diff --git a/src/lib/sci-m/index.ts b/src/lib/sci-m/index.ts index 3e430faa4..1a1ff881b 100644 --- a/src/lib/sci-m/index.ts +++ b/src/lib/sci-m/index.ts @@ -51,9 +51,12 @@ export class SciMModel implements IImpactModelInterface { ) { observation['te'] = observation['te'] ?? observation['total-embodied']; observation['tir'] = observation['tir'] ?? observation['time-reserved']; - observation['el'] = observation['el'] ?? observation['expected-lifespan']; - observation['rr'] = observation['rr'] ?? observation['resources-reserved']; - observation['tor'] = observation['tor'] ?? observation['total-resources']; + observation['el'] = + observation['el'] ?? observation['expected-lifespan']; + observation['rr'] = + observation['rr'] ?? observation['resources-reserved']; + observation['tor'] = + observation['tor'] ?? observation['total-resources']; if (typeof observation['te'] === 'string') { te = parseFloat(observation[observation['te']]); } else if (typeof observation['te'] === 'number') {