Skip to content

Conversation

@pranabdas
Copy link
Member

No description provided.

@pranabdas pranabdas marked this pull request as ready for review March 5, 2025 01:18
src/utils.js Outdated
}

// Function to sort array based on the order given in a separate array
export function sortArrayByOrder(arr, order) {
Copy link
Member

Choose a reason for hiding this comment

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

This should be in @mat3ra/utils array.ts - there might be already a function for it

},
dependencies: {
atomicSpecies: {
oneOf: this.uniqueElementsWithLabels.map((elementWithLabel) => {
Copy link
Member

Choose a reason for hiding this comment

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

We should make the code reusable here to avoid repeating below

When handling elementWithLabel we can have a helper function to getLabel or getElementSymbol to make it easier to understand or we can have a class for it.

this.uniqueElements = this.material?.Basis?.uniqueElements || [];
// orbitals are sorted according to stability (Madelung's rule)
this.orbitalList = [
"1s",
Copy link
Member

Choose a reason for hiding this comment

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

this.orbitalListByStability

}

getValenceOrbitals = (element) => {
const pseudos = this.methodData?.pseudo || [];
Copy link
Member

Choose a reason for hiding this comment

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

We should hide the pseudo and try to get atomicOrbitals directly from methodDataItem

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

.pseudo should not be needed, we should have methodDataItems inside methodData directly

};
}

getValenceOrbitalsByElement = (element) => {
Copy link
Member

Choose a reason for hiding this comment

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

This and the below can go to the pseudopotential method in Mode as well

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