-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(shared-data): Enumerate standard labware by globbing instead of hard-coding #17631
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## edge #17631 +/- ##
==========================================
- Coverage 25.68% 25.67% -0.02%
==========================================
Files 2851 2851
Lines 219457 219305 -152
Branches 17971 18021 +50
==========================================
- Hits 56363 56300 -63
+ Misses 163079 162990 -89
Partials 15 15
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…st of each. Despite the `latestDefs` variable name.
This reverts commit 6de44a8.
ca41bac
to
fa853dd
Compare
// todo(mm, 2025-03-04): This duplicates getLabwareDefUri() in ./helpers. We should use | ||
// that instead, but using it gives me obscure "TypeError: getLabwareDefURI is not a function" | ||
// errors in certain test files. Some kind of circular dependency problem? Some kind of | ||
// mocking problem? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like you were trying to import from the private export. since you are outside of the helpers module, i think you want to import from the public export. i just pushed up a small commit to do that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for doing this! this is way better.
uh nevermind let me see what's going on |
you are correct, there are indeed a few circular dependencies. we should really move all of these helpers into their own files, in the meantime duplicating is fine |
This reverts commit 99f6772.
Overview
We have some functions that return all the Opentrons standard labware definitions in shared-data. These functions were implemented basically by hard-coding a great many
import .../foo.json
statements and returning those objects. This was obviously tedious and type-unsafe, and it would get worse with the introduction of labware schema 3.This PR replaces that with some glob imports, a Vite-specific feature.
This goes towards EXEC-1278.
Changelog
There are 3 functions exported from this file:
getAllLabwareDefs()
opentrons_flex_96_tiprack_20ul
andopentrons_flex_96_filtertiprack_20ul
definitions, which were previously excluded. To compensate, these have been added toLABWAREV2_DO_NOT_LIST
andPD_DO_NOT_LIST
.opentrons_flex_tiprack_lid
. This should never have been returned in the first place because this definition is aLabwareDefinition3
, whereas the function says it returns onlyLabwareDefinition2
s. This function should returnLabwareDefinition3
s too, but that will require updates to calling code and is beyond the scope of this PR. See EXEC-1278.getAllDefinitions()
opentrons_flex_96_tiprack_2ul
andopentrons_flex_96_filtertiprack_20ul
.opentrons_flex_tiprack_lid
.opentrons/axygen_1_reservoir_90ml/1
, instead of internal TypeScript identifiers likeaxygen1Reservoir90MlV1
.getAllLegacyDefinitions()
Review requests
opentrons_flex_96_tiprack_20ul
andopentrons_flex_96_filtertiprack_20ul
now?opentrons_flex_tiprack_lid
now?Test Plan and Hands on Testing
opentrons_flex_96_tiprack_20ul
andopentrons_flex_96_filtertiprack_20ul
remain excluded from:Risk assessment
Medium.