Skip to content

Do not add auxiliary cell to uploaded/generated gas phase structures #592

Merged
danielhollas merged 7 commits into
aiidalab:masterfrom
danielhollas:remove-auxiliary-cell
Jun 3, 2026
Merged

Do not add auxiliary cell to uploaded/generated gas phase structures #592
danielhollas merged 7 commits into
aiidalab:masterfrom
danielhollas:remove-auxiliary-cell

Conversation

@danielhollas

@danielhollas danielhollas commented Apr 29, 2024

Copy link
Copy Markdown
Contributor

StructureUpload and SmilesWidget currently automatically add a 10 Angstrom auxiliary cells to gas phase molecules. That's needed for plane wave codes, but is confusing and distracting for Quantum Chemistry codes such as ORCA.

This PR introduces a new parameter (add_auxiliary_cell) to these widgets to control this behaviour. The default is kept True for backwards compatibility (even though as a chemist (not material scientist) I am not happy about it :-D )

@codecov

codecov Bot commented Apr 29, 2024

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.09%. Comparing base (d284e29) to head (a7baa44).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #592      +/-   ##
==========================================
+ Coverage   85.06%   85.09%   +0.02%     
==========================================
  Files          18       18              
  Lines        3388     3394       +6     
==========================================
+ Hits         2882     2888       +6     
  Misses        506      506              
Flag Coverage Δ
python-3.12 85.06% <100.00%> (+0.02%) ⬆️
python-3.9 85.07% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@danielhollas danielhollas added this to the v0.2.3 milestone May 28, 2024
@danielhollas danielhollas force-pushed the remove-auxiliary-cell branch from f70accc to bf63f0d Compare June 23, 2024 16:11
@danielhollas danielhollas modified the milestones: v2.3.0, v2.4.0 Feb 6, 2025
@danielhollas danielhollas force-pushed the remove-auxiliary-cell branch from bf63f0d to bb775ff Compare May 22, 2026 11:25
@danielhollas danielhollas requested a review from cpignedoli June 2, 2026 08:44
@danielhollas danielhollas changed the title Do not add auxiliary cell to uploaded/generated structures Do not add auxiliary cell to uploaded/generated gas phase structures Jun 2, 2026
@danielhollas

Copy link
Copy Markdown
Contributor Author

@yakutovicha @cpignedoli can you have a brief look to see if you're okay with this PR? Since it is a (technically) breaking change, I'd like to get this in for v3 of AWB.

I plan to add some unit tests here but would like to get a green light from you first. Thanks!

@cpignedoli

Copy link
Copy Markdown
Member

Hi @danielhollas, I tested it, and it works. I don't have an issue with the principle, but if we leave it as is, it will create problems for all users currently using the QE app and the Empa apps for molecules.

I would suggest triggering a warning for systems without a cell, and possibly adding a button to automatically create a cell using the logic that was enforced before.

What do you think?

@danielhollas danielhollas force-pushed the remove-auxiliary-cell branch from bb775ff to 862a4a0 Compare June 2, 2026 13:28
@danielhollas

Copy link
Copy Markdown
Contributor Author

@cpignedoli thanks. In that case, I think a better approach is to introduce an extra parameter in the widget initialized (e.g. add_auxiliary_cell) and let the application choose which behaviour it desires. For me personally, it would make sense to have this off by default, but as you said that would mean that EMPA apps and QeApps would have to be modified so I am also fine to keep the current behaviour as default and modify AtmoSpec instead.

Would that work? (please see the updated code).

@danielhollas danielhollas force-pushed the remove-auxiliary-cell branch from 129d05a to 8163c8b Compare June 2, 2026 13:48
…eUploadWidget

If False, no auxiliary cell is added to gas phase molecules.
True by default for backwards compatibility reasons.
@danielhollas danielhollas force-pushed the remove-auxiliary-cell branch from 8163c8b to 55f2296 Compare June 2, 2026 14:00
@danielhollas danielhollas force-pushed the remove-auxiliary-cell branch from 49bd872 to 9b391b3 Compare June 2, 2026 16:59
@danielhollas danielhollas marked this pull request as ready for review June 2, 2026 17:06
title="",
description="Upload Structure",
allow_trajectories=False,
add_auxiliary_cell=True,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about the parameter name, suggestions welcome, especially shorter ones :-)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me, the name is good. It does the job.

@danielhollas

Copy link
Copy Markdown
Contributor Author

I added unit tests and updated the PR description so this is ready for review.

@yakutovicha yakutovicha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good, I've also tested it on the new image with the migrated surfaces app, and it works without issues!

image

@danielhollas

Copy link
Copy Markdown
Contributor Author

Perfect, thanks!

@danielhollas danielhollas merged commit d9455ae into aiidalab:master Jun 3, 2026
9 checks passed
@danielhollas danielhollas deleted the remove-auxiliary-cell branch June 3, 2026 18:13
@danielhollas danielhollas added the enhancement New feature or request label Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants