-
Notifications
You must be signed in to change notification settings - Fork 179
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
feat(api, robot-server): allow setting CSV param files via protocols & analyses endpoints #15686
feat(api, robot-server): allow setting CSV param files via protocols & analyses endpoints #15686
Conversation
A PR has been opened to address analyses snapshot changes. Please review the changes here: https://github.com/Opentrons/opentrons/pull/ |
file: Optional[FileInfo] = Field( | ||
default=None, | ||
description="ID of the CSV file stored on the robot; to be used for fetching the CSV file." | ||
" For local analysis this will most likely be empty.", |
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.
file: | ||
- id: '{csv_file_id}' | ||
name: '' |
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.
A PR has been opened to address analyses snapshot changes. Please review the changes here: https://github.com/Opentrons/opentrons/pull/ |
from opentrons.protocol_engine.types import ( | ||
RunTimeParameter, | ||
PrimitiveRunTimeParamValuesType, | ||
CsvRunTimeParamFilesType, |
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.
Little nitpick, I think we should always capitalize CSV
if we're doing camelcase, it makes it stand out more.
with self._sql_engine.begin() as transaction: | ||
results = transaction.execute(statement).all() | ||
|
||
csv_rtps: Dict[str, Union[str, None]] = {} |
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.
csv_rtps: Dict[str, Union[str, None]] = {} | |
csv_rtps: Dict[str, Optional[str]] = {} |
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.
Some minor nitpicks with style and the like, but this is looking good!
|
||
with self._sql_engine.begin() as transaction: | ||
transaction.execute(delete_primitive_rtp_statement) | ||
transaction.execute(delete_csv_rtp_statement) | ||
transaction.execute(delete_csv_rtp_statement) |
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.
Line repeated, unless we want to make sure the file is really deleted 😛
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.
😆
|
||
analysis_id: str | ||
parameter_variable_name: str | ||
file_id: Union[str, None] |
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.
file_id: Union[str, None] | |
file_id: Optional[str] |
5282993
to
c7fff38
Compare
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.
Besides one more teensy nitpick this looks great.
|
||
|
||
@dataclass | ||
class CsvParameterResource: |
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.
Sorry to be nitpicky on this but for style consistency lets also have this be CSVParameterResource
cd06d7d
to
a252211
Compare
…ts, wire it up to set the csv file id
a252211
to
c927ebd
Compare
Closes AUTH-416
Overview
This PR adds the capability of setting the CSV run time parameter with a CSV file. Features added:
POST /protocols
andPOST /analyses
now acceptrunTimeParameterFiles
data in addition to the existingrunTimeParameterValues
dataTest Plan
ok
and the run time parameters are present in the full completed analysis/dataFiles
endpoint, get its ID.runTimeParameterFiles
. Test that:ok
and the CSV parameters with file ID are present in the full analysisPOST /protocols/protocolId/analyses
endpointChangelog
API:
file
propertyPythonProtocolRunner
.load & supporting functions to accept CSV file ID overrides and use them to validate and set CSV parameters.Robot-server:
POST /protocols
andPOST /analyses
to acceptrunTimeParameterFiles
in their form-data & request body, respectively.Review requests
Risk assessment
None- low. Adds a new capability to the protocols endpoints and doesn't change existing code much.