Skip to content
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

Simplify get_elements #860

Merged
merged 3 commits into from
Nov 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions pyiron_atomistics/table/funct.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,9 @@ def get_volume_per_atom(job):


def get_elements(job):
species = job["input/structure/species"]
indices_lst = job["input/structure/indices"]
indices_set = set(indices_lst)
count_lst = [indices_lst.tolist().count(ind) for ind in indices_set]
main_element = species[count_lst.index(np.max(count_lst))]
return {species[ind]: count_lst[ind] for ind in indices_set}
species = job['input/structure/species']
indices = job['input/structure/indices']
return {s: sum(indices==i) for i, s in enumerate(species)}


def get_convergence_check(job):
Expand Down