Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1ee8e3899b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # Run script (which has opentrons script hardcoded) using JSON file | ||
| log = subprocess.run( | ||
| ["opentrons_simulate", str(tmp_script), str(tmp_json)], | ||
| capture_output=True, | ||
| cwd=tmpdir, |
There was a problem hiding this comment.
Keep simulator cwd where relative inputs exist
Running opentrons_simulate with cwd=tmpdir means the protocol executes in a directory that does not contain the files/ subfolder, but the protocol script still hardcodes open("files/assemblyplan_output.json", ...) and writes output into files (see files/run_sbol2assembly_libre.py:305–311). Because only assemblyplan_output.json is copied to the tmpdir root, this change causes a FileNotFoundError (or later failure when writing the XLSX) for the standard workflow where the script expects the repo’s files/ directory. Unless you also recreate files/ inside the tempdir or adjust the protocol to use the passed JSON path, the simulator will now fail before producing a zip.
Useful? React with 👍 / 👎.
Motivation
osimport.Description
run_opentrons_script_with_json_to_zipcopy the script and JSON into the temporary directory and callsubprocess.runwith the temp paths andcwd=tmpdirusing[ "opentrons_simulate", str(tmp_script), str(tmp_json) ], so the simulator runs inside the temp folder.tmpdir / "build_log.txt"usingPathAPIs instead ofos.path.import osfromsrc/buildcompiler/robotutils.py.Testing
python -m pytest, which exercised the test suite but completed with failures unrelated to this change: 4 failing tests and 3 errors caused by external network/proxy errors whensbol2attempted validation against remote endpoints (e.g.validator.sbolstandard.org).ruff check ., which reported many pre-existing lint issues across notebooks and other files; the change removed a single unused import but the overall lint run did not pass.Codex Task