Skip to content

Commit

Permalink
fixes protocol_out path issue
Browse files Browse the repository at this point in the history
  • Loading branch information
abestroka committed Dec 20, 2023
1 parent 893f1e3 commit 6a68709
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ot2_driver/protopiler/protopiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)

Expand All @@ -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 = []
Expand Down Expand Up @@ -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}"]'
Expand Down Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ cryptography==36.0.2
requests
pandas
fastapi==0.103.2
openpyxl==3.1.2

0 comments on commit 6a68709

Please sign in to comment.