stk.molecular.molecules module¶
Defines classes which describe molecules.
There are a couple of major classes defined here. The most important
ones are StructUnit
and MacroMolecule
. Here is an
overview of their role and interaction. This is followed by a
step-by-step guide to macromolecular assembly.
StructUnit
represents the monomers that make up
macromolecules. These are commonly refered to as building blocks
in
the documentation. StructUnit
holds information concerning
only a single building block molecule. For example, the number of atoms
and bonds a building block may have. It also has information about the
functoinal groups present in the building block molecule (see
FGInfo
). The class also allows manipulation of the lone
building block molecule, such as rotations and translations.
The StructUnit
should be inherited as necessary. For example,
StructUnit2
adds manipulations relavant to molecules with 2
functional groups. StructUnit3
adds manipulations relavant to
molecules with 3 or more functional groups. If you have a monomer which
needs specific information or manipulations, give it its own class.
The MacroMolecule
class represents an assembled macromolecule.
It requires at least 2 basic pieces of information: which monomers are
used to assemble the macromolecule and what the topology/structure
of the macromolecule is.
MacroMolecule.building_blocks
holds a list
of
StructUnit
instances. These represent the monomers which
make up the macromolecule. Only one StructUnit
instance per
monomer type is held. So if 4 of one type of monomer and 2 of another
type of monomer form a macromolecule, only 2 StructUnit
instances are in MacroMolecule.building_blocks
.
MacroMolecule.topology
holds a Topology
instance. This
instance is responsible for assembling the macromolecule from the
building blocks. The building should happen in
MacroMolecule.__init__()
via Topology.build()
. The
build()
method places the assembled macromoleclue in
MacroMolecule.mol
as an rdkit
molecule.
StructUnit
labels atoms in the functional groups of the
building blocks as either 'bonder'
or 'del'
(see its
documentation). This tells the Topology
instance which atoms
form bonds and which are removed during assembly.
A more detailed description of macromolecular assembly.¶
This is a step-by-step guide of how macromolecular assembly is carried out and what the classes do.
First you create StructUnit
instances of the building blocks
which make up the macromolecule:
bb = StructUnit('/path/to/struct/file.mol2', 'amine')
The StructUnit
instances are initialized using paths to
molecular structure files. (Initializing a StructUnit
automatically completes steps 1 to 4.)
Place an
rdkit
instance of the molecule intoStructUnit.mol
, i.e.bb.mol # <rdkit.Chem.rdchem.Mol at 0x7f961a8f1f80>Scan the path of the structure file for the name of a functional group. (Alternatively the name of a functional group can be supplied to the initializer).
bb.func_group.name # 'amine'
Which functional groups are recognized by stk
?
The module functional_groups
defines the class FGInfo
and a tuple
of instances of this class called
functional_groups
. If you put an FGInfo
instance into
functional_groups
, the functional group will be recognized.
Place the
FGInfo
instance of the functional group intoStructUnit.func_grp
.Using
FGInfo
, tag atoms in the building block as either'bonder'
or'del'
.'bonder'
signifies that the atoms form a bond during macromolecular assembly, while'del'
means they are deleted. Also tag all atoms in the functional group with the tag'fg'
which holds the name of the functional group.Give the
StructUnit
andTopology
instances to the macromolecule’s initializer.macro_mol = MacroMolecule([bb1, bb2], Topology())Normally,
MacroMolecule
andTopology
will not be used directly. Instead, classes derived from these will be used. For example,macro_mol = Polymer([bb1, bb2], Linear("AB", [0, 0], 3))Run
Topology.build()
insideMacroMolecule.__init__()
.The details of
Topology.build()
will vary depending on theTopology
class used. However, the basic structure is the same (steps 8 - 10).Use
Topology.place_mols()
to combine therdkit
molecules of all the building blocks into a singlerdkit
instance. The combinedrdkit
instance is placed intomacro_mol.mol
.Topology.place_mols()
also gives each functional group a unique id. Every atom in the assembled molecule that belongs to a functional group is given the tag'fg_id'
, whose value holds a unique id for each functional group.Use
Topology.prepare()
to run any additional operations before joining up the building blocks and deleting extra atoms, this method may do nothing.Use
Topology.bonded_fgs()
to get the ids of functional groups in the molecule to react usingreact()
.Run
Topology.cleanup()
to perform any final operations on the assembled molecule. Can be nothing.
After all this you should have a rdkit
instance of the
macromolecule which should be placed into MacroMolecule.mol
.
Extending stk: Adding new macromolecules.¶
To add new macromolecules create a new class which inherits
MacroMolecule
.
If you’re adding a new class of macromolecules, it quite likely you
want to add a new Topology
class. See the
topologies.base
for guidance on adding these. The topology
class does the assembly of the macromolecule from the building blocks.
-
class
stk.molecular.molecules.
Cached
(*args, **kwargs)¶ Bases:
type
A metaclass for creating classes which create cached instances.
-
class
stk.molecular.molecules.
CachedStructUnit
(*args, **kwargs)¶ Bases:
type
A metaclass for making
StructUnit
create cached instances.
-
class
stk.molecular.molecules.
Cage
(building_blocks, topology, name='', note='', bb_conformers=None)¶ Bases:
stk.molecular.molecules.MacroMolecule
Used to represent molecular cages.
-
cache
= {}¶
-
window_difference
(conformer=-1)¶ The average difference across window sizes.
First take the average window difference between all windows of the same type. Then take the average of window differences across window types.
Consider a triangular-based prism cage topology. Such a cage will have triangular windows and square windows. You only want to compare the triangulars with other triangular windows and squares only with other squares.
Parameters: conformer ( int
, optional) – The id of the conformer to use.Returns: float
– The total difference of window size when considering every combination of windows of the same type.- None (
NoneType
) – If not all windows were found.
-
window_variance
(conformer=-1)¶ The variance in window sizes.
For cages where multiple window types are present, the window variance within each window type is calculated first and the returned value is the mean of these variances.
Parameters: conformer ( int
, optional) – The id of the conformer to use.Returns: The variance in window sizes. Return type: float
-
windows
(conformer=-1)¶ Returns window sizes found by
pywindow
.Parameters: conformer ( int
, optional) – The id of the conformer to use.Returns: - None (
NoneType
) – If the function for finding windows and their sizes found fewer than the required number of windows or if it failed for some other reason. list
offloat
– Eachfloat
represents the size of a window in the cage. If the window finding function found more than the expected number of windows, only the largestn
windows are returned. Wheren
is the number of expected windows for that cage topology.
- None (
-
-
class
stk.molecular.molecules.
MacroMolecule
(building_blocks, topology, name='', note='', bb_conformers=None)¶ Bases:
stk.molecular.molecules.Molecule
A representing assembled macromolecules.
Because of the computational cost associated with macromolecule assembly, instances of this class are cached. This means that providing the same arguments to the initializer will not build a different instance with the same attribute values. It will yield the original instance, retrieved from memory.
This class is not intended to be used directly but should be inherited by subclasses representing specific macromolecules. The
Cage
andPolymer
classes are examples of this. Any information or methods that apply generally to all macromolecule should be defined within this class while specific non-general data should be included in the derived classes.Note the equality operator
==
comparesfitness
. This means two different macromolecules compare equal if they happen to have the same fitness. The operator is not to be used to check if one macromolecule is the same structurally as another. To do this, usesame()
.-
building_blocks
¶ This attribute holds
StructUnit
instances which represent the monomers forming the macromolecule. Only oneStructUnit
instance is needed per building block, even if multiples of that molecule join up to form the macromolecule.Type: list
ofStructUnit
-
bb_counter
¶ A counter keeping track of how much of each building block is used to form the macromolecule. Added by
Topology.build()
.Type: collections.Counter
-
fitness
¶ The fitness value of the macromolecule, used by the GA.
Type: float
-
unscaled_fitness
¶ The dictionary holds the name of a fitness function as the key and the value it calculated for unscaled_fitness as the value. For example,
unscaled_fitness = {'fitness_func1': 12.3, 'fitness_func2': 49.2}
where
'fitness_func1'
and'fitness_func2'
are the names of the fintess functions applied on the molecule.Type: dict
-
progress_params
¶ Holds the fitness parameters which the GA should track to make progress plots. The key is the name of a fitness function. Has the form
unscaled_fitness = {'fitness_func1': [8, 49] 'fitness_func2': [78, 4.2, 32.3]}
Type: dict
-
bonds_made
¶ The number of bonds made during assembly. Added by
Topology.build()
.Type: int
-
classmethod
_json_init
(json_dict)¶ Completes a JSON initialization.
This function is not to be used. Use
Molecule.load()
for loading instances from a JSON string. That function will automatically call this one.Parameters: json_dict ( dict
) – A dictionary holding the attribute data of the molecule.Returns: None Return type: NoneType
-
add_conformer
(bb_conformers)¶ Assembles a new conformer.
Parameters: bb_conformers ( list
ofint
) – The ids of the building block conformers to be used. Must be equal in length tobuilding_blocks
and orders must correspond. IfNone
, then-1
is used for all building blocks.Returns: The id of the new conformer. Return type: int
-
bb_distortion
(bb_conformers=None, conformer=-1)¶ Rmsd difference of building blocks before and after assembly.
The function looks at each building block in the macromolecule and calculates the rmsd between the “free” verson and the one present in the macromolecule. The mean of these rmsds is returned.
Atoms which form the functional group of the building blocks and hydrogens are excluded from the calculation.
Parameters: - bb_conformers (
list
ofint
) – The ids of building block conformers to use. 1 id for each building block, in an order corresponding tobuilding_blocks
. IfNone
, all conformer ids default to-1
. - conformer (
int
, optional) – The id of the conformer to use.
Returns: The mean rmsd of the macromole’s building blocks to their “free” counterparts.
Return type: float
- bb_conformers (
-
building_block_cores
(bb)¶ Yields the “cores” of the building block molecules.
The structure of the yielded cores has the geometry found in the macromolecule.
Parameters: bb ( int
) – The index of a building block molecule withinbuilding_blocks
. The cores of this molecule are yielded.Yields: rdkit.Chem.rdchem.Mol
– The core of a building block molecule, as found in the macromolecule.
-
cache
= {}¶
-
static
gen_key
(building_blocks, topology)¶ Generates the key used for caching the molecule.
Parameters: - building_blocks (
list
ofStructUnit
) – The building blocks used to make the macromolecule. - topology (
Topology
) – The topology used to make the macromolecule.
Returns: The key used for caching the macromolecule.
Return type: tuple
- building_blocks (
-
json
()¶ Returns a JSON representation of the molecule.
The representation has the form
{ 'class' : 'Polymer', 'mol_block' : '''A string holding the V3000 mol block of the molecule.''' 'building_blocks' : {bb1.json(), bb2.json()} 'topology' : 'Copolymer(repeating_unit="AB")' 'unscaled_fitness' : {'fitness_func1' : fitness1, 'fitness_func2' : fitness2}, 'note' : 'A nice molecule.', 'name' : 'Poly-Benzene' }
Returns: A dict
which represents the molecule.Return type: dict
-
update_cache
()¶ Update attributes of cached molecule.
When an instance of
MacroMolecule
is first created it is cached. Usingmultiprocessing
to perform optimizations or calculate fitness returns modified copies of the cached molecules. In order to ensure that the cached molecules have their attributes updated to the values of the copies, this method must be run on the copies.Returns: None Return type: NoneType
-
-
exception
stk.molecular.molecules.
MacroMoleculeBuildError
¶ Bases:
Exception
-
class
stk.molecular.molecules.
Molecule
(name='', note='')¶ Bases:
object
The most basic class representing molecules.
This class defines the operations which any class describing molecules should inherit or may find useful. Examples of such are
StructUnit
andMacroMolecule
. This class should not be used directly.-
mol
¶ An
rdkit
molecule instance representing the molecule.Type: rdkit.Chem.rdchem.Mol
-
inchi
¶ The InChI of the molecule.
Type: str
-
atom_props
¶ Maps atom id to a
dict
holding therdkit
atom properties of the atom. For exampleatom_props = {0: {'bonder': 0, 'fg': 'amine', 'fg_id': 1}, 5: {'fg': 'amine', 'fg_id': 2, 'del': 0}}
Type: dict
-
bonder_ids
¶ Holds the id of bonder atoms in a nested
list
bonder_ids = [[1, 3], [5, 6], [11, 14]]
This means atoms with ids
1
and3
are bonder atoms withfg_id
of0
, atoms5
and6
are bonder atoms withfg_id
of1
and11
and14
are bonder atoms withfg_id
of2
.Type: list
-
optimized
¶ Indicates whether a
Molecule
has been passed through an optimization function or not.Type: bool
-
name
¶ A name which can be optionally given to the molecule for easy identification.
Type: str
-
note
¶ A note or comment about the molecule. Purely optional but can be useful for labelling and debugging.
Type: str
-
_cavity_size
(origin, conformer)¶ Calculates diameter of the molecule from origin.
The cavity is measured by finding the atom nearest to origin, correcting for van der Waals diameter and multiplying by -2.
This function should not be used directly. Use
cavity_size()
instead, which finds the optimal value of origin to use.Parameters: - origin (
numpy.array
) – Holds the x, y and z coordinate of the position from which the cavity is measured. - conformer (
int
) – The id of the conformer to be used.
Returns: The (negative) diameter of the molecules cavity.
Return type: float
- origin (
-
_write_mdl_mol_file
(path, conformer=-1)¶ Writes a V3000
.mol
file of the moleculeThis function should not be used directly, only via
write()
.Parameters: - path (
str
) – The full path to the file being written. - conformer (
int
, optional) – The conformer to use.
Returns: None
Return type: NoneType
- path (
-
_write_pdb_file
(path, conformer=-1)¶ Writes a
.pdb
file of the moleculeThis function should not be used directly, only via
write()
.Parameters: - path (
str
) – The full path to the file being written. - conformer (
int
, optional) – The conformer to use.
Returns: None
Return type: NoneType
- path (
-
all_atom_coords
(conformer=-1)¶ Yields the coordinates of atoms in
mol
.Parameters: conformer (
int
, optional) – The id of the conformer to be used.Yields: tuple
– The yieldedtuple
has the form(32, numpy.array([12, 34, 3]))
Where the first element is the atom id and the second element is an array holding the coordinates of the atom.
-
atom_coords
(atom_id, conformer=-1)¶ Return coordinates of an atom.
Parameters: - atom_id (
int
) – The id of the atom whose coordinates are desired. - conformer (
int
, optional) – The id of the conformer to be used.
Returns: An array holding the x, y and z coordinates of the atom.
Return type: numpy.array
- atom_id (
-
atom_distance
(atom1_id, atom2_id, conformer=-1)¶ Return the distance between 2 atoms.
Parameters: - atom1_id (
int
) – The id of the first atom. - atom2_id (
int
) – The id of the second atom. - conformer (
int
, optional) – The id of the conformer to be used.
Returns: The distance between the first and second atoms.
Return type: scipy.double
- atom1_id (
-
atom_symbol
(atom_id)¶ Returns the symbol of the atom with id atom_id.
Parameters: atom_id ( int
) – The id number of the atom.Returns: The atomic symbol of the atom. Return type: str
-
bonder_centroid
(conformer=-1)¶ Returns the centroid of the bonder atoms.
The calculation has two stages. First, the centroids of bonder atoms within the same functional groups are found. Second, the centroid of the centroids found in stage 1 is calculated and returned.
Parameters: conformer ( int
, optional) – The conformer to use.Returns: An array holding the midpoint of the bonder atoms. Return type: numpy.array
-
bonder_centroids
(conformer=-1)¶ Calculates the centriod of bonder atoms in each fg.
The centroids are yielded in order, with the centroid of the functional group with
fg_id
of0
first.Parameters: conformer ( int
, optional) – The conformer to use.Yields: numpy.array
– The bonder centroid of a functional group.
-
cavity_size
(conformer=-1)¶ Calculates the diameter of the molecule’s cavity.
Parameters: conformer ( int
, optional) – The id of the conformer to be used.Returns: The diameter of the molecule’s cavity in Angstroms. Return type: float
-
center_of_mass
(conformer=-1)¶ Returns the centre of mass of the molecule.
Parameters: conformer ( int
, optional) – The id of the conformer to use.Returns: An array holding the coordinates of the center of mass. Return type: numpy.array
References
-
centroid
(conformer=-1)¶ Returns the centroid of the molecule.
Parameters: conformer ( int
, optional) – The id of the conformer to use.Returns: A numpy array holding the position of the centroid. Return type: numpy.array
-
dihedral_strain
(dihedral_SMARTS='', target=180, conformer=-1)¶ Returns the difference between the average dihedral and target.
The differences is a returned as a percent.
Parameters: - dihedral_SMARTS (
str
) – The SMARTS code for the dihedral of interest. - target (
float
) – Float representing the target value for the dihedral angle. - conformer (
int
, optional) – The id of the conformer to be used.
Returns: The percent difference between the average dihedral in the molecule and the target value.
Return type: float
- dihedral_SMARTS (
-
dump
(path)¶ Writes a JSON
dict
of the molecule to a file.Parameters: path ( str
) – The full path to the file to which the JSON dict should be written.Returns: None Return type: NoneType
-
fg_centroid
(fg_id, conformer=-1)¶ The centroid of bonder atoms in a functional group.
Parameters: - fg_id (
int
) – The id of the functional group. - conformer (
int
, optional) – The conformer to use.
Returns: The coordinates of a bonder centroid.
Return type: numpy.array
Raises: RuntimeError
– If fg_id is not found on any atoms.- fg_id (
-
fg_distance
(fg1, fg2, conformer=-1)¶ The distance between the bonder centroids of two fgs.
Parameters: - fg1 (
int
) – Thefg_id
of the first fg. - fg2 (
int
) – Thefg_id
of the second fg. - conformer (
int
, optional) – The id of the conformer to use.
Returns: The distance between fg1 and fg2.
Return type: float
- fg1 (
-
classmethod
from_dict
(json_dict, optimized=True, load_names=True)¶ Creates a
Molecule
from a JSONdict
.The
Molecule
returned has the class specified in json_dict, notMolecule
.Parameters: - json_dict (
dict
) – Adict
holding the JSON representation of a molecule. - optimized (
bool
, optional) – The value passed toMolecule.optimized
- load_names (
bool
, optional) – IfTrue
then thename
key stored in json_dict is loaded.
Returns: The molecule represented by json_dict.
Return type: - json_dict (
-
graph
()¶ Returns a mathematical graph representing the molecule.
Returns: A graph where the nodes are the ids of the atoms and the edges are the bonds. Return type: networkx.Graph
-
inchi
Returns the InChI of the molecule.
Returns: The InChI of the molecule. Return type: str
-
classmethod
load
(path, optimized=True, load_names=True)¶ Creates a
Molecule
from a JSON file.The returned
Molecule
has the class specified in the JSON file, notMolecule
.Parameters: - path (
str
) – The full path holding a JSON representation to a molecule. - optimized (
bool
, optional) – The value passed toMolecule.optimized
. - load_names (
bool
, optional) – IfTrue
then thename
key stored in the JSON file is loaded.
Returns: The molecule held in path.
Return type: - path (
-
max_diameter
(conformer=-1)¶ Returns the largest distance between 2 atoms in the molecule.
Parameters: conformer ( int
, optional) – The id of the conformer to use.Returns: A tuple
of the formmax_diameter = (312.3, 4, 54)
Where the first element is the largest inter-atomic distance in the molecule. The next 2 elements are the ids of the involved atoms.
Return type: tuple
of form (float, int, int)
-
mdl_mol_block
(conformer=-1)¶ Returns a V3000 mol block of the molecule.
Parameters: conformer ( int
, optional) – The id of the conformer to use.Returns: The V3000 mol block representing the molecule. Return type: str
-
retag_atoms
()¶ Adds atom properties to atoms, using
atom_props
.Returns: None Return type: NoneType
-
rotate
(theta, axis, conformer=-1)¶ Rotates the molecule by theta about axis.
The rotation occurs about the molecular centroid.
Parameters: - theta (
float
) – The size of the rotation in radians. - axis (
numpy.array
) – The axis about which the rotation happens. - conformer (
int
, optional) – The id of the conformer to use.
Returns: None
Return type: NoneType
- theta (
-
same
(other)¶ Check if other has the same molecular structure.
Parameters: other ( Molecule
) – TheMolecule
instance you are checking has the same structure.Returns: Returns True
if the structures match.Return type: bool
-
save_atom_props
()¶ Updates
atom_props
andbonder_ids
.Returns: None Return type: NoneType
-
set_orientation
(start, end, conformer=-1)¶ Rotates the molecule by a rotation from start to end.
Given two direction vectors, start and end, this method applies the rotation required transform start to end on the molecule. The rotation occurs about the centroid of the molecule.
For example, if the start and end vectors are 45 degrees apart, a 45 degree rotation will be applied to the molecule. The rotation will be along the appropriate direction.
The great thing about this method is that you as long as you can associate a geometric feature of the molecule with a vector, then the molecule can be rotated so that this vector is aligned with end. The defined vector can be virtually anything. This means that any geometric feature of the molecule can be easily aligned with any arbitrary axis.
Notes
The difference between this method and
StructUnit._set_orientation2()
is about which point the rotation occurs: centroid of the entire molecule versus centroid of the bonder atoms, respectively.Parameters: - start (
numpy.array
) – A vector which is to be rotated so that it transforms to the end vector. - end (
numpy.array
) – This array holds the vector, onto which start is rotated. - conformer (
int
, optional) – The id of the conformer to use.
Returns: The
rdkit
molecule inmol
.Return type: rdkit.Chem.rdchem.Mol
- start (
-
set_position
(position, conformer=-1)¶ Sets the centroid of the molecule to position.
Parameters: - position (
numpy.array
) – This array holds the position on which the centroid of the molecule should be placed. - conformer (
int
, optional) – The id of the conformer to be used.
Returns: The
rdkit
molecule with the centroid placed at position. This is the same instance as that inMolecule.mol
.Return type: rdkit.Chem.rdchem.Mol
- position (
-
set_position_from_matrix
(pos_mat, conformer=-1)¶ Set atomic positions of the molecule to those in pos_mat.
Parameters: - pos_mat (
numpy.array
) –The matrix holds the coordinates on which the atoms of the molecule should be placed.
The shape of the matrix is
[3, n]
. Each column of pos_mat represents the coordinates of a single atom. The 1st column sets the coordinates of the atom with id of 0. The next column sets the coordinates of the atom with id 1, and so on. - conformer (
int
, optional) – The id of the conformer to be used.
Returns: None
Return type: NoneType
- pos_mat (
-
shift
(shift, conformer=-1)¶ Shifts the coordinates of all atoms.
This does not modify the molecule. A modified copy is returned.
Parameters: - shift (
numpy.array
) – A numpy array holding the value of the shift along each axis. - conformer (
int
, optional) – The id of the conformer to use.
Returns: A copy of the molecule where the coordinates have been shifted by shift.
Return type: rdkit.Chem.rdchem.Mol
- shift (
-
subclasses
= {'Cage': <class 'stk.molecular.molecules.Cage'>, 'MacroMolecule': <class 'stk.molecular.molecules.MacroMolecule'>, 'Periodic': <class 'stk.molecular.molecules.Periodic'>, 'Polymer': <class 'stk.molecular.molecules.Polymer'>, 'StructUnit': <class 'stk.molecular.molecules.StructUnit'>, 'StructUnit2': <class 'stk.molecular.molecules.StructUnit2'>, 'StructUnit3': <class 'stk.molecular.molecules.StructUnit3'>}¶
-
update_from_mae
(path, conformer=-1)¶ Updates molecular structure to match an
.mae
file.Parameters: - path (
str
) – The full path of the.mae
file from which the structure should be updated. - conformer (
int
, optional) – The conformer to be updated.
Returns: None
Return type: NoneType
- path (
-
update_from_mol
(path, conformer=-1)¶ Updates molecular structure to match an
.mol
file.Parameters: - path (
str
) – The full path of the.mol
file from which the structure should be updated. - conformer (
int
, optional) – The conformer to be updated.
Returns: None
Return type: NoneType
- path (
-
update_stereochemistry
(conformer=-1)¶ Updates stereochemistry tags in
Molecule.mol
.Parameters: conformer ( int
, optional) – The conformer to use.Returns: None Return type: NoneType
-
write
(path, conformer=-1)¶ Writes a molecular structure file of the molecule.
This bypasses the need to the writining functions in
rdkit
. These have issues with macromolecules due to poor ring finding and sanitization issues.Parameters: - path (
str
) – The path to which the molecule should be written. - conformer (
int
, optional) – The conformer to use.
Returns: None
Return type: NoneType
- path (
-
-
exception
stk.molecular.molecules.
MoleculeSubclassError
¶ Bases:
Exception
-
class
stk.molecular.molecules.
Periodic
(building_blocks, topology, name='', note='')¶ Bases:
stk.molecular.molecules.MacroMolecule
Used to represent periodic structures.
This class is essentially the same as
MacroMolecule
, with additional methods and attributes relevant to periodic materials being added.-
deleters
¶ A
dict
of the form{ 12: [[coord, elem, bond_type], [coord, elem, bond_type], [coord, elem, bond_type]], 45: [[coord, elem, bond_type], [coord, elem, bond_type], [coord, elem, bond_type]] }
The key is an
int
which represents a bonder atom. The value holds the position, element and bond type of every deleter atom removed from that bonder. The position is anumpy.array
, the element is anint
and the bond type is anrdkit.Chem.rdchem.BondType
.Type: dict
-
periodic_bonds
¶ When periodic topologies are assembled, periodic bonds do not get added to the
rdkit
molecule in themol
attribute. Instead,join_mols()
addsPeriodicBond
instances representing the bonds into this list.Type: list
ofPeriodicBond
-
cell_dimensions
¶ The dimensions of the unit cell. The first array is the vector
a
the second isb
and the third isc
. This should be added during the build process by the periodic topology.Type: list
ofnumpy.array
-
_join_island
(cells, island)¶ Adds bonds between unit cells of island.
Notes
For internal use by
island()
.Parameters: - cells (nested
list
ofCell
) – - island (
rdkit.Chem.rdchem.Mol
) – The island molecule holding unit cells placed side by side like in a supercell but with no bonds running between them.
Returns: The island with bonds added.
Return type: rdkit.Chem.rdchem.Mol
- cells (nested
-
_place_island
(dimensions)¶ Places unit cells side by side to form an island.
Notes
For internal use by
island()
.Parameters: dimensions ( list
ofint
) – The number of unit cells in the x, y and z directions to be placed side by side.Returns: The first member of the tuple is a list
holdingCell
objects, one for each unit cell placed. TheCell
object is placed within nested lists so that a cell with the coordinates x, y, z can be accessed from the list using[x][y][z]
. For example,>>> cells, island, bonder_map = periodic._place_island([4, 4, 4]) >>> cells[2][1][3] <Cell at 0x7fa0155d54e0>
where the returned
Cell
object represents the 3rd unit cell along the x axis, the second along the y axis and the fourth along the z axis.The second member is an
rdkit
molecule of the island being built. The third member is adict
mapping the ids of fgs in the island back to the id of the equivalent fg in the original unit cell.Return type: tuple
-
cache
= {}¶
-
island
(dimensions)¶ Build a terminated supercell.
Terminated means that the periodic bonds are replaced with bonds to terminating atoms.
Parameters: dimensions ( list
ofint
) – A 3 memberlist
, holding the number of unit cells in the x, y and z directions used to make the supercell.Returns: An rdkit
molecule of the island.Return type: rdkit.Chem.rdchem.Mol
-
periodic_mol
()¶ Creates a molecule by reacting periodic functional groups.
Returns: The first member is a rdkit.Chem.rdchem.Mol
where the functional groups involved in a periodic bond have been reacted. This means the deleter atoms have been removed.The second member is
list
ofAtomicPeriodicBond
holding the periodic bonds created as a result of the reactions.Return type: tuple
-
write_gulp_input
(path, keywords, cell_fix=[0, 0, 0, 0, 0, 0], atom_fix=None)¶ Writes a GULP input file of the unit cell.
Parameters: - path (
str
) – The path of the file to which the molecule should be written. - keywords (
list
ofstr
) – The keywords to be placed on the first line of the input file. - cell_fix (
list
ofint
, optional) – A 6 member list holding the fix parameters for the unit cell. - atom_fix (
numpy.array
ofint
, optional) – An n by 3 array where n is the number of atoms in the unit cell. Each row has the fix parameters for a given atom.
Returns: None
Return type: NoneType
- path (
-
-
class
stk.molecular.molecules.
Polymer
(building_blocks, topology, name='', note='', bb_conformers=None)¶ Bases:
stk.molecular.molecules.MacroMolecule
Used to represent polymers.
-
cache
= {}¶
-
-
class
stk.molecular.molecules.
StructUnit
(file, functional_group=None, name='', note='')¶ Bases:
stk.molecular.molecules.Molecule
Represents the building blocks of macromolecules.
The goal of this class is to conveniently store information about, and perform operations on, single instances of macromolecular building blocks.
-
init_funcs
¶ This dictionary holds the various functions which can be used to initialize
rdkit
molecules and pairs them with the appropriate file extension.Type: dict
-
file
¶ The full path to the molecular structure file holding the molecule. The supported file formats are the keys in
init_funcs
. As long as a file with one of these extensions is provided, the correct initialization function will be used.Type: str
-
func_grp
¶ The
FGInfo
instance holding information about the functional group which will react when the building block assembles to form macromolecules.Type: FGInfo
-
classmethod
_json_init
(json_dict)¶ Completes a JSON initialization.
This function is not to be used. Use
Molecule.load()
for loading instances from a JSON string. That function will automatically call this one.Parameters: json_dict ( dict
) – A dictionary holding the attribute data of the molecule.Returns: None Return type: NoneType
-
_set_orientation2
(start, end, conformer)¶ Rotates the molecule by a rotation from start to end.
Given two direction vectors, start and end, this method applies the rotation required transform start to end on the molecule. The rotation occurs about the centroid of the molecule.
For example, if the start and end vectors are 45 degrees apart, a 45 degree rotation will be applied to the molecule. The rotation will be along the appropriate direction.
The great thing about this method is that you as long as you can associate a gemotric feature of the molecule with a vector, then the molecule can be roatated so that this vector is aligned with end. The defined vector can be virtually anything. This means that any geometric feature of the molecule can be easily aligned with any arbitrary axis.
Notes
The difference between this method and
set_orientation()
is about which point the rotation occurs: centroid of bonder atoms versus centroid of entire molecule, respectively.Parameters: - start (
numpy.array
) – A vector which is to be rotated so that it transforms to the end vector. - end (
numpy.array
) – This array holds the vector, onto which start is rotated. - conformer (
int
) – The conformer to use.
Returns: The
rdkit
molecule inmol
.Return type: rdkit.Chem.rdchem.Mol
- start (
-
_tag
(mol, smarts, tag)¶ Adds an IntProp to atoms.
Parameters: - mol (
rdkit.Chem.rdchem.Mol
) – The molecule which is to have atoms tagged. - smarts (
list
) – EitherFGInfo.bonder_smarts
orFGInfo.del_smarts
. - tag (
str
) – The name of the atom tag.
Returns: None
Return type: NoneType
- mol (
Ensures that only n atoms per functional group are tagged.
Parameters: - match_atoms (
tuple
) – The atom ids of all matched atoms. - fgs (
tuple
) – The atom ids of all functional group atoms. Nested to keep functional groups grouped. - n (
int
) – The maximum number of matched atoms per functional group to be tagged.
Returns: The ids of atoms to be tagged.
Return type: list
ofint
- match_atoms (
-
all_bonder_distances
(conformer=-1)¶ Yield distances between all pairs of bonder centroids.
Parameters: conformer ( int
, optional) – The conformer to use.Yields: tuple
– Atuple
of the form(3, 54, 12.54)
. The first two elements are thefg_id
of the involved functional groups and the third element is the distance between them.
-
bonder_direction_vectors
(conformer=-1)¶ Yields the direction vectors between bonder atoms.
First the centroids of bonder atoms within the same functional group are found. Then direction vectors between all pairs of these centroids are yielded. Each pair is only yielded once.
The yielded vector is normalized.
Parameters: conformer (
int
, optional) – The conformer to use.Yields: tuple
– They yielded tuple has the form(3, 54, np.array([12.2, 43.3, 9.78]))
The first two elements of the tuple represent the
fg_id
of the start and end fgs of the vector, respectively. The array is the direction vector running between the functional group positions.
-
bonder_position_matrix
(conformer=-1)¶ Returns a matrix holding the positions of bonder centroids.
Parameters: conformer ( int
, optional) – The conformer to use.Returns: The array has the shape [3, n]
. Each column holds the x, y and z coordinates of a bonder centroid. The index of the column corresponds to thefg_id
of the bonder centroid.Return type: numpy.ndarray
-
cache
= {}¶
-
centroid_centroid_dir_vector
(conformer=-1)¶ Returns the direction vector between the 2 molecular centroids.
The first molecular centroid is the centroid of the entire molecule. The second molecular centroid is given by
bonder_centroid()
.Parameters: conformer ( int
, optional) – The conformer to use.Returns: The normalized direction vector running from the centroid of the bonder atoms to the molecular centroid. Return type: numpy.array
-
core
()¶ Return the molecule with no H or functional group atoms.
Returns: The “core” of the molecule. Return type: rdkit.Chem.rdchem.Mol
-
functional_group_atoms
()¶ Returns a container of atom ids of atoms in functional groups.
Returns: The form of the returned tuple is: ((1, 2, 3), (4, 5, 6), (7, 8, 9))
This means that all atoms with ids
1
to9
are in a functional group and that the atoms1
,2
and3
all form one functional group together. So do4
,5
and6
and so on.Return type: tuple
-
static
gen_key
(rdkit_mol, functional_group)¶ Generates the key used when caching the molecule.
Parameters: - rdkit_mol (
rdkit.Chem.rdchem.Mol
) – Anrdkit
instance of the molecule. - functional_group (
str
) – The name of the functional group being used to make macromolecules.
Returns: The key used for caching the molecule. Has the form
('amine', 'InChIString')
Return type: tuple
- rdkit_mol (
-
init_funcs
= {'.mae': <function mol_from_mae_file>, '.mol': functools.partial(<Boost.Python.function object>, sanitize=False, removeHs=False), '.mol2': functools.partial(<Boost.Python.function object>, sanitize=False, removeHs=False), '.pdb': functools.partial(<Boost.Python.function object>, sanitize=False, removeHs=False), '.sdf': functools.partial(<Boost.Python.function object>, sanitize=False, removeHs=False)}
-
classmethod
init_random
(db, fg=None, name='', note='')¶ Picks a random file from db to initialize from.
Parameters: - db (
str
) – A path to a database of molecular files. - fg (
str
, optional) – The name of a functional group which the molecules in db have. By default it is assumed the name is present in the path of the files. - name (
str
, optional) – The name to be given to the created molecule. - note (
str
, optional) – A note to be given to the created molecule.
Returns: A random molecule from db.
Return type: Raises: RuntimeError
– If no files in db could be initialized from.- db (
-
is_core_atom
(atomid)¶ Returns
True
if atom is not H or part of a fg.Parameters: atomid ( int
) – The id of the atom being queried.Returns: Indicates whether the atom with atomid is part of the core. Return type: bool
-
json
()¶ Returns a JSON representation of the molecule.
The representation has the following form:
{ 'class' : 'StructUnit', 'mol_block' : '''A string holding the V3000 mol block of the molecule.''', 'note' : 'This molecule is nice.', 'name' : 'benzene' }
Returns: A dict
which represents the molecule.Return type: dict
-
minimize_theta
(v1, v2, axis, centroid, conformer=-1)¶ Rotates the molecule to minimize angle between v1 and v2.
The rotation is done about the vector axis.
Parameters: - v1 (
numpy.array
) – The vector which is rotated. - v2 (
numpy.array
) – The vector which is stationary. - axis (
numpy.array
) – The vector about which the rotation happens. - centroid (
numpy.array
) – The position vector at the center of the rotation. - conformer (
int
, optional) – The conformer to use.
Returns: None
Return type: NoneType
- v1 (
-
classmethod
rdkit_init
(mol, functional_group=None, name='', note='')¶ Uses an
rdkit
molecule for initialization.Parameters: mol ( rdkit.Chem.rdchem.Mol
) – Anrdkit
molecule used for initialization.Returns: A StructUnit
of mol.Return type: StructUnit
-
rotate2
(theta, axis, conformer=-1)¶ Rotates the molecule by theta about axis.
The rotation occurs about the centroid of the bonder atoms.
Parameters: - theta (
float
) – The size of the rotation in radians. - axis (
numpy.array
) – The axis about which rotation happens. - conformer (
int
, optional) – The conformer to use.
Returns: None
Return type: NoneType
- theta (
-
set_bonder_centroid
(position, conformer=-1)¶ Move the molecule so that the bonder centroid is on position.
Parameters: - position (
numpy.array
) – An array holding the desired the position. It holds the x, y and z coordinates, respectively. - conformer (
int
, optional) – The conformer to use.
Returns: The
rdkit
molecule after it has been shifted. The same instance as inmol
.Return type: rdkit.Chem.rdchem.Mol
- position (
-
set_orientation2
(end, conformer=-1)¶ Rotate the molecule so that bonder atoms lie on end.
The molecule is rotated about the centroid of the bonder atoms. It is rotated so that the direction vector running between the 2 bonder centroids is aligned with the vector end.
Parameters: - end (
numpy.array
) – The vector with which the molecule’s bonder atoms should be aligned. - conformer (
int
, optional) – The conformer to use.
Returns: The
rdkit
molecule inmol
.Return type: rdkit.Chem.rdchem.Mol
- end (
-
similar_molecules
(mols)¶ Returns molecules from mols ordered by similarity.
The most similar molecule is at index 0.
This method uses the Morgan fingerprints of radius 4 to evaluate how similar the molecules in mols are.
Parameters: mols ( iterable
ofrdkit.Chem.rdchem.Mol
) – A group of molecules to which similarity is compared.Returns: A list
of the form,returned_list = [(8.9, mol1), (7.3, mol2), (3.4, mol3)]
where the
float
is the similarity of a given molecule in mols while the`mol
is correspondingrdkit
molecule. Most similar molecule yielded first.Return type: list
-
classmethod
smiles_init
(smiles, functional_group=None, random_seed=4, note='', name='')¶ Initialize from a SMILES string.
The structure of the molecule is embedded using
rdkit.ETKDG()
.Parameters: - smiles (
str
) – A SMILES string of the molecule. - functional_group (
str
, optional) – The name of the functional group which is to have atoms tagged. If no functional group is provided to this parameter, no tagging is done. - random_seed (
int
, optional) – Random seed passed tordkit.ETKDG()
- note (
str
, optional) – A note or comment about the molecule. - name (
str
, optional) – A name which can be optionally given to the molcule for easy identification.
Returns: A
StructUnit
instance of the molecule in smarts.Return type: - smiles (
-
tag_atoms
()¶ Adds atom properties to atoms.
All atoms which form the functional group of the molecule have the property
'fg'
added. Its value is set to the name of the functional group. In addition each such atom is given the property'fg_id'
which is unique to each functional group.The atoms which form bonds during assembly have the property called
'bonder'
added and set to a unique id number. Atoms which are deleted during reactions have the property'del'
set to a unique id number.Returns: None Return type: NoneType
-
untag_atoms
()¶ Removes the tags added by
tag_atoms()
.Returns: None Return type: NoneType
-
-
class
stk.molecular.molecules.
StructUnit2
(file, functional_group=None, name='', note='')¶ Bases:
stk.molecular.molecules.StructUnit
Represents building blocks with 2 functional groups.
-
cache
= {}¶
-
minimize_theta2
(vector, axis, conformer=-1)¶ Rotates molecule about axis to minimze theta with vector.
The molecule is rotated about axis passing through the bonder centroid. It is rotated so that the vector between the bonder and molecular centroids lies on the same plane as vector.
Parameters: - vector (
numpy.array
) – The vector to which the distance should be minimized. - axis (
numpy.array
) – The direction vector along which the rotation happens. - conformer (
int
, optional) – The id of the conformer to be used.
Returns: None
Return type: NoneType
- vector (
-
set_orientation2
(end, conformer=-1)¶ Rotate the molecule so that bonder atoms lie on end.
The molecule is rotated about the centroid of the bonder atoms. It is rotated so that the direction vector running between the 2 bonder centroids is aligned with the vector end.
Parameters: - end (
numpy.array
) – The vector with which the molecule’s bonder atoms should be aligned. - conformer (
int
, optional) – The conformer to use.
Returns: The
rdkit
molecule inmol
.Return type: rdkit.Chem.rdchem.Mol
- end (
-
-
class
stk.molecular.molecules.
StructUnit3
(file, functional_group=None, name='', note='')¶ Bases:
stk.molecular.molecules.StructUnit
Represents building blocks with 3 functional groups.
-
bonder_plane
(conformer=-1)¶ Returns coeffs of the plane formed by the bonder centroids.
A plane is defined by the scalar plane equation:
ax + by + cz = d.
This method returns the
a
,b
,c
andd
coefficients of this equation for the plane formed by the bonder centroids. The coefficentsa
,b
andc
describe the normal vector to the plane. The coefficentd
is found by substituting these coefficients along with thex
,y
andz
variables in the scalar equation and solving ford
. The variablesx
,y
andz
are substituted by the coordinates of some point on the plane. For example, the position of one of the bonder centroids.Parameters: conformer ( int
, optional) – The conformer to use.Returns: This array has the form [a, b, c, d]
and represents the scalar equation of the plane formed by the bonder centroids.Return type: numpy.array
References
-
bonder_plane_normal
(conformer=-1)¶ Returns the normal to the plane formed by bonder centroids.
The normal of the plane is defined such that it goes in the direction toward the centroid of the molecule.
Parameters: conformer ( int
, optional) – The conformer to use.Returns: A unit vector which describes the normal to the plane of the bonder centroids. Return type: numpy.array
-
cache
= {}¶
-
minimize_theta2
(fg_id, vector, axis, conformer=-1)¶ Rotate molecule to minimize angle between fg_id and vector.
The rotation is done about axis and is centered on the bonder centroid, as given by
bonder_centroid()
.Parameters: - fg_id (
int
) – The id of functional group which is to have angle minimized. - vector (
numpy.array
) – A vector with which the angle is minimized. - axis (
numpy.array
) – The vector about which the rotation happens. - conformer (
int
, optional) – The conformer to use.
Returns: None
Return type: NoneType
- fg_id (
-
set_orientation2
(end, conformer=-1)¶ Rotates the molecule so the plane normal is aligned with end.
Here “plane normal” referes to the normal of the plane formed by the bonder centroids. The molecule is rotated about
bonder_centroid()
. The rotation results in the normal of the plane being aligned with end.Parameters: - end (
numpy.array
) – The vector with which the normal of plane of bonder centroids shoould be aligned. - conformer (
int
, optional) – The conformer to use.
Returns: The
rdkit
molecule inmol
.Return type: rdkit.Chem.rdchem.Mol
- end (
-


You're ready!
Easily create your new routes on your terminal using the yo commands
Update and install your assets using bower (already avaible on your machine!)


gmeet lookup
set meets
If the start time has already passed, meet would be scheduled for the next day.


Info labels are primarily used to provide information on an object. Colors, text, icons and numbers can be used to easily highlight specific information.
- Different color options are available to define the status of the information.
- This component is a small non-interactive numeric or text-based control.
- Many different color options are available to define the information status.
- Black is used by default if no color is defined.


Surgical strike on Maharashtra: Uddhav Thackeray tears into BJP after morning coup
Shiv Sena chief Uddhav Thackeray tore into the BJP on Saturday for joining hands with a rebel NCP leader to form a government, describing the stunning development as a "surgical strike" on Maharashtra.
HIGHLIGHTS
- BJP's move a surgical strike, people will avenge it: Uddhav
- Shiv Sena chief addresses joint press meet with NCP
- Sharad Pawar says Ajit's defection not backed by NCP
Shiv Sena chief Uddhav Thackeray tore into the BJP on Saturday for joining hands with a rebel NCP leader to form a government, describing the stunning development as a "surgical strike" on Maharashtra -- one, he said, that the people would avenge.
He also dared the BJP to try and break his party.
Uddhav Thackeray's comments came at a joint press conference with the Nationalist Congress Party (NCP), part of the three-party opposition alliance that's been working to form a government.
The other party in the rival grouping, the Congress, did not send representatives to the press meet.
NCP chief Sharad Pawar, who spoke before Uddhav at the press meet, said a legislature party meeting of the Congress was under way at the time.
Sharad Pawar has said his nephew Ajit Pawar's extraordinary decision to defect to a coalition led by the BJP didn't have the NCP's support.
Pawar senior also warned his MLAs against breaking ranks, pointing out that an anti-defection law was in place.
Inputs from PTI


ravestate.module
Module
Module(self, *, name: str, config: Dict[str, Any] = None, depends: Iterable[ForwardRef('Module')] = None)
Atomic class, which encapsulates a named set of states, properties and config entries, which form a coherent bundle.
Example:
with Module(name="my_module", config={"paramA": 42}): # define properties # define states
modules_per_python_module
defaultdict(default_factory[, ...]) --> dict with default factory
The default factory is called without arguments to produce a new value when a key is not present, in getitem only. A defaultdict compares equal to a dict with the same items. All remaining arguments are treated the same as if they were passed to the dict constructor, including keyword arguments.
registered_modules
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)
has_module
has_module(module_name: str) -> bool
Check whether a module with a particular name has been registered.
module_name
: The name which should be checked for beign registered.
Returns: True if a module with the given name has been registered, false otherwise.
get_module
get_module(module_name: str) -> Set[ravestate.module.Module]
Get modules registered with a particular name.
Note: If the module_name refers to a Python module, multiple Ravestate modules might be returned.
module_name
: Python or Ravestate module name.
Returns: The modules registered under the given name, empty set otherwise.


Established in the year 1984, Makim Med-Aids is an ISO 9001:2008 certified company engaged in manufacturing, exporting and supplying Plaster of Paris bandages. was the first company to manufacture Plaster of Paris Bandages B.P (P.O.P Bandages) in Gujarat, India. We have a team of skilled professionals who have conceptualized and designed the entire technology involved in manufacturing process. This enables us to deliver excellent products consistently along with significant economic versatility. Currently, we supply our bandages under the brand name of MEDICAST to several individual Doctors, Hospitals, several Government agencies (through tenders) as well as merchant exporters. Our firm has few competitive advantages such as experienced R&D department, large product line, large production capacity and customized product sizes. We are leading manufacturers and exporters of orthopaedic POP Bandages.
Quick Facts:
Year of establishment: 1984
Legal status: Partnership
Nature of business: Manufacturer
Number of Employees: 10+
Certification: ISO 9001:2008
MEDICAST P.O.P conforms to the world-class British Pharmacopoeia Standards. Made from 100% cotton Leano Gauze Fabric of the finest quality,Medicast can withstand high tensions while being pulled in applying around limbs to be immobilized. The shrinkage of the bandages is also minimal.
Check Check Check Check Check Check Check Check Check Check Check Check Check Check Check Check Check Check Check Check Check Check Check Check


@dataknut
)If you wish to use any of the material from this report please cite as:
This work is (c) 2018 the University of Southampton.
This report is intended to:
This work was supported by:
We do not ‘support’ the code but if you notice a problem please check the issues on our repo and if it doesn’t already exist, please open a new one.
Inspired by Steffel (2018) which analyses trends in the type and timing of generation in the UK over the same time period. Intended to build on Kahn et al’s 2018 CO2 intensity of peak demand paper - how have thngs changed over time?
Uses https://www.emi.ea.govt.nz/Wholesale/Datasets/Generation/Generation_MD/ from 1998 to 2018. Note that this does not appear to include Solar (too low or in a seperate data set?) nor does it appear to include domestic/small-scale generation? It is possible that these are to be found in https://www.emi.ea.govt.nz/Wholesale/Datasets/Metered_data/Embedded_generation and should be combined with this data?
Data is kWh - so energy not power.
Load the generation data from files stored in:
These have been pre-downloaded and cleaned but could be pulled on the fly to be refreshed for other dates…
## Warning in `[.data.table`(filesToDateDT, , `:=`(c("year", "month",
## "stub"), : Supplied 3 columns to be assigned a list (length 5) of values (2
## unused)
## [1] "Files loaded"
## [1] "Loaded 245,350 rows of data"
## sampleGenDT
##
## 14 Variables 245350 Observations
## ---------------------------------------------------------------------------
## Site_Code
## n missing distinct
## 245350 0 69
##
## lowest : ANI ARA ARG ARI ATI, highest: WPA WPI WRK WTK WWD
## ---------------------------------------------------------------------------
## POC_Code
## n missing distinct
## 245350 0 68
##
## lowest : ARA2201 ARG1101 ARI1101 ARI1102 ASB0661
## highest: WRK0331 WRK2201 WTK0111 WWD1102 WWD1103
## ---------------------------------------------------------------------------
## Nwk_Code
## n missing distinct
## 245350 0 27
##
## lowest : ALNT BOPD CHHE CTCT EASH, highest: TRPG TRUS TUAR WAIK WATA
## ---------------------------------------------------------------------------
## Gen_Code
## n missing distinct
## 245350 0 68
##
## lowest : aniwhenua arapuni aratiatia argyle_wairau atiamuri
## highest: whakamaru whareroa wheao_flaxy whirinaki white_hill
## ---------------------------------------------------------------------------
## Fuel_Code
## n missing distinct
## 245350 0 8
##
## Value Coal Diesel Gas Gas&Oil Geo Hydro Wind Wood
## Frequency 4550 4550 33400 6100 25650<PHONE_NUMBER>0 4550
## Proportion 0.019 0.019 0.136 0.025 0.105 0.624 0.055 0.019
## ---------------------------------------------------------------------------
## Tech_Code
## n missing distinct
## 245350 0 5
##
## Value Cogen Geo Hydro Thrml Wind
## Frequency 19750 25650<PHONE_NUMBER>0 13500
## Proportion 0.080 0.105 0.624 0.136 0.055
## ---------------------------------------------------------------------------
## Trading_date
## n missing distinct
## 245350 0 91
##
## lowest : 1998-06-01 1998-06-02 1998-06-03 1998-06-04 1998-06-05
## highest: 2018-06-26 2018-06-27 2018-06-28 2018-06-29 2018-06-30
## ---------------------------------------------------------------------------
## Time_Period
## n missing distinct
## 245350 0 50
##
## lowest : TP1 TP10 TP11 TP12 TP13, highest: TP50 TP6 TP7 TP8 TP9
## ---------------------------------------------------------------------------
## kWh
## n missing distinct Info Mean Gmd .05 .10
##<PHONE_NUMBER> 74622 0.997 39767 48729 0 0
## .25 .50 .75 .90 .95
## 6361 19896 54010 89674 154625
##
## lowest : 0.0000e+00 1.0000e-02 1.0200e-02 1.0300e-02 2.0300e-02
## highest: 4.9213e+05 4.9239e+05 4.9246e+05 4.9266e+05 4.9302e+05
## ---------------------------------------------------------------------------
## rTime [secs]
## n missing distinct
##<PHONE_NUMBER> 48
##
## lowest : 00:15:00 00:45:00 01:15:00 01:45:00 02:15:00
## highest: 21:45:00 22:15:00 22:45:00 23:15:00 23:45:00
## ---------------------------------------------------------------------------
## rDate
## n missing distinct
## 245350 0 91
##
## lowest : 1998-06-01 1998-06-02 1998-06-03 1998-06-04 1998-06-05
## highest: 2018-06-26 2018-06-27 2018-06-28 2018-06-29 2018-06-30
## ---------------------------------------------------------------------------
## rDateTime
## n missing distinct
##<PHONE_NUMBER> 4368
## Info Mean Gmd
## 1 2007-04-15 09:27:41 1979-10-15 13:08:01
## .05 .10 .25
## 1998-06-06 13:45:00 1998-06-12 03:45:00 1998-06-28 21:15:00
## .50 .75 .90
## 1998-12-25 02:45:00 2018-06-13 17:15:00 2018-06-24 02:15:00
## .95
## 2018-06-27 13:15:00
##
## Value 8.95e+08 9.00e+08 9.10e+08 9.15e+08 1.53e+09
## Frequency 20548 42812 752 69184 102240
## Proportion 0.087 0.182 0.003 0.294 0.434
## ---------------------------------------------------------------------------
## month
## n missing distinct Info Mean Gmd
## 245350 0 2 0.626 7.782 2.505
##
## Value 6 12
## Frequency<PHONE_NUMBER>0
## Proportion 0.703 0.297
## ---------------------------------------------------------------------------
## year
## n missing distinct Info Mean Gmd
## 245350 0 2 0.737 2007 9.826
##
## Value 1998 2018
## Frequency<PHONE_NUMBER>00
## Proportion 0.566 0.434
## ---------------------------------------------------------------------------
Table ?? sumarises the data. Notice that there are missing (NA) values in the kWh column. These are caused by periods 49 and 50:
“The data is presented by trading period, TP1, TP2, … TP48. Trading period 1 starts at midnight, trading period 2 starts at 12:30am, trading period 3 starts at 1:00am, etc. Users of this data should be aware of daylight saving in New Zealand. On the day daylight saving commences there are only 46 trading periods and on the day it ends, there are 50.” (https://www.emi.ea.govt.nz/Wholesale/Datasets/Generation/Generation_MD/)
So on 2 days of the year TP47 & TP48 do not exist and on the following days they are back and we also have TP49 & TP50. There are only two things in life worse than death & taxes: daylight saving time and time-zones.
Daylight saving begins/ends in October and March so we carefully avoid this problem in this section by using June and December. However these TP are still present as labels in the Time_Period variable and so give NA kWh in the data as the following table (Table 4.1) and plot (Figure 4.1) of NA observations (only) by Fuel Type and month show.
| Time_Period | mean |
|---|---|
| TP1 | 34216.67 |
| TP10 | 29496.19 |
| TP11 | 30351.36 |
| TP12 | 31634.09 |
| TP13 | 34251.02 |
| TP14 | 37355.17 |
| TP15 | 40649.58 |
| TP16 | 43596.37 |
| TP17 | 45022.05 |
| TP18 | 45553.60 |
| TP19 | 45800.49 |
| TP2 | 32943.34 |
| TP20 | 45563.65 |
| TP21 | 45137.01 |
| TP22 | 44664.21 |
| TP23 | 44125.07 |
| TP24 | 43716.02 |
| TP25 | 43146.78 |
| TP26 | 42594.82 |
| TP27 | 42271.77 |
| TP28 | 41742.35 |
| TP29 | 41225.36 |
| TP3 | 31860.12 |
| TP30 | 40900.41 |
| TP31 | 40876.16 |
| TP32 | 41426.75 |
| TP33 | 42405.64 |
| TP34 | 44208.48 |
| TP35 | 46696.45 |
| TP36 | 48342.40 |
| TP37 | 47878.89 |
| TP38 | 47176.80 |
| TP39 | 46269.81 |
| TP4 | 30935.05 |
| TP40 | 45318.58 |
| TP41 | 44482.53 |
| TP42 | 43868.60 |
| TP43 | 42945.16 |
| TP44 | 41519.99 |
| TP45 | 39406.13 |
| TP46 | 37233.14 |
| TP47 | 36864.40 |
| TP48 | 35293.26 |
| TP49 | NA |
| TP5 | 30268.84 |
| TP50 | NA |
| TP6 | 29736.19 |
| TP7 | 29427.16 |
| TP8 | 29198.74 |
| TP9 | 29240.89 |
In order to avoid future confusion and to save a lot of error checking we therefore remove NA kWh (i.e. TP49 & TP 50) from the dataset.
# N rows before:
nrow(sampleGenDT)
## [1] 245350
# N time periods before:
uniqueN(sampleGenDT$Time_Period)
## [1] 50
# remove NA
sampleGenDT <- sampleGenDT[!is.na(kWh)]
# N rows after
nrow(sampleGenDT)
## [1] 235536
# N time periods after:
uniqueN(sampleGenDT$Time_Period)
## [1] 48
Table 5.1 shows summary statistics for each fuel source by year. Hydro contributes the majority of energy in each year but coal has the highest half-hourly mean in each year suggesting that is makes large contributions at specific times. Comparing the mean and median for coal shows how skewed this distirbution was in 1998 although far less so in 2018. This is also supported by the maximum values which show coal as the ‘peaked’ energy producer in 1998 although this has faded by 2018 where it shows similar maxima to gas and hydro. Note that 2 of the 4 the Huntly coal-fired units were mothballed/retired during this period.
Figure 5.1 shows the distribution of half-hourly observations by month and year. It clearly shows the use of coal in June 1998, non-use in December 1998 but re-use in December 2018 where there appears little differnece between winter & summer use for most fuels. We also see the emergence of wind by 2018.
| year | Fuel_Code | sumMWh | meanMWh | medianMWh | minMWh | maxMWh | sdMWh |
|---|---|---|---|---|---|---|---|
| 1998 | Coal | 379460.72 | 129.60 | 40.99 | 0 | 493.02 | 159.50 |
| 1998 | Diesel | 322.77 | 0.11 | 0.00 | 0 | 84.86 | 2.97 |
| 1998 | Gas | 537031.60 | 28.11 | 10.27 | 0 | 267.10 | 45.45 |
| 1998 | Gas&Oil | 514797.99 | 87.91 | 91.95 | 0 | 173.73 | 43.46 |
| 1998 | Geo | 340786.48 | 38.80 | 25.60 | 0 | 81.87 | 28.90 |
| 1998 | Hydro | 3870532.38 | 42.64 | 26.49 | 0 | 294.98 | 53.53 |
| 1998 | Wood | 29067.50 | 9.93 | 14.10 | 0 | 19.50 | 7.41 |
| 2018 | Coal | 93735.66 | 65.09 | 57.32 | 0 | 254.60 | 58.34 |
| 2018 | Diesel | 776.63 | 0.54 | 0.00 | 0 | 48.59 | 3.90 |
| 2018 | Gas | 492738.77 | 38.02 | 6.98 | 0 | 235.56 | 60.39 |
| 2018 | Geo | 595770.19 | 37.61 | 35.59 | 0 | 82.31 | 23.73 |
| 2018 | Hydro | 2366059.55 | 42.13 | 22.12 | 0 | 397.49 | 60.79 |
| 2018 | Wind | 134846.74 | 10.40 | 7.72 | 0 | 45.09 | 9.86 |
| 2018 | Wood | 10738.74 | 7.46 | 6.34 | 0 | 18.86 | 6.66 |
Figure 5.2 visualises the distribution of MWh values within fuel sources. Note that the vertical axis has been allowed to vary by fuel source so that smaller counts are visible. The y axis is constant which enables the higher unit output of coal to be clearly visible. The histogram for coal shows the use of multiple units in June 1998 but not 2018 for example where the output is clearly truncated. It also shows that coal was almost constantly generating in 2018 (very few zero values). Hydro on the other hand shows a large number of zero or low values as does wind and back-up diesel which is to be expected.
The following plots shows the total, mean, s.d. and coefficient of variation plots of half-hourly GWh produced by each fuel source each month and to some extent relfects the previous box plots.
The total is simply the sum of all half-hourly values and Figure 5.3 shows the dominance of hydro followed by coal in June 1998; the non-use of coal in December 1998; the growth of gas & geo by 2018 but the relative stasis in at-capacity hydro (?).
Figure 5.5 shows the standard deviation of the half-hourly generation data and suggests that coal has the highest absolute variation in June 1998 which may correspond to a particular spike and/or a period of very heavy use. Coal is less variable in 2018 perhaps due to the increased use of Gas.
Finally, Figure ?? shows the coefficient of variation across the half-hourly values (mean/s.d). We take the CoV to indicate relative variability (i.e. relative volatility) in generation load between the different fuels and use it in preference to the standard deviation (shown above) which, as an absolute measure, is affected by the underlying magnitude of each fuel’s use. The plots suggest that Coal and Wood tend to see greatest relative variability although Gas & Oil in 1998 also stand out.
# coefficient of variation https://en.wikipedia.org/wiki/Coefficient_of_variation
plotDT <- plotDT[, cov := 1000000 * (meankWh/sdkWh)] # corrct for GW conversion in plot function (doh!)
makeMonthlyDodgedPlot(plotDT, "cov", "CoV half-hourly GWh") + geom_col(position = "dodge")
## Warning: Removed 1 rows containing missing values (geom_col).
## Warning: Removed 1 rows containing missing values (geom_col).
However the monthly plots do not tell us about the use of different generation sources by time of day which has clear implications for how peaks in demand have been met over time.
To do this, the following plots partially replicate one of those found in Staffel, 2018 for the UK to show how the different components of generation have changed over time.
Figure 5.6 shows the total half-hourly generation for each month summed over all days whilst Figure 5.7 shows the same data but as a point plot to more clearly show the absolute contribution of each fuel.
Note 1: the half-hours are plotted at mid-points (00:15, 00:45, 01:15 etc…)
Note 2: rTime (Time of Day) is originally imputed from the TP1-48 periods (and TP49 & TP50 on DST break days) and is therefore automatically set to the local NZ ‘civil’ time - so NZST or DST as appropriate. See ?setEAGenTimePeriod and the data processing script for more details.
Repeat for 2018 only
Figures 5.9 and 5.10 repeat this analysis but shows the mean, again suggesting that the values for coal are skewed by some extremely large values in December 1998 and by high generation values when used in 2018.
The following plots show the profiles for each day of the month. Unfortunately due to the lack of wind generation in 1998 the colour scheme changes from 1998 to 2018.
To be fixed
Nevertheless the differences between the compositions of each half-hour can be seen.
Figure 5.11 shows the total as a point plot while Figure 5.12 shows the total as stacked column plots to show the proportion of energy generation produced by each fuel.
Using full dataset for each day, month & year.
## [1] "Files loaded"
## [1] "Loaded 23,046,850 rows of data"
As above, in order to avoid future confusion and to save a lot of error checking we again remove NA kWh (i.e. TP49 & TP 50) from the dataset.
# N rows before:
nrow(allGenDT)
## [1] 23046850
# N time periods before:
uniqueN(allGenDT$Time_Period)
## [1] 50
# remove NA
allGenDT <- allGenDT[!is.na(kWh)]
# N rows after
nrow(allGenDT)
## [1] 22121358
# N time periods after:
uniqueN(allGenDT$Time_Period)
## [1] 50
The hydro trends (and the consequences for Carbon-based generation) should be seen in the context of the Southern Oscilation’s effect on rainfall.
“Although El Niño and La Niña (collectively known as El Niño-Southern Oscillation or ENSO) have an important influence on New Zealand’s climate, it accounts for less than 25 percent of the year-to year variance in seasonal rainfall and temperature at most locations. Nevertheless, its effects can be significant.” https://www.niwa.co.nz/climate/information-and-resources/elnino/elnino-impacts-on-newzealand
“La Niña events have different impacts on New Zealand’s climate. More north–easterly winds are characteristic, which tend to bring moist, rainy conditions to the north–east of the North Island, and reduced rainfall to the south and south–west of the South Island.
Therefore, some areas, such as central Otago and South Canterbury, can experience drought in both El Niño and La Niña. "
Figure (fig:monthlySOI) shows the monthly El Niño Southern Oscillation Index for 1986–2016 and shows at least four strong El Nino periods centred on 1987, 1993, 1997, 2005 and 2015.
## Parsed with column specification:
## cols(
## Month_year = col_character(),
## Southern_oscillation_index = col_double()
## )
## Month_year Southern_oscillation_index
## 1: Jan-86 1.0
## 2: Feb-86 -1.0
## 3: Mar-86 0.5
## 4: Apr-86 0.3
## 5: May-86 -0.2
## 6: Jun-86 1.0
Figure (fig:yearlySOI) confirms this overall pattern although the aggregation to calendar years (as opposed to climate years) masks some of the periods.
Figure 6.2 shows the dominance of hydro and decrease in coal use.
Adding annotations with information from:
If we consider the relationship between generation and the SOI at the yearly level, Figure (fig:yearlyGenSOI) suggests that Gas is fairly responsive to increasing SOI above 0 (La Nina years) and hydro is the inverse (with considerable variation/uncertainty) on an annual measure. Presumably this indicates the use of Gas for peaking generation when hydro is at capacity in drier years?
This section uses monthly aggregates.
## Warning: Removed 7 rows containing missing values (geom_path).
## Saving 11 x 8 in image
## Warning: Removed 7 rows containing missing values (geom_path).
Figures 6.4 shows the same trends as previously but using monthly data to highlight seasonal patterns over time.
If we consider the relationship between generation and the SOI at the monthly level, Figure (fig:monthlyGenSOI) suggests there is a much less clear relationship although the fit lines are still in the same directions with increased use of gas as the SOI increases and the inverse for hydro.
Figures 6.6 and ?? show the same trends as previously but using daily data to highlight seasonal patterns over time. Annotations use information from:
## Warning: Removed 217 rows containing missing values (geom_path).
## Saving 11 x 8 in image
## Warning: Removed 217 rows containing missing values (geom_path).
here
go here
Figure 8.1 shows the fuel use by each of the Huntly units over time. It appears to show that huntly_1_4 always burns coal although the units are able to also burn gas. It is not clear if this data is correct.

Should we be adding embedded generation from https://www.emi.ea.govt.nz/Wholesale/Datasets/Metered_data/Embedded_generation ? It seems to be PV which (currently) has a los installed capacity…
Analysis completed in 626.39 seconds ( 10.44 minutes) using knitr in RStudio with R version 3.5.1 (2018-07-02) running on x86_64-apple-darwin15.6.0.
R packages used:
Session info:
## R version 3.5.1 (2018-07-02)
## Platform: x86_64-apple-darwin15.6.0 (64-bit)
## Running under: macOS High Sierra 10.13.6
##
## Matrix products: default
## BLAS: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.0.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
##
## locale:
## [1] en_NZ.UTF-8/en_NZ.UTF-8/en_NZ.UTF-8/C/en_NZ.UTF-8/en_NZ.UTF-8
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] knitr_1.20 Hmisc_4.1-1 Formula_1.2-3
## [4] survival_2.42-6 lattice_0.20-35 skimr_1.0.3
## [7] readr_1.1.1 ggplot2_3.1.0 dplyr_0.7.7
## [10] data.table_1.11.8 gridCarbon_0.1.0
##
## loaded via a namespace (and not attached):
## [1] tidyselect_0.2.5 xfun_0.4 reshape2_1.4.3
## [4] purrr_0.2.5 splines_3.5.1 colorspace_1.3-2
## [7] htmltools_0.3.6 yaml_2.2.0 base64enc_0.1-3
## [10] utf8_1.1.4 rlang_<IP_ADDRESS> pillar_1.3.0
## [13] foreign_0.8-71 glue_1.3.0 withr_2.1.2
## [16] RColorBrewer_1.1-2 bindrcpp_0.2.2 bindr_0.1.1
## [19] plyr_1.8.4 stringr_1.3.1 munsell_0.5.0
## [22] gtable_0.2.0 htmlwidgets_1.3 evaluate_0.12
## [25] labeling_0.3 latticeExtra_0.6-28 fansi_0.4.0
## [28] highr_0.7 htmlTable_1.12 Rcpp_0.12.19
## [31] acepack_1.4.1 scales_1.0.0 backports_1.1.2
## [34] checkmate_1.8.5 gridExtra_2.3 hms_0.4.2
## [37] digest_0.6.18 stringi_1.2.4 bookdown_0.7
## [40] grid_3.5.1 rprojroot_1.3-2 cli_1.0.1
## [43] tools_3.5.1 magrittr_1.5 lazyeval_0.2.1
## [46] tibble_1.4.2 cluster_2.0.7-1 crayon_1.3.4
## [49] pkgconfig_2.0.2 Matrix_1.2-14 lubridate_1.7.4
## [52] rstudioapi_0.8 assertthat_0.2.0 rmarkdown_1.10
## [55] R6_2.3.0 rpart_4.1-13 nnet_7.3-12
## [58] compiler_3.5.1
Dowle, M, A Srinivasan, T Short, S Lianoglou with contributions from R Saporta, and E Antonyan. 2015. Data.table: Extension of Data.frame. https://CRAN.R-project.org/package=data.table.
Grolemund, Garrett, and Hadley Wickham. 2011. “Dates and Times Made Easy with lubridate.” Journal of Statistical Software 40 (3): 1–25. http://www.jstatsoft.org/v40/i03/.
Harrell Jr, Frank E, with contributions from Charles Dupont, and many others. 2016. Hmisc: Harrell Miscellaneous. https://CRAN.R-project.org/package=Hmisc.
R Core Team. 2016. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing. https://www.R-project.org/.
Wickham, Hadley. 2009. Ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York. http://ggplot2.org.
Wickham, Hadley, Jim Hester, and Romain Francois. 2016. Readr: Read Tabular Data. https://CRAN.R-project.org/package=readr.
Xie, Yihui. 2016a. Bookdown: Authoring Books and Technical Documents with R Markdown. Boca Raton, Florida: Chapman; Hall/CRC. https://github.com/rstudio/bookdown.
———. 2016b. Knitr: A General-Purpose Package for Dynamic Report Generation in R. https://CRAN.R-project.org/package=knitr.


T.I.'s daughter Deyjah Harris unfollows him on Instagram after hymen comments
T.I.'s daughter, Deyjah Harris, 18, has unfollowed her rapper dad and family on Instagram after he recently made comments about her hymen following a visit to her gynecologist
by Brogan-Leigh HurstT.I.'s daughter Deyjah Harris has unfollowed her dad and family on Instagram after he made comments about her hymen.
It comes after her rapper dad, 39, said he attends Deyjah's gynecologist appointments to make sure she's a virgin.
The star, 18, has yet to publicly address her dad's remarks as he bragged that he has ensured her hymen is still intact by meeting with her doctor after her annual check-up.
Deyjah recently liked a series of tweets calling his actions "disgusting", "possessive" and "controlling".
Adding fuel to the fire, she also tweeted: "I loveeeeeee yalllllll" and received huge support from her fans.
T.I. made the controversial comments while speaking on the Ladies Like Us podcast and he stressed that it was very important to him that Deyjah has not had sex yet.
He admitted he feels differently about 15 year old son King, who is sexually active.
"I will say as of her 18th birthday," T.I. said, "Her hymen is still intact."
He continued: "Deyjah's 18, just graduated high school now and she's attending her first year of college, figuring it out for herself.
"And yes, not only have we had the conversation [about sex], we have yearly trips to the gynaecologist to check her hymen. "
Describing one visit to the doctor's, he told hosts Nazanin Mandi and Nadia Moham: "So it's this one time we go, I think this might have been after her 16th birthday. This is what we do. Right after the birthday we celebrate.
"Usually like the day after the party, she's enjoying her gifts. I put a sticky note on the door: 'Gyno. Tomorrow. 9:30."
He continued: "So we'll go and sit down and the doctor will come and talk and the doctor's maintaining a high level of professionalism.
"He's like, 'Well, you know sir, I have to, in order to share information' - I'm like, 'Deyjah, they want you to sign this...so we can share information. Is there anything you would not want me to know?'
"'See doc?' 'No problem.'"
After causing a stir, Planned Parenthood hit back at the rapper's lewd remarks on Twitter in a string of posts.
T.I.'s rap lyrics frequently reference sex - including the song Hotel which describes hookups with a number of women.


Arsenal news: Raul Sanllehi ready to sanction January deal, player's father 'contacted'
All the latest Arsenal news
by Andy HaArsenal return to Premier League action against Southampton after the international break.
The 2-0 defeat to Leicester last week left the Gunners eight points adrift of the top four, but Unai Emery's side have the chance to bounce back against a struggling Saints team that have shipped 14 goals in their last three league games.
Emery's future has been under scrutiny but the Arsenal head coach was recently given a vote of confidence by the Gunners hierarchy.
Can he improve results to save his job? Or will the north Londoners be looking for a new coach by Christmas?
Here's the latest stories doing the rounds from the last 24 hours.
Arsenal Women take spoils in historic north London derby
Arsenal beat Tottenham 2-0 at the Tottenham Hotspur Stadium to win the first ever derby at Spurs' new ground.
Second half goals from Kim Little and Vivianne Miedema were enough for the three points in front of a league record crowd.
What Reiner Jesus said about playing in England
Arsenal are reported to have Reiner Jesus' father over a potential move to north London.
17-year-old has impressed since making his debut for Flamengo in July and is already to be thought to be on the radar of some of Europe's biggest clubs.
Global powerhouses such as Paris Saint-Germain, Manchester City , Real Madrid and Juventus are all interested while Everton are believed to have held talks over a possible January deal.
However, Mundo Deportivo have reported that Arsenal have tried to steal an early march on their rivals by contacting Reinier's father in an attempt to convince him to move to the club.
Agent provides update on Lucas Torreira's Arsenal future
The agent of Arsenal midfielder Lucas Torreira has revealed that his client is not happy with his role at the Emirates Stadium this season.
The midfielder has mostly been used as a substitute during the 2019/20 campaign, although he has been a regular pick in the Europa League, starting three of the four games so far.
Torreira has however been named in the starting 11 for Arsenal's last two Premier League games, starting in the middle of the park for the matches against Wolves and Leicester, where the Gunners picked up one point from the 180 minutes.
Before securing a move to the Emirates in summer 2018, Torreira was in negotiations with Italian side Napoli, and his agent Raffaele Bentancur has revealed just how close the Uruguayan came to moving to Napoli.
Arsenal willing to sanction Xhaka sale in order to seal January transfer
According to The Mirror, Arsenal could offer Granit Xhaka to former club Borussia Monchengladbach in January, with Denis Zakaria potentially moving in the other direction.
Zakaria often partners Xhaka for Switzerland, but the pair could be set to swap clubs in January.


HOME
CSS Basic
CSS Introduction
CSS Syntax
CSS How to
CSS Background
CSS Text
CSS Font
CSS Border
CSS Outline
CSS Margin
CSS Padding
CSS List
CSS Table
CSS Advanced
CSS Dimension
CSS Classification
CSS Positioning
CSS Pseudo-class
CSS Pseudo-element
CSS Image Gallery
CSS Image Opacity
CSS Media Types
CSS Don't
CSS Summary
CSS Examples
CSS Examples
CSS References
CSS Reference
CSS Print
CSS Aural
CSS Units
CSS Colors
CSS Colorvalue
CSS Colornames
CSS Quiz
CSS Quiz
CSS Exam
CSS3 Tutorials
CSS3 Syntax
CSS Reference
CSS Margin
CSS Padding
CSS Text
CSS Colors
CSS Border
CSS Background
CSS3 Examples
CSS Tutorials
SITE SEARCH
About W3Schools
W3Schools Forum
Dynamic button image
generation
Web Hosting
$15 Domain name
Registration
Save $20 / year!
UK Domain names
UK Web hosting
Alpiamiento web
Buy UK Domain Names
Register Domain Names
Cheap Domain Names
Cheap Web Hosting
Best Web Hosting
Domain name
Registration
PHP MySQL Hosting
Top 10 Web Hosting
Web Hosting Providers
Web Hosting Company
Web Hosting Reviews
UK Web hosting
CSS Tutorial
CSS Tutorial
Save a lot of work with CSS!
In your CSS tutorial you will learn how to use CSS to control the style and the layout of multiplle Web pages all at once.
Start learning the CSS!
CSS Examples
Learn by 70 examples with our editor, you can edit CSS, and click on a test button to view the result.
Try-It-Yourself!
CSS Reference
At W3Schools you will find a complete CSS3 reference, listing properties, units of measurements, colors and more.
Start learning the CSS3!
CSS Quiz Test
Test your CSS skills at W3Schools!
Start CSS Quiz!


UDF govt. roped in Uralungal, says CM
Solution provider for software support to police for passport verification
by Special CorrespondentThe decision to make Uralungal Labour Contract Cooperative Society Ltd. (ULCCS) as total solution provider for software support to the State police for passport verification was taken during the previous United Democratic Front government’s time, Chief Minister Pinarayi Vijayan has said.
“It is clear that everyone in this House accepts the efficiency of the ULCCS and which is probably why the State Police Chief also accepted the GO [government order] issued by the previous government and handed over the responsibility of the project to them. The GO issued by the UDF government recognising the ULCCS as total service provider still stands and the Left Democratic Front government has not sought to change it,” Mr. Vijayan said in reply to a question by V. P. Sajeendran, P. T. Thomas and Eldhos Kunnappillil in the Assembly on Monday.
POC application
As the total service provider, the ULCCS had been asked to submit a project proposal, following which it was asked to develop a Proof of Concept (POC) application.
The State Police Chief had appointed a technical committee with the Additional Director General of Police (Coastal Security) as the chair to examine the POC in detail.
The government had not taken any decision to hand over the highly confidential data base of the State police to any private firms, Mr. Vijayan, said in his reply.


Track Suggester
See which Epicodus track is best for you!
Do you have an Android phone?
Do you have a Microsoft computer or laptop?
Do you consider youself artistic?
What have you enjoyed doing more the first two weeks?
Choose which city you would prefer to live in?
Java/Android Track
C#/.NET Track
CSS/Design


Image files, audio files, executable files from other programming languages, many kinds of data files, ... the list is endless.
So a stream object may be:
There are many types of streams. For example, a stream might be an "input, character-oriented, processing stream". Another stream might be "output, ordinary, byte-oriented stream". Not only are there many types of streams, there are many ways to connect them together. The IO aspects of a program may take as much work as all the rest of the program!
This situation is common to all production (industrial strength) programming languages. IO is a big topic because of the wide variety of IO devices and the wide variety of data formats. A production language must be able to read data from sources written by any language running on any type of computer. For example, a program might need to read data from magnetic tapes written 30 years ago by a COBOL program running on an IBM mainframe. (You would likely use byte-oriented streams for this).
The good news is that Java uses the same data formats for all computers. If a Java program running on a Macintosh writes a text file, that file can easily be read by a Java program running on a PC or on any other computer.
This is not true of most other languages. A "C" program running on one type of computer is unlikely to create a file that can easily be read by a "C" program running on another type of computer. Worse than that, two different "C" compilers for the same computer are free to use different data formats!


This is a site that outlines a bit of Moniq's journey into coding
Below is a list outlining the various projects I have undertaken
It has been a journey marked with a significant amount of ups and downs. Fourtunately I have had the pleasure of working with some of the smartest people I've met. Their resilience and die-hard spirit is definately something to emulate. Take a look at the list below...


Sir Steve Redgrave, Will this work as a commit
The Main Who Saved a Billion Lives
an image of soliders contemplating their next move
List of Key dates in his life:
- 1990: Liam Was Born
- 2001: Went to High School
- 2008: Went To Uni
- 2011: Gradutated Uni
- 2016: Lydia-May born
- 2021: Finsihed this Course


 I first found out about these seeds on the internet and was immediately intrigued. I had read every review going and made my mind up that I would give these seeds a shot. I ordered 50 of them from a trusted source. They arrived and I prepared them as follows:
1. Peeled off all the outer layer plus the tougher fuzz underneath, this took about 2 hours or more (seriously!). I used a knife to scrape. They can be very fiddly and because they are very small they kept slipping out of my grasp. I also noticed some were darker than others, dark brown to light brown.
2. Once I had finished this tedious task I smashed them up with a hammer, they were in a small sealed bag as I did this. I kept on hammering them until they were into minute chunks.
3. I then opened the bag and tipped its contents into a glass, the smell was quite strong!
4. I then boiled up some water and waited for it to cool, once it was warm I poured a small amount into the glass and left to brew.
5. The following day I woke up and took hold of the glass that had been brewing throughout the night, the water was a olive green and there was seed matter floating on the top.
I looked at the time and saw it was 9:00am. I felt slightly tired but was all the time thinking ‘Just drink it down and then it’s done with.’ So I took one massive mouthful and swallowed. It didn’t taste all that bad. Only until I drank near to the end it suddenly hit me that this stuff actually was foul, YUK! I drank the remaining seed gunk at the end. ‘Phew, glad that is over with’, I thought to myself then pulled the duvet over me and began to rest.
About 20 minutes of laying in my bed my stomach began to feel bloated and slightly uncomfortable, I had to lie in a certain position to feel ok. Another 20 minutes passed and I felt nauseous. I got out of bed and walked to the toilet and sat beside it waiting for the sickness to take effect. I have read so many reports stating sickness so I was prepared for that eventuality. There was a constant need to burp, I sat there burping, each time thinking if there was something going to come up.  I got up and walked back to bed feeling quite strange. I took a nap, which is very unusual for me, and woke up 10 minutes later with the effects in full swing.
I got out of bed and tried to walk, my legs felt very stiff, quite heavy and my balance was altered, I nearly fell over. My head felt light, definitely a ‘high’ feeling I walked to the bathroom and looked in the mirror, my pupils were dilated a lot, which gave a good sign to my intoxication. I decided to go for a walk to the shop. When I was walking it felt as though I was floating (it’s very hard to describe) quite pleasant and when I looked behind me a strange feeling of unfamiliarity swept over me, things seemed different but at the same time I knew exactly what I was seeing was familiar, strange. Euphoria was present, I seemed happy within myself.
I stopped walking and stared down at a lake and watched the ducks thinking how nice nature is. Lots of other things that wouldn’t usually interest me did that day. There are not many visual effects of HBWS if not any at all. I had one minor hallucination (if it was one) as I was walking down the road I looked over at a tree and thought I saw someone standing there but quickly realised it was just the tree all along, this was around the peak of the ‘trip’. I walked into the shop and grabbed some lunch only to see one of my Dad’s mates in there. As my thinking was altered, I felt as though my talking was too and it became a battle to appear normal when chatting to him. I made it quick and said ‘Bye.’
The walk was long and the effects were slowly wearing off on the way home. I got home and started to eat. Things became tastier and I noticed the flavours were more apparent in what I ate, this was nice. I still felt high and a bit tired. I feel as though the initial sick feeling really spoils this drug, but apart from that I would have to say the effects are nice and last quite long mine from 9:00am-2:00pm they’re good for a day with nothing else to do. I will eat some more but not just yet.
Anyway I hope this experience of mine was useful I have given very accurate facts as to what happened. I would probably suggest to people who don’t like feeling or being sick not to have these as they will almost definitely make do that to you. In my opinion these are no comparison to mushrooms but they are different in their own unique way, mushrooms is visual, mind bending and euphoric with no sickness. They are good for someone wanting to come off other drugs I’d imagine.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Interface IMixedRealityPointer
Interface for handling pointers.
Namespace: XRTK.Interfaces.InputSystem
Assembly: XRTK.dll
Syntax
public interface IMixedRealityPointer : IEqualityComparer
Properties
| Improve this Doc View SourceBaseCursor
The pointer's cursor.
Declaration
IMixedRealityCursor BaseCursor { get; set; }
Property Value
| Type | Description |
|---|---|
| IMixedRealityCursor |
Controller
The pointer's current controller reference.
Declaration
IMixedRealityController Controller { get; set; }
Property Value
| Type | Description |
|---|---|
| IMixedRealityController |
CursorModifier
The currently active cursor modifier.
Declaration
ICursorModifier CursorModifier { get; set; }
Property Value
| Type | Description |
|---|---|
| ICursorModifier |
FocusTarget
The currently focused target.
Declaration
IMixedRealityFocusHandler FocusTarget { get; set; }
Property Value
| Type | Description |
|---|---|
| IMixedRealityFocusHandler |
InputSourceParent
This pointer's input source parent.
Declaration
IMixedRealityInputSource InputSourceParent { get; }
Property Value
| Type | Description |
|---|---|
| IMixedRealityInputSource |
IsFocusLocked
Is the focus for this pointer currently locked?
Declaration
bool IsFocusLocked { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
IsInteractionEnabled
Has the conditions for the interaction been satisfied to enable the interaction?
Declaration
bool IsInteractionEnabled { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
PointerExtent
The pointer's maximum extent when raycasting.
Declaration
float PointerExtent { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
PointerId
This pointer's id.
Declaration
uint PointerId { get; }
Property Value
| Type | Description |
|---|---|
| UInt32 |
PointerName
This pointer's name.
Declaration
string PointerName { get; set; }
Property Value
| Type | Description |
|---|---|
| String |
PointerOrientation
The Y orientation of the pointer - used for touchpad rotation and navigation
Declaration
float PointerOrientation { get; }
Property Value
| Type | Description |
|---|---|
| Single |
PrioritizedLayerMasksOverride
The physics layers to use when raycasting.
Declaration
LayerMask[] PrioritizedLayerMasksOverride { get; set; }
Property Value
| Type | Description |
|---|---|
| LayerMask[] |
Remarks
If set, will override the IMixedRealityInputSystem's default raycasting layer mask array.
Examples
Allow the pointer to hit SR, but first prioritize any DefaultRaycastLayers (potentially behind SR)
int sr = LayerMask.GetMask("SR");
int nonSR = Physics.DefaultRaycastLayers & ~sr;
IMixedRealityPointer.PrioritizedLayerMasksOverride = new LayerMask[] { nonSR, sr };
|
Improve this Doc
View Source
RaycastMode
The physics raycast mode to use.
Declaration
RaycastMode RaycastMode { get; set; }
Property Value
| Type | Description |
|---|---|
| RaycastMode |
Rays
The raycast rays.
Declaration
RayStep[] Rays { get; }
Property Value
| Type | Description |
|---|---|
| RayStep[] |
RayStabilizer
Ray stabilizer used when calculating position of pointer end point.
Declaration
IBaseRayStabilizer RayStabilizer { get; set; }
Property Value
| Type | Description |
|---|---|
| IBaseRayStabilizer |
Result
The physics raycast pointer result.
Declaration
IPointerResult Result { get; set; }
Property Value
| Type | Description |
|---|---|
| IPointerResult |
SphereCastRadius
The radius to use when RaycastMode is set to Sphere.
Declaration
float SphereCastRadius { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
TeleportHotSpot
The currently active teleport hotspot.
Declaration
IMixedRealityTeleportHotSpot TeleportHotSpot { get; set; }
Property Value
| Type | Description |
|---|---|
| IMixedRealityTeleportHotSpot |
Methods
| Improve this Doc View SourceOnPostRaycast()
Called after all rays have casted.
Declaration
void OnPostRaycast()
OnPreRaycast()
Called before all rays have casted.
Declaration
void OnPreRaycast()
TryGetPointerPosition(out Vector3)
Returns the position of the input source, if available. Not all input sources support positional information, and those that do may not always have it available.
Declaration
bool TryGetPointerPosition(out Vector3 position)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position | Out parameter filled with the position if available, otherwise zero. |
Returns
| Type | Description |
|---|---|
| Boolean | True if a position was retrieved, false if not. |
TryGetPointerRotation(out Quaternion)
Returns the rotation of the input source, if available. Not all input sources support rotation information, and those that do may not always have it available.
Declaration
bool TryGetPointerRotation(out Quaternion rotation)
Parameters
| Type | Name | Description |
|---|---|---|
| Quaternion | rotation | Out parameter filled with the rotation if available, otherwise identity. |
Returns
| Type | Description |
|---|---|
| Boolean | True if an rotation was retrieved, false if not. |
TryGetPointingRay(out Ray)
Returns the pointing ray of the input source, if available. Not all input sources support pointing information, and those that do may not always have it available.
Declaration
bool TryGetPointingRay(out Ray pointingRay)
Parameters
| Type | Name | Description |
|---|---|---|
| Ray | pointingRay | Out parameter filled with the pointing ray if available. |
Returns
| Type | Description |
|---|---|
| Boolean | True if a pointing ray was retrieved, false if not. |


Skeleton loaders are great placeholders for content that haven't finished loading yet, i.e. when you're waiting for the data to load, instead of just showing a blank page or a spinner, consider showing a skeleton (empty placeholder for content).
Want another template? Please create an issue here
The skeleton loader for content will use the full width of its container, however the mask will never be wider than 768px (content should in general not be too wide otherwise it will be hard to read).
The skeleton loader for list content will use the full width of its container, however the mask will never be wider than 320px.
If you have a single field, label or small content that you want to use a skeleton loader for, the skeleton-loader-fill
class is what you're looking for. It's available in three different versions that all use the full width of the container but the height reflects the size for input fields, labels and buttons.
Perfect for labels and as a placeholder for content inside tables etc.
Perfect for input fields and buttons.
Perfect when you want to mask something bigger like a chart or diagram, you can also combine it with utility classes like rounded-circle
to create more creative skeletons, and maybe use it as a placeholder for a pie chart or a profile picture?
Use skeleton-loader-table
if you're loading or waiting for table data. The template uses the full width of it's container and the height will by default adjust it self according to the screen width unless you set a fixed height.
If you want to define a custom size by putting the skeleton loader in an element with a fixed height and/or width try to stick to even numbers of 45 px for the height and add 1 px for the top border, i.e. 46
, 91
, 136
and so on.
If you're using multiple skeleton loaders on a page and they're spread across the screen horizontally you might want to consider adding a delay to the animation to get that smooth transition. There are three delay classes that can be added delay-1
, delay-2
and delay-3
.
By default the skeleton loader uses white as fill color (for use against white backgrounds) but it's also possible to use skeleton loaders against dark (.bg-dark
) and light (.bg-light
). All skeleton loaders support custom fill colors.
Just add bg-dark
to the skeleton loader element.
Just add bg-light
to the skeleton loader element.


-
Copy your awesome text.
Favorite poem, funny joke, helpful URL...it's up to you. We are building a top secret database of all your Copy Pastas. JK...or are we?
-
Pasta into our "Pasta Bowl"
Your text will be waiting for you in the app! You never have to email yourself text again! We know...you love us. We...care for you.
How it Works
Copy Pasta is super simple to use. Copy text from anywhere on your computer, paste it into our "Pasta Bowl" above, and it magically appears on your mobile app or any browser! Your "Pasta" is automatically copied to your device clipboard as soon as you open the app.
- Easy to sign in
- Quick to use
- Potentially life saving?


SE Missouri State eludes upset-minded Missouri S&T, 72-71
CAPE GIRARDEAU, Mo. (AP) - Alex Caldwell hit a 3-point field goal with 17 seconds left in the game to lift Southeast Missouri State to a 72-71 win over Division II-Missouri Science and Technology on Friday night.
Caldwell tied the game at 69-69 with a hard drive to the hoop, but after a Missouri S&T; time out, Dulan Scott broke the tie with 34 seconds left when he knocked down a jumper to put the Miners ahead.
Looking to take the last shot, the Redhawks had the ball stolen away with 3.4 seconds left, but Missouri S&T;’s Mitch Fairless missed a jump shot as time expired.
Sage Tolbert scored 16 points and grabbed nine rebounds to lead the Redhawks (2-2). Caldwell, who hit 2 of 3 from distance, added 12 points.
Fairless scored 19 points and grabbed 10 rebounds for Missouri S&T.; Scott added 18 points.
SE Missouri State heads to Fresno, where it will take on Cal State-Fullerton in the Cable Car Classic tournament on Wednesday.
Sign up for Daily Newsletters
Copyright © 2019 The Washington Times, LLC.
Please read our comment policy before commenting.


Choose image and resize to 800x400
Circle->Grayscale->Pizelize->Rotate
Choose image and resize to 800x400 with red bg
Choose image to convert in circle with res 400x400
Choose image to rotate
Choose image to graysacle
Choose image to pixelize
Choose image to blur
Choose image for crop to 200x300