You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not super familiar with git workflows and pull requests so I have sent this as an issue. Please advise if you think this is something that should be fixed and if you wish me to do a pull request :)
Hi @IsaacGentle thanks for reporting and I could confirm this issue. For a quick guide on making contributions to a project, you could checkout the guide here.
I could confirm you fix indeed work, but things looks more complex that this as some other formulas still don't work (for example Cl[-]).
Also the unit test for this helper method seems missing, so I might take over from here and fix this :) Thanks again for reporting and investigating.
A small tip, to share a code block, you could use the permalink instead of copying the code block.
Another small tip, to show differences in code, you could add diff, which would look like:
- if re.match(r"\[([^\[\]]+)\]|\(aq\)", formula):+ if re.match(r".*\[([^\[\]]+)\]|\(aq\)", formula):
Python version
Python 3.12.3
Pymatgen version
2024.11.13
Operating system version
Windows 10
Current behavior
The following code leads to an error (ValueError: + is an invalid formula!)
Even though the definition of ion_or_solid_comp_object states that the argument string should be formatted as 'Na[+]'
In it's current form, the string needs to be '[+]Na' in order for it to work:
Expected Behavior
If 'Na[+]' is the desired string format, the definition of ion_or_solid_comp_object should be modified
L398 of pourbaix_diagram.py is currently:
https://github.com/materialsproject/pymatgen/blob/da607e86f9ce8aec942067c6c1a4fda6e04915dd/src/pymatgen/analysis/pourbaix_diagram.py#L398C18-L398C19
I suggest replacement with
I am not super familiar with git workflows and pull requests so I have sent this as an issue. Please advise if you think this is something that should be fixed and if you wish me to do a pull request :)
Minimal example
Relevant files to reproduce this bug
No response
The text was updated successfully, but these errors were encountered: