Skip to content
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

fixes protocol_out path issue #40

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading