-
Notifications
You must be signed in to change notification settings - Fork 31
Add InterfaceCalc Class for Interface Structure and Energy Calculation
#117
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
Conversation
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
InterfaceCalc Class for Interface Structure and Energy Calculation
InterfaceCalc Class for Interface Structure and Energy CalculationInterfaceCalc Class for Interface Structure and Energy Calculation
rul048
left a comment
There was a problem hiding this 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.
- 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.
- 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.
- Please also add this code
from ._interface import InterfaceCalcinto_init_.pylike what we do for other property calculators. This will make sure the users can directly call InterfaceCalc. - We usually avoid using
printstatements 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.
src/matcalc/_interface.py
Outdated
| 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") |
There was a problem hiding this comment.
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.
Signed-off-by: Runze Liu <[email protected]>
Signed-off-by: Runze Liu <[email protected]>
Signed-off-by: Runze Liu <[email protected]>
tests/test_interface.py
Outdated
| 3) Check the final results | ||
| """ | ||
| interface_calc = InterfaceCalc( | ||
| calculator=m3gnet_calculator, |
There was a problem hiding this comment.
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.
Signed-off-by: Runze Liu <[email protected]>
|
All lints and tests for |
InterfaceCalc Class for Interface Structure and Energy CalculationInterfaceCalc Class for Interface Structure and Energy Calculation
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
ruff.mypy.duecredit@due.dcitedecorators to reference relevant papers by DOI (example)Tip: Install
pre-commithooks to auto-check types and linting before every commit: