SelectionParser

class sknano.core.atoms.selections.SelectionParser(atoms=None, selstr=None, **kwargs)[source] [edit on github][source]

Bases: sknano.core.meta.BaseClass

Selection parser class.

Attributes

fmtstr Format string.

Methods

ALL
AND
ATOMICNUMBER
ATOM_ATTRIBUTE
CONE
CUBE
CUBOID
CYLINDER
ELEMENT
ELLIPSOID
EXWITHIN
ID
INDEX
LPAR
MOLID
NAME
NONE
NOT
NUMBONDS
OF
OR
PARALLELEPIPED
REGIONS
RESIDUE
RPAR
SERIAL
SPHERE
TYPE
WITHIN
all_selection_expression
attr_selection_expression
expr
expr_term
exwithin_selection_expression
grouped_expr
id_selection_expression
molid_selection_expression
none_selection_expression
parse([selstr]) Parse selstr.
region_expression
selection_expression
todict()
type_selection_expression
within_selection_expression

Attributes Summary

ALL
AND
ATOMICNUMBER
ATOM_ATTRIBUTE
CONE
CUBE
CUBOID
CYLINDER
ELEMENT
ELLIPSOID
EXWITHIN
ID
INDEX
LPAR
MOLID
NAME
NONE
NOT
NUMBONDS
OF
OR
PARALLELEPIPED
REGIONS
RESIDUE
RPAR
SERIAL
SPHERE
TYPE
WITHIN
all_selection_expression
attr_selection_expression
expr
expr_term
exwithin_selection_expression
grouped_expr
id_selection_expression
molid_selection_expression
none_selection_expression
region_expression
selection_expression
type_selection_expression
within_selection_expression

Methods Summary

parse([selstr]) Parse selstr.
todict()

Attributes Documentation

ALL = "all"[source]
AND = "and"[source]
ATOMICNUMBER = "atomicnumber"[source]
ATOM_ATTRIBUTE = x | y | z | r | vx | vy | vz | v | fx | fy | fz | f | Z | element | symbol | mass | CN[source]
CONE = "Cone"[source]
CUBE = "Cube"[source]
CUBOID = "Cuboid"[source]
CYLINDER = "Cylinder"[source]
ELEMENT = "element"[source]
ELLIPSOID = "Ellipsoid"[source]
EXWITHIN = "exwithin"[source]
ID = "id"[source]
INDEX = "index"[source]
LPAR = Suppress:("(")[source]
MOLID = {"molid" | "mol"}[source]
NAME = "name"[source]
NONE = "none"[source]
NOT = "not"[source]
NUMBONDS = "numbonds"[source]
OF = "of"[source]
OR = "or"[source]
PARALLELEPIPED = "Parallelepiped"[source]
REGIONS = {{{{{{"Parallelepiped" | "Cuboid"} | "Cube"} | "Ellipsoid"} | "Sphere"} | "Cylinder"} | "Cone"}[source]
RESIDUE = "residue"[source]
RPAR = Suppress:(")")[source]
SERIAL = "serial"[source]
SPHERE = "Sphere"[source]
TYPE = "type"[source]
WITHIN = "within"[source]
all_selection_expression = Suppress:("all")[source]
attr_selection_expression = {{x | y | z | r | vx | vy | vz | v | fx | fy | fz | f | Z | element | symbol | mass | CN [<= | < | == | >= | > | != | LT | LE | EQ | GT | GE | NE]} {{Re:('[+-]?\\d+(\\.\\d*)?([eE][+-]?\\d+)?') | Re:('[+-]?\\d+')} | W:(ABCD...)}}[source]
expr = Forward: ...[source]
expr_term = Forward: ...[source]
exwithin_selection_expression = {{{Suppress:("exwithin") {Re:('[+-]?\\d+(\\.\\d*)?([eE][+-]?\\d+)?') | Re:('[+-]?\\d+')}} Suppress:("of")} Forward: ...}[source]
grouped_expr = {{Suppress:("(") Forward: ...} Suppress:(")")}[source]
id_selection_expression = {Suppress:("id") {Re:('[+-]?\\d+')}... [ {Re:('[+-]?\\d+')}...]...}[source]
molid_selection_expression = {Suppress:({"molid" | "mol"}) {Re:('[+-]?\\d+')}... [ {Re:('[+-]?\\d+')}...]...}[source]
none_selection_expression = Suppress:("none")[source]
region_expression = {{{{{{{{{"Parallelepiped" | "Cuboid"} | "Cube"} | "Ellipsoid"} | "Sphere"} | "Cylinder"} | "Cone"} Suppress:("(")} Forward: ...} Suppress:(")")}[source]
selection_expression = Forward: ...[source]
type_selection_expression = {Suppress:("type") {Re:('[+-]?\\d+')}... [ {Re:('[+-]?\\d+')}...]...}[source]
within_selection_expression = {Suppress:("within") {{{{Re:('[+-]?\\d+(\\.\\d*)?([eE][+-]?\\d+)?') | Re:('[+-]?\\d+')} Suppress:("of")} Forward: ...} | {{{{{{{{{"Parallelepiped" | "Cuboid"} | "Cube"} | "Ellipsoid"} | "Sphere"} | "Cylinder"} | "Cone"} Suppress:("(")} Forward: ...} Suppress:(")")}}}[source]

Methods Documentation

parse(selstr=None, **kwargs)[source] [edit on github][source]

Parse selstr.

todict()[source] [edit on github][source]