@otto-code/brain 0.8.6 → 0.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/profiles.js +26 -10
- package/dist/models/enrich.js +6 -1
- package/package.json +1 -1
package/dist/config/profiles.js
CHANGED
|
@@ -95,21 +95,37 @@ export function getCalibration(store, model, profile) {
|
|
|
95
95
|
export function putCalibration(store, model, profile, measurement) {
|
|
96
96
|
if (!store.calibrations)
|
|
97
97
|
store.calibrations = {};
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
const calibrations = store.calibrations;
|
|
99
|
+
if (!Object.hasOwn(calibrations, model.id)) {
|
|
100
|
+
Object.defineProperty(calibrations, model.id, {
|
|
101
|
+
configurable: true,
|
|
102
|
+
enumerable: true,
|
|
103
|
+
value: {},
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
Object.defineProperty(calibrations[model.id], calibrationKey(profile), {
|
|
107
|
+
configurable: true,
|
|
108
|
+
enumerable: true,
|
|
109
|
+
value: measurement,
|
|
110
|
+
writable: true,
|
|
111
|
+
});
|
|
101
112
|
const key = geometryKey(model, profile);
|
|
102
113
|
const layers = model?.metadata?.blockCount;
|
|
103
114
|
if (key && layers) {
|
|
104
115
|
if (!store.geometryCalibrations)
|
|
105
116
|
store.geometryCalibrations = {};
|
|
106
|
-
store.geometryCalibrations
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
117
|
+
Object.defineProperty(store.geometryCalibrations, key, {
|
|
118
|
+
configurable: true,
|
|
119
|
+
enumerable: true,
|
|
120
|
+
value: {
|
|
121
|
+
kvBytesPerTokenPerLayer: measurement.kvBytesPerToken / layers,
|
|
122
|
+
baseOverheadBytes: measurement.baseOverheadBytes,
|
|
123
|
+
measuredAt: measurement.measuredAt,
|
|
124
|
+
measuredOn: model.displayName,
|
|
125
|
+
measuredLayers: layers,
|
|
126
|
+
},
|
|
127
|
+
writable: true,
|
|
128
|
+
});
|
|
113
129
|
}
|
|
114
130
|
return store;
|
|
115
131
|
}
|
package/dist/models/enrich.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/** Normalize a repo/id path: forward slashes, lowercased, trailing slashes trimmed. */
|
|
2
2
|
function normalizePath(value) {
|
|
3
|
-
|
|
3
|
+
const normalized = value.replaceAll("\\", "/");
|
|
4
|
+
let end = normalized.length;
|
|
5
|
+
while (end > 0 && normalized.charCodeAt(end - 1) === 47) {
|
|
6
|
+
end -= 1;
|
|
7
|
+
}
|
|
8
|
+
return normalized.slice(0, end).toLowerCase();
|
|
4
9
|
}
|
|
5
10
|
/** The final path segment (file name) of a scanned model's id. */
|
|
6
11
|
function basenameOf(id) {
|
package/package.json
CHANGED