casm.project.Selection
- class casm.project.Selection(proj=None, path='MASTER', type='config', all=True)[source]
A Selection object contains information about a CASM project
- proj
the CASM project the selection belongs to
- Type:
casm.Project, optional, default=Project containing the current working directory
- path
path to selection file, or “MASTER” (Default=”MASTER”)
- Type:
string, optional, default=”MASTER”
- type
type of selected object: “config” or “scel”
- Type:
string, optional, default=”config”
- all
if True, self.data will include all configurations, whether selected or not. If False, only selected configurations will be included.
- Type:
bool, optional, default=True
- data
A pandas.DataFrame describing the selected configurations. Has at least ‘configname’ and ‘selected’ (automatically converted to bool) columns.
- Type:
pandas.DataFrame
Construct a CASM Project representation.
- Parameters:
proj (casm.Project, optional, default=Project containing the current working directory) – the CASM project the selection belongs to
path (string, optional, default="MASTER") – path to selection file, or “MASTER” (Default=”MASTER”)
type (string, optional, default="config") – type of selected object: “config” or “scel”
all (bool, optional, default=True) – if True, self.data will include all configurations, whether selected or not. If False, only selected configurations will be included.
- __init__(proj=None, path='MASTER', type='config', all=True)[source]
Construct a CASM Project representation.
- Parameters:
proj (casm.Project, optional, default=Project containing the current working directory) – the CASM project the selection belongs to
path (string, optional, default="MASTER") – path to selection file, or “MASTER” (Default=”MASTER”)
type (string, optional, default="config") – type of selected object: “config” or “scel”
all (bool, optional, default=True) – if True, self.data will include all configurations, whether selected or not. If False, only selected configurations will be included.
Methods
__init__
([proj, path, type, all])Construct a CASM Project representation.
add_data
(name[, data, force])Add selection data, either by query or from an existing DataFrame
astype
(columnname, dtype)Convert a column to another type
query
(columns[, force, verbose])Query requested columns and store them in 'data'.
save
([data, force])Save the current selection.
saveas
([path, force])Create a new Selection from this one, save and return it
write_pos
([all])Write POS file for selected configurations
Attributes
Get Selection data as a pandas.DataFrame