Skip to content

SOF-7915: implement primitive cell in the python interface#274

Open
pranabdas wants to merge 20 commits into
mainfrom
feat/SOF-7915
Open

SOF-7915: implement primitive cell in the python interface#274
pranabdas wants to merge 20 commits into
mainfrom
feat/SOF-7915

Conversation

@pranabdas

@pranabdas pranabdas commented May 28, 2026

Copy link
Copy Markdown
Member
  • Implement src/py/mat3ra/made/cell/primitive_cell.py similar to JS interface
  • Moved src/py/mat3ra/made/cell.pysrc/py/mat3ra/made/cell/__init__.py

Routines for calculating primitive cell vectors from conventional cell Bravais parameters.
Python equivalent of src/js/cell/primitive_cell.ts.

Following Setyawan, W., & Curtarolo, S. (2010). doi:10.1016/j.commatsci.2010.05.010

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This convention is different from Quantum ESPRESSO logic, however they are identical from the symmetry perspective, just the cell vectors' directions are different.

]


PRIMITIVE_CELLS = {

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.

Let's add a test

needs: run-py-linter
runs-on: ubuntu-24.04
strategy:
fail-fast: false

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.

@VsevolodX - Do you know why https://github.com/Exabyte-io/made/actions/runs/26576640996/job/78304796772 had failed? Looks like a small discrepancy in comparing numbers. How can we avoid this in the future?

@pranabdas pranabdas Jun 2, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's certainly a flaky condition

Screenshot 2026-06-02 at 20 54 15

These are the tests:

Screenshot 2026-06-02 at 20 57 45

Comment thread tests/py/unit/test_primitive_cell.py Outdated
from tests.py.unit.utils import assert_two_entities_deep_almost_equal


class TestPrimitiveCell:

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.

We can just have these at the top level, like other tests

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.

2 participants