From 6a68709bf92ae72a821024c8d8baa5950bfc6f52 Mon Sep 17 00:00:00 2001 From: abestroka Date: Wed, 20 Dec 2023 12:05:14 -0600 Subject: [PATCH] fixes protocol_out path issue --- ot2_driver/protopiler/protopiler.py | 10 ++++++---- requirements.txt | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ot2_driver/protopiler/protopiler.py b/ot2_driver/protopiler/protopiler.py index 478c57f..0037507 100644 --- a/ot2_driver/protopiler/protopiler.py +++ b/ot2_driver/protopiler/protopiler.py @@ -377,7 +377,7 @@ def yaml_to_protocol( self, config_path: Optional[PathLike] = None, payload: Optional[Dict] = None, - protocol_out: PathLike = Path( + protocol_out_path: PathLike = Path( f"./protocol_{datetime.now().strftime('%Y%m%d-%H%M%S')}.py" ), resource_file: Optional[PathLike] = None, @@ -411,6 +411,7 @@ def yaml_to_protocol( returns the path to the protocol.py file as well as the resource file (if it does not exist, None) """ + self.protocol_out_path = str(protocol_out_path) if not self.config: self.load_config(config_path) @@ -424,7 +425,7 @@ def yaml_to_protocol( else: protocol_out = Path( self.protocol_out_path - + f"./protocol_{datetime.now().strftime('%Y%m%d-%H%M%S')}.py" + + f"/protocol_{datetime.now().strftime('%Y%m%d-%H%M%S')}.py" ) protocol = [] @@ -613,7 +614,6 @@ def _create_commands(self, payload: Optional[Dict]) -> List[str]: f"No pipette available for {block_name} with volume: {volume}" ) # check for tip - print(pipette_mount) if not tip_loaded[pipette_mount]: load_command = pick_tip_template.replace( "#pipette#", f'pipettes["{pipette_mount}"]' @@ -1493,13 +1493,15 @@ def main(args): # noqa: D103 protopiler.yaml_to_protocol( config_path=args.config, - protocol_out=args.protocol_out, + protocol_out_path=args.protocol_out, resource_file=args.resource_in, resource_file_out=args.resource_out, reset_when_done=True, ) + + if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument( diff --git a/requirements.txt b/requirements.txt index 8c4bb47..57a6e0f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,3 +7,4 @@ cryptography==36.0.2 requests pandas fastapi==0.103.2 +openpyxl==3.1.2