Skip to content

Commit

Permalink
Added bsym.process function to return site coordinates from a sitelist
Browse files Browse the repository at this point in the history
  • Loading branch information
bjmorgan committed Jul 12, 2016
1 parent 598ee48 commit 5ab7654
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
1 change: 0 additions & 1 deletion bsym/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def is_in_list( self, list ):
return False

def has_equivalent_in_list( self, list, symmetry_operations ):
print( 'i' )
for config in list:
print( config.as_number, self.as_number )
if ( self.is_equivalent_to( config, symmetry_operations ) ):
Expand Down
12 changes: 12 additions & 0 deletions bsym/process.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from bsym.permutations import unique_permutations, next_permutationS, flatten_list
from bsym.configuration import Configuration
import numpy as np

def unique_configurations_from_sites( site_distribution, spacegroup, verbose=False ):
number_of_sites = sum( site_distribution.values() )
Expand Down Expand Up @@ -33,3 +34,14 @@ def coordinate_list_from_sitelists( configs, labels, sitelists ):
for pos in config.position( label ):
for sitelist in sitelists:
sitelist.print_site( pos )

def list_of_coordinates_from_sitelists( configs, labels, sitelists ):
all_coords = []
for config in configs:
coords = []
for label in labels:
for pos in config.position( label ):
for sitelist in sitelists:
coords.append( sitelist[ pos ] )
all_coords.append( coords )
return np.array( all_coords )
2 changes: 1 addition & 1 deletion examples/pymatgen_structure_analysis_spinel.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
sg = spacegroup_from_structure( parent_structure )

# define the site occupations
site_dist = { 1 : 4,
site_dist = { 1 : 1,
0 : 4 }

# find the unique configurations
Expand Down

0 comments on commit 5ab7654

Please sign in to comment.