Skip to content

SOF-7010: implement class method to strip label and return atomic symbol #190

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 10 commits into
base: main
Choose a base branch
from

Conversation

pranabdas
Copy link
Member

No description provided.

@pranabdas pranabdas requested a review from Copilot March 28, 2025 12:11
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors variable assignments in the Basis class to use array destructuring for improved clarity and consistency.

  • Replaced individual element extraction with array destructuring in two mapping functions.
  • Removed index usage in the atomicPositions getter function.
Comments suppressed due to low confidence (1)

src/js/basis/basis.ts:465

  • Refactoring in the atomicPositions getter removes usage of this.atomicLabelsArray. If the atomic label is meant to be obtained from this array, reverting this change or adjusting the structure of elementsAndCoordinatesAndLabelsArray may be necessary.
const [element, coordinate, atomicLabel] = entry;

@pranabdas pranabdas changed the title chore: refactor variable assignments SOF-7010: implement class method to strip label and return atomic symbol Mar 31, 2025
* (3) Fe_a, Fe_b, Fe_1, Fe_1a
* As of Mar 2025, only single digit numerical labels are allowed
*/
stripLabelToGetElementSymbol = (elementWithLabel: string): string => {
Copy link
Member

Choose a reason for hiding this comment

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

Could be a static function, I guess

* (3) Fe_a, Fe_b, Fe_1, Fe_1a
* As of Mar 2025, only single digit numerical labels are allowed
*/
static stripLabelToGetElementSymbol = (elementWithLabel: string): string => {
Copy link
Member

Choose a reason for hiding this comment

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

@VsevolodX - where do you think this function should go to? ElementWithLabel helper class? Or maybe tools/basis?

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