Skip to content

Commit

Permalink
Merge pull request #238 from GEMDAT-repos/fix_occupancy
Browse files Browse the repository at this point in the history
Fix number of sites by type
  • Loading branch information
AstyLavrinenko authored Jan 11, 2024
2 parents f35b817 + abe4aee commit 1d9ef0d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gemdat/sites.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,9 @@ def _calculate_site_occupancy(
label = labels[k]
counts[label].append(v)

div = len(labels) * n_steps
site_occupancies = {k: sum(v) / div for k, v in counts.items()}
site_occupancies = {
k: sum(v) / (n_steps * labels.count(k))
for k, v in counts.items()
}

return site_occupancies

0 comments on commit 1d9ef0d

Please sign in to comment.