Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ 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".
| _COMPONENT_PATTERN = re.compile( | ||
| r"(?P<amount>[-+]?\d+(?:\.\d+)?)\s*(?:%|percent|mole\s*%|mol\s*%)\s*(?:of\s+)?(?P<name>[A-Za-z0-9\-\s]+)", | ||
| flags=re.IGNORECASE, |
There was a problem hiding this comment.
Parse multiple components in natural language scenario prompts
The component matcher uses a greedy name capture ([A-Za-z0-9-\s]+), so the first match absorbs the rest of the prompt and no additional components are detected. For example, plan_scenario("90% methane and 10% ethane at 40 °C") only produces one match and normalizes to 100 % methane, ignoring the ethane specification. This makes the new natural-language setup silently produce the wrong fluid when users separate components with common phrases like “and”, which is a primary use case of the feature.
Useful? React with 👍 / 👎.
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68fc4aff8724832db2c12d97d0f72f4c