Skip to content

Conversation

@so2koo
Copy link
Contributor

@so2koo so2koo commented Oct 31, 2025

Summary

This includes InterfaceCalc for interface structure/energy calculation (same process with SurfaceCalc).

From two different bulk structures, interface structure is generated by pymatgen CoherentInterfaceBuilder.
For bulk/interface structure relaxation, use RelaxCalc and return interfacial energy to sort out the lowest interface energy.

Todos

If this is work in progress, what else needs to be done?

Checklist

  • 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

@so2koo so2koo changed the title Add Interface Calc Add InterfaceCalc Oct 31, 2025
@codecov
Copy link

codecov bot commented Oct 31, 2025

Codecov Report

❌ Patch coverage is 0% with 79 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.23%. Comparing base (41d5edc) to head (c0da967).

Files with missing lines Patch % Lines
src/matcalc/_interface.py 0.00% 79 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #117      +/-   ##
==========================================
- Coverage   96.32%   90.23%   -6.10%     
==========================================
  Files          22       23       +1     
  Lines        1170     1249      +79     
==========================================
  Hits         1127     1127              
- Misses         43      122      +79     

☔ 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.

@rul048 rul048 self-requested a review November 4, 2025 01:12
@rul048 rul048 changed the title Add InterfaceCalc Add InterfaceCalc Class for Interface Structure and Energy Calculation Nov 4, 2025
@rul048 rul048 changed the title Add InterfaceCalc Class for Interface Structure and Energy Calculation [WIP] Add InterfaceCalc Class for Interface Structure and Energy Calculation Nov 4, 2025
Copy link
Contributor

@rul048 rul048 left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution, Sojung.

  1. Could you please run ruff check .py and ruff format .py to check and clear any style issues, and then use mypy .py to catch potential type inconsistencies? These steps usually take care of the bulk of linting concerns.
  2. It would also be immensely helpful to add unit tests that exercise the new functions to keep the coverage consistent with the rest of the codebase.
  3. Please also add this code from ._interface import InterfaceCalc into _init_.py like what we do for other property calculators. This will make sure the users can directly call InterfaceCalc.
  4. We usually avoid using print statements inside functions. If needed, we use logging or return values instead to maintain clean and reusable code.

No worry, I will help with you on these stuffs.

film_in_interface = (interface.composition[unique_element] / count) * substrate_opt.num_sites
substrate_in_interface = interface.num_sites - film_in_interface
else:
print("No unique elements found in either structure")
Copy link
Contributor

Choose a reason for hiding this comment

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

We usually avoid using print statements inside functions. If needed, we use logging or return values instead to maintain clean and reusable code.

@shyuep
Copy link
Contributor

shyuep commented Dec 8, 2025

@rul048 @so2koo Pls merge this by Wed. Again, we cannot be working at an efficiency that takes weeks/months to merge a single simple feature.

3) Check the final results
"""
interface_calc = InterfaceCalc(
calculator=m3gnet_calculator,
Copy link
Contributor

Choose a reason for hiding this comment

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

We will replace m3gnet_calculator with matpes_calculator for all tests.

@rul048
Copy link
Contributor

rul048 commented Dec 9, 2025

All lints and tests for InterfaceCalc have passed.

@rul048 rul048 changed the title [WIP] Add InterfaceCalc Class for Interface Structure and Energy Calculation Add InterfaceCalc Class for Interface Structure and Energy Calculation Dec 9, 2025
@shyuep shyuep merged commit bd6d488 into materialyzeai:main Dec 9, 2025
2 of 3 checks passed
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