Skip to content

feat(step-generation): create fn to get custom liquid class properties#18558

Merged
jerader merged 5 commits intochore_release-pd-8.5.0from
sg_custom-liquid-class-util
Jun 9, 2025
Merged

feat(step-generation): create fn to get custom liquid class properties#18558
jerader merged 5 commits intochore_release-pd-8.5.0from
sg_custom-liquid-class-util

Conversation

@jerader
Copy link
Copy Markdown
Collaborator

@jerader jerader commented Jun 6, 2025

Overview

to prep for emitting transfer_with_liquid_class and the other liquid class papi commands, this PR creates a helper function to get the custom liquid class properties.

please see Sanniti's PR here to review an example usage. Basically, this fn helps define the custom liquid class object that is used in define_custom_liquid_class()

Test Plan and Hands on Testing

Review the code and the test

Changelog

  • add new fn and a test

Review requests

  • review the test and see if the python generated looks correct
  • thetransferArgs that don't map to anything are blowoutOffsetFromTopMm, dispenseOffsetFromBottomMm, and aspirateOffsetFromBottomMm. I'm pretty sure we can deprecate them but need to confirm.

Risk assessment

low

@jerader jerader requested a review from a team as a code owner June 6, 2025 19:54
@jerader jerader requested review from ddcc4 and ncdiehl11 June 6, 2025 19:55
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.98%. Comparing base (39b5d85) to head (ceab58c).
Report is 12 commits behind head on chore_release-pd-8.5.0.

Additional details and impacted files

Impacted file tree graph

@@                     Coverage Diff                     @@
##           chore_release-pd-8.5.0   #18558       +/-   ##
===========================================================
+ Coverage                   25.98%   56.98%   +31.00%     
===========================================================
  Files                        3258     3274       +16     
  Lines                      280648   281846     +1198     
  Branches                    27621    33747     +6126     
===========================================================
+ Hits                        72923   160620    +87697     
+ Misses                     207698   121032    -86666     
- Partials                       27      194      +167     
Flag Coverage Δ
step-generation 4.39% <100.00%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
step-generation/src/types.ts 100.00% <ø> (ø)
step-generation/src/utils/liquidClassUtils.ts 100.00% <100.00%> (ø)
step-generation/src/utils/pythonFormat.ts 85.00% <100.00%> (+1.98%) ⬆️

... and 1697 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread step-generation/src/types.ts
z_offset?: number
mm_from_edge?: number
speed?: number
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, do these overlap at all with an existing schema? I'd prefer not to write another file with the same fields if we can help it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call, i'll take a look!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect the answer is that there is an existing schema we could use, but we'd have to generate the schema file from either Sanniti's Python TypedDict, or from shared-data/liquid-class/schemas/1.json. (But still, generating the schema programmatically might be more reliable than typing it out by hand.)

Comment thread step-generation/src/utils/liquidClassUtils.ts
Comment thread step-generation/src/__tests__/liquidClassUtils.test.tsx Outdated
@jerader jerader merged commit 5ba6675 into chore_release-pd-8.5.0 Jun 9, 2025
10 checks passed
@jerader jerader deleted the sg_custom-liquid-class-util branch June 9, 2025 15:42
SyntaxColoring pushed a commit that referenced this pull request Jun 10, 2025
#18558)

to prep for emitting `transfer_with_liquid_class` and the other liquid
class papi commands, this PR creates a helper function to get the custom
liquid class properties.
ddcc4 added a commit that referenced this pull request Jun 13, 2025
# Overview

The custom liquid class dict for `define_liquid_class()` is kind of big.
This PR makes the dict formatting a bit more compact: if all the entries
in the dict are scalar, and their total length is short-ish, we will
emit the dict on a single line.

Before:
```
"offset": {
    "x": 1,
    "y": 0,
    "z": 5,
},
```
After:
```
"offset": {"x": 1, "y": 0, "z": 5},
```
(See tests for other examples.)

This PR also cleans up the code for emitting lists of pairs as Python
tuples that was introduced in PR #18558.

## Test Plan and Hands on Testing

Added/updated unit tests.

## Risk assessment

Low.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants