Skip to content
Open
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
2 changes: 1 addition & 1 deletion packages/catalog-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
"dependencies": {
"@toolpath/part-contracts": "workspace:*",
"@toolpath/tool-scraper": "3.0.1",
"@toolpath/tool-scraper": "3.0.2",
"@toolpath/tool-support": "0.4.0"
},
"devDependencies": {
Expand Down
29 changes: 29 additions & 0 deletions packages/catalog-data/scripts/profiles.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import { existsSync, readFileSync, readdirSync, writeFileSync, mkdirSync } from 'node:fs'
import { resolve } from 'node:path'

import { ScraperConfigError } from '@toolpath/tool-scraper'
import { describeApi } from '@toolpath/tool-scraper/node'

import { ingestProfiles } from '../dist/index.js'
Expand Down Expand Up @@ -103,11 +104,27 @@ const stepFor = async (record) => {

const OPTIONS = { tolerance: 0.05, fillBays: false, flipped: false }

/**
* PSC is ISO 26623's polygonal coupling, not a 7:24 cone or an HSK interface.
* The scraper deliberately refuses to validate its measured interface against
* either of those two families. Keep that exclusion explicit: it is a partial
* profiles document, not a reason to discard every profile that did validate.
*
* Other configuration, vendor, API, or model failures remain fatal below.
*/
const UNSUPPORTED_PROFILE_TAPERS = new Set(['PSC50', 'PSC63'])

const isUnsupportedProfileInterface = (error) =>
error instanceof ScraperConfigError &&
UNSUPPORTED_PROFILE_TAPERS.has(error.subject) &&
error.message.includes('is not a taper designation this package can read a size out of')

let kernelVersion = ''
let measuredCount = 0
let skippedCount = 0
let alreadyMeasured = 0
const failed = []
const unsupported = []

for (const name of families) {
// Resumable, like `scrape.mjs` and `scrape-holding.mjs`: a family already
Expand Down Expand Up @@ -155,6 +172,11 @@ for (const name of families) {
})
} catch (error) {
const why = error instanceof Error ? error.message : String(error)
if (isUnsupportedProfileInterface(error)) {
unsupported.push(`${name}: ${why}`)
console.log(` UNSUPPORTED: ${why}`)
continue
}
failed.push(`${name}: ${why}`)
console.log(` FAILED: ${why}`)
continue
Expand Down Expand Up @@ -188,6 +210,13 @@ console.log(
`${merged.complete} agreeing with the vendor's published gauge length -> ${merged.path}`,
)

if (unsupported.length > 0) {
console.log(`\n${unsupported.length} family/families have an unsupported profile interface:`)
for (const note of unsupported) {
console.log(` ${note}`)
}
}

if (failed.length > 0) {
console.log(`\n${failed.length} family/families failed:`)
for (const note of failed) {
Expand Down
18 changes: 12 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.