Skip to content

Fix has_cobicar when NcICOBILIST is present #4447

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tomdemeyere
Copy link
Contributor

@tomdemeyere tomdemeyere commented Jul 3, 2025

When icobiBetween is activated lobster prints out the NcICOBILIST.lobster file. In the lobster output we find "Writing COBICAR.lobster, ICOBILIST.lobster and NcICOBILIST.lobster..." instead of the regular line. The current parser then returns False even if the COBICAR.lobster is present.

Also, it seems that has_cohpcar and has_coopcar are flipped?

Switching to a regex approach on the whole files (not \n split) would allow much greater flexbility, performance and robustness.

@JaGeo @naik-aakash

  • Google format doc strings added. Check with ruff.
  • Type annotations included. Check with mypy.
  • Tests added for new features/fixes.
  • If applicable, new classes/functions/modules have duecredit @due.dcite decorators to reference relevant papers by DOI (example)

Tip: Install pre-commit hooks to auto-check types and linting before every commit:

pip install -U pre-commit
pre-commit install

@naik-aakash
Copy link
Contributor

Hi @tomdemeyere, thanks for catching this flip in checks for COHP and COOP and fixing the has_cobicar logic when multicenter bonding is enabled.

Regarding the suggestion of switching to regex, I do not have any strong opinion. The only thing I feel is that maintaining it can be harder if one is not very familiar with regex syntax.

@JaGeo
Copy link
Member

JaGeo commented Jul 4, 2025

I think my opinion on regex is similar to @naik-aakash 's. As long as one can still easily maintain it, I am fine with it. We also, of course, have to check with the main maintainers of this repo :)

And thanks for catching the bugs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants