SOF-7010: implement class method to strip label and return atomic symbol#190
Open
SOF-7010: implement class method to strip label and return atomic symbol#190
Conversation
There was a problem hiding this comment.
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;
src/js/basis/basis.ts
Outdated
| * (3) Fe_a, Fe_b, Fe_1, Fe_1a | ||
| * As of Mar 2025, only single digit numerical labels are allowed | ||
| */ | ||
| stripLabelToGetElementSymbol = (elementWithLabel: string): string => { |
Member
There was a problem hiding this comment.
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 => { |
Member
There was a problem hiding this comment.
@VsevolodX - where do you think this function should go to? ElementWithLabel helper class? Or maybe tools/basis?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.