partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
test
makePlot
Make the plot with photometry performance predictions. :argument args: command line arguments
examples/plotPhotometricErrorsSkyAvg.py
def makePlot(args): """ Make the plot with photometry performance predictions. :argument args: command line arguments """ gmag=np.linspace(3.0,20.0,171) vmini = args['vmini'] vmag=gmag-gminvFromVmini(vmini) if args['eom']: sigmaG = gMagnitudeErrorEoM(gmag) sigmaGBp = bpMagnitudeError...
def makePlot(args): """ Make the plot with photometry performance predictions. :argument args: command line arguments """ gmag=np.linspace(3.0,20.0,171) vmini = args['vmini'] vmag=gmag-gminvFromVmini(vmini) if args['eom']: sigmaG = gMagnitudeErrorEoM(gmag) sigmaGBp = bpMagnitudeError...
[ "Make", "the", "plot", "with", "photometry", "performance", "predictions", "." ]
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/examples/plotPhotometricErrorsSkyAvg.py#L31-L91
[ "def", "makePlot", "(", "args", ")", ":", "gmag", "=", "np", ".", "linspace", "(", "3.0", ",", "20.0", ",", "171", ")", "vmini", "=", "args", "[", "'vmini'", "]", "vmag", "=", "gmag", "-", "gminvFromVmini", "(", "vmini", ")", "if", "args", "[", "...
ae972b0622a15f713ffae471f925eac25ccdae47
test
calcZ
Calculate the value for the parameter z in the formula for parallax and G magnitude errors as a function of G and (V-I). Parameters ---------- G - Value of G-band magnitude. Returns ------- Value of z.
pygaia/errors/utils.py
def calcZ(G): """ Calculate the value for the parameter z in the formula for parallax and G magnitude errors as a function of G and (V-I). Parameters ---------- G - Value of G-band magnitude. Returns ------- Value of z. """ gatefloor=power(10.0,0.4*(12.0-15.0)) if isscalar(G): result=...
def calcZ(G): """ Calculate the value for the parameter z in the formula for parallax and G magnitude errors as a function of G and (V-I). Parameters ---------- G - Value of G-band magnitude. Returns ------- Value of z. """ gatefloor=power(10.0,0.4*(12.0-15.0)) if isscalar(G): result=...
[ "Calculate", "the", "value", "for", "the", "parameter", "z", "in", "the", "formula", "for", "parallax", "and", "G", "magnitude", "errors", "as", "a", "function", "of", "G", "and", "(", "V", "-", "I", ")", "." ]
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/errors/utils.py#L15-L37
[ "def", "calcZ", "(", "G", ")", ":", "gatefloor", "=", "power", "(", "10.0", ",", "0.4", "*", "(", "12.0", "-", "15.0", ")", ")", "if", "isscalar", "(", "G", ")", ":", "result", "=", "amax", "(", "(", "gatefloor", ",", "power", "(", "10.0", ",",...
ae972b0622a15f713ffae471f925eac25ccdae47
test
calcZBpRp
Calculate the value for the parameter z in the formula for the BP and RP magnitude errors as a function of G and (V-I). Parameters ---------- G - Value of G-band magnitude. Returns ------- Value of z for BP/RP.
pygaia/errors/utils.py
def calcZBpRp(G): """ Calculate the value for the parameter z in the formula for the BP and RP magnitude errors as a function of G and (V-I). Parameters ---------- G - Value of G-band magnitude. Returns ------- Value of z for BP/RP. """ gatefloor=power(10.0,0.4*(11.0-15.0)) if isscalar(G...
def calcZBpRp(G): """ Calculate the value for the parameter z in the formula for the BP and RP magnitude errors as a function of G and (V-I). Parameters ---------- G - Value of G-band magnitude. Returns ------- Value of z for BP/RP. """ gatefloor=power(10.0,0.4*(11.0-15.0)) if isscalar(G...
[ "Calculate", "the", "value", "for", "the", "parameter", "z", "in", "the", "formula", "for", "the", "BP", "and", "RP", "magnitude", "errors", "as", "a", "function", "of", "G", "and", "(", "V", "-", "I", ")", "." ]
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/errors/utils.py#L39-L61
[ "def", "calcZBpRp", "(", "G", ")", ":", "gatefloor", "=", "power", "(", "10.0", ",", "0.4", "*", "(", "11.0", "-", "15.0", ")", ")", "if", "isscalar", "(", "G", ")", ":", "result", "=", "amax", "(", "(", "gatefloor", ",", "power", "(", "10.0", ...
ae972b0622a15f713ffae471f925eac25ccdae47
test
calcZAltStartGate
Calculate the value of z in the formula for the parallax errors. In this case assume gating starts at G=13.3 (to simulate bright star worst performance) Parameters ---------- G - Value of G-band magnitude. Returns ------- Value of z.
pygaia/errors/utils.py
def calcZAltStartGate(G): """ Calculate the value of z in the formula for the parallax errors. In this case assume gating starts at G=13.3 (to simulate bright star worst performance) Parameters ---------- G - Value of G-band magnitude. Returns ------- Value of z. """ gatefloor=power(10.0,0...
def calcZAltStartGate(G): """ Calculate the value of z in the formula for the parallax errors. In this case assume gating starts at G=13.3 (to simulate bright star worst performance) Parameters ---------- G - Value of G-band magnitude. Returns ------- Value of z. """ gatefloor=power(10.0,0...
[ "Calculate", "the", "value", "of", "z", "in", "the", "formula", "for", "the", "parallax", "errors", ".", "In", "this", "case", "assume", "gating", "starts", "at", "G", "=", "13", ".", "3", "(", "to", "simulate", "bright", "star", "worst", "performance", ...
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/errors/utils.py#L63-L85
[ "def", "calcZAltStartGate", "(", "G", ")", ":", "gatefloor", "=", "power", "(", "10.0", ",", "0.4", "*", "(", "13.3", "-", "15.0", ")", ")", "if", "isscalar", "(", "G", ")", ":", "result", "=", "amax", "(", "(", "gatefloor", ",", "power", "(", "1...
ae972b0622a15f713ffae471f925eac25ccdae47
test
averageNumberOfTransits
Returns the number of transits across the Gaia focal plane averaged over ecliptic longitude. Parameters ---------- beta - Value(s) of the Ecliptic latitude. Returns ------- Average number of transits for the input values of beta.
pygaia/errors/utils.py
def averageNumberOfTransits(beta): """ Returns the number of transits across the Gaia focal plane averaged over ecliptic longitude. Parameters ---------- beta - Value(s) of the Ecliptic latitude. Returns ------- Average number of transits for the input values of beta. """ indices = array(floor(a...
def averageNumberOfTransits(beta): """ Returns the number of transits across the Gaia focal plane averaged over ecliptic longitude. Parameters ---------- beta - Value(s) of the Ecliptic latitude. Returns ------- Average number of transits for the input values of beta. """ indices = array(floor(a...
[ "Returns", "the", "number", "of", "transits", "across", "the", "Gaia", "focal", "plane", "averaged", "over", "ecliptic", "longitude", "." ]
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/errors/utils.py#L87-L103
[ "def", "averageNumberOfTransits", "(", "beta", ")", ":", "indices", "=", "array", "(", "floor", "(", "abs", "(", "sin", "(", "beta", ")", ")", "*", "_numStepsSinBeta", ")", ",", "dtype", "=", "int", ")", "indices", "[", "(", "indices", "==", "_numSteps...
ae972b0622a15f713ffae471f925eac25ccdae47
test
angularDistance
Calculate the angular distance between pairs of sky coordinates. Parameters ---------- phi1 : float Longitude of first coordinate (radians). theta1 : float Latitude of first coordinate (radians). phi2 : float Longitude of second coordinate (radians). theta2 : float ...
pygaia/astrometry/coordinates.py
def angularDistance(phi1, theta1, phi2, theta2): """ Calculate the angular distance between pairs of sky coordinates. Parameters ---------- phi1 : float Longitude of first coordinate (radians). theta1 : float Latitude of first coordinate (radians). phi2 : float Long...
def angularDistance(phi1, theta1, phi2, theta2): """ Calculate the angular distance between pairs of sky coordinates. Parameters ---------- phi1 : float Longitude of first coordinate (radians). theta1 : float Latitude of first coordinate (radians). phi2 : float Long...
[ "Calculate", "the", "angular", "distance", "between", "pairs", "of", "sky", "coordinates", "." ]
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/astrometry/coordinates.py#L74-L100
[ "def", "angularDistance", "(", "phi1", ",", "theta1", ",", "phi2", ",", "theta2", ")", ":", "# Formula below is more numerically stable than arccos( sin(theta1)*sin(theta2) +", "# cos(phi2-phi1)*cos(theta1)*cos(theta2) )", "# See: https://en.wikipedia.org/wiki/Great-circle_distance", "...
ae972b0622a15f713ffae471f925eac25ccdae47
test
CoordinateTransformation.transformCartesianCoordinates
Rotates Cartesian coordinates from one reference system to another using the rotation matrix with which the class was initialized. The inputs can be scalars or 1-dimensional numpy arrays. Parameters ---------- x - Value of X-coordinate in original reference system y - Value of...
pygaia/astrometry/coordinates.py
def transformCartesianCoordinates(self, x, y, z): """ Rotates Cartesian coordinates from one reference system to another using the rotation matrix with which the class was initialized. The inputs can be scalars or 1-dimensional numpy arrays. Parameters ---------- x - V...
def transformCartesianCoordinates(self, x, y, z): """ Rotates Cartesian coordinates from one reference system to another using the rotation matrix with which the class was initialized. The inputs can be scalars or 1-dimensional numpy arrays. Parameters ---------- x - V...
[ "Rotates", "Cartesian", "coordinates", "from", "one", "reference", "system", "to", "another", "using", "the", "rotation", "matrix", "with", "which", "the", "class", "was", "initialized", ".", "The", "inputs", "can", "be", "scalars", "or", "1", "-", "dimensiona...
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/astrometry/coordinates.py#L127-L147
[ "def", "transformCartesianCoordinates", "(", "self", ",", "x", ",", "y", ",", "z", ")", ":", "xrot", ",", "yrot", ",", "zrot", "=", "dot", "(", "self", ".", "rotationMatrix", ",", "[", "x", ",", "y", ",", "z", "]", ")", "return", "xrot", ",", "yr...
ae972b0622a15f713ffae471f925eac25ccdae47
test
CoordinateTransformation.transformSkyCoordinates
Converts sky coordinates from one reference system to another, making use of the rotation matrix with which the class was initialized. Inputs can be scalars or 1-dimensional numpy arrays. Parameters ---------- phi - Value of the azimuthal angle (right ascension, longitude) in radians...
pygaia/astrometry/coordinates.py
def transformSkyCoordinates(self, phi, theta): """ Converts sky coordinates from one reference system to another, making use of the rotation matrix with which the class was initialized. Inputs can be scalars or 1-dimensional numpy arrays. Parameters ---------- phi - V...
def transformSkyCoordinates(self, phi, theta): """ Converts sky coordinates from one reference system to another, making use of the rotation matrix with which the class was initialized. Inputs can be scalars or 1-dimensional numpy arrays. Parameters ---------- phi - V...
[ "Converts", "sky", "coordinates", "from", "one", "reference", "system", "to", "another", "making", "use", "of", "the", "rotation", "matrix", "with", "which", "the", "class", "was", "initialized", ".", "Inputs", "can", "be", "scalars", "or", "1", "-", "dimens...
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/astrometry/coordinates.py#L149-L170
[ "def", "transformSkyCoordinates", "(", "self", ",", "phi", ",", "theta", ")", ":", "r", "=", "ones_like", "(", "phi", ")", "x", ",", "y", ",", "z", "=", "sphericalToCartesian", "(", "r", ",", "phi", ",", "theta", ")", "xrot", ",", "yrot", ",", "zro...
ae972b0622a15f713ffae471f925eac25ccdae47
test
CoordinateTransformation.transformProperMotions
Converts proper motions from one reference system to another, using the prescriptions in section 1.5.3 of the Hipparcos Explanatory Volume 1 (equations 1.5.18, 1.5.19). Parameters ---------- phi - The longitude-like angle of the position of the source (radians). theta ...
pygaia/astrometry/coordinates.py
def transformProperMotions(self, phi, theta, muphistar, mutheta): """ Converts proper motions from one reference system to another, using the prescriptions in section 1.5.3 of the Hipparcos Explanatory Volume 1 (equations 1.5.18, 1.5.19). Parameters ---------- phi ...
def transformProperMotions(self, phi, theta, muphistar, mutheta): """ Converts proper motions from one reference system to another, using the prescriptions in section 1.5.3 of the Hipparcos Explanatory Volume 1 (equations 1.5.18, 1.5.19). Parameters ---------- phi ...
[ "Converts", "proper", "motions", "from", "one", "reference", "system", "to", "another", "using", "the", "prescriptions", "in", "section", "1", ".", "5", ".", "3", "of", "the", "Hipparcos", "Explanatory", "Volume", "1", "(", "equations", "1", ".", "5", ".",...
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/astrometry/coordinates.py#L172-L193
[ "def", "transformProperMotions", "(", "self", ",", "phi", ",", "theta", ",", "muphistar", ",", "mutheta", ")", ":", "c", ",", "s", "=", "self", ".", "_getJacobian", "(", "phi", ",", "theta", ")", "return", "c", "*", "muphistar", "+", "s", "*", "muthe...
ae972b0622a15f713ffae471f925eac25ccdae47
test
CoordinateTransformation.transformSkyCoordinateErrors
Converts the sky coordinate errors from one reference system to another, including the covariance term. Equations (1.5.4) and (1.5.20) from section 1.5 in the Hipparcos Explanatory Volume 1 are used. Parameters ---------- phi - The longitude-like angle of the position of the so...
pygaia/astrometry/coordinates.py
def transformSkyCoordinateErrors(self, phi, theta, sigPhiStar, sigTheta, rhoPhiTheta=0): """ Converts the sky coordinate errors from one reference system to another, including the covariance term. Equations (1.5.4) and (1.5.20) from section 1.5 in the Hipparcos Explanatory Volume 1 are used. ...
def transformSkyCoordinateErrors(self, phi, theta, sigPhiStar, sigTheta, rhoPhiTheta=0): """ Converts the sky coordinate errors from one reference system to another, including the covariance term. Equations (1.5.4) and (1.5.20) from section 1.5 in the Hipparcos Explanatory Volume 1 are used. ...
[ "Converts", "the", "sky", "coordinate", "errors", "from", "one", "reference", "system", "to", "another", "including", "the", "covariance", "term", ".", "Equations", "(", "1", ".", "5", ".", "4", ")", "and", "(", "1", ".", "5", ".", "20", ")", "from", ...
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/astrometry/coordinates.py#L195-L235
[ "def", "transformSkyCoordinateErrors", "(", "self", ",", "phi", ",", "theta", ",", "sigPhiStar", ",", "sigTheta", ",", "rhoPhiTheta", "=", "0", ")", ":", "if", "isscalar", "(", "rhoPhiTheta", ")", "and", "not", "isscalar", "(", "sigTheta", ")", ":", "rhoPh...
ae972b0622a15f713ffae471f925eac25ccdae47
test
CoordinateTransformation.transformProperMotionErrors
Converts the proper motion errors from one reference system to another, including the covariance term. Equations (1.5.4) and (1.5.20) from section 1.5 in the Hipparcos Explanatory Volume 1 are used. Parameters ---------- phi - The longitude-like angle of the position of the...
pygaia/astrometry/coordinates.py
def transformProperMotionErrors(self, phi, theta, sigMuPhiStar, sigMuTheta, rhoMuPhiMuTheta=0): """ Converts the proper motion errors from one reference system to another, including the covariance term. Equations (1.5.4) and (1.5.20) from section 1.5 in the Hipparcos Explanatory Volume 1 are use...
def transformProperMotionErrors(self, phi, theta, sigMuPhiStar, sigMuTheta, rhoMuPhiMuTheta=0): """ Converts the proper motion errors from one reference system to another, including the covariance term. Equations (1.5.4) and (1.5.20) from section 1.5 in the Hipparcos Explanatory Volume 1 are use...
[ "Converts", "the", "proper", "motion", "errors", "from", "one", "reference", "system", "to", "another", "including", "the", "covariance", "term", ".", "Equations", "(", "1", ".", "5", ".", "4", ")", "and", "(", "1", ".", "5", ".", "20", ")", "from", ...
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/astrometry/coordinates.py#L237-L266
[ "def", "transformProperMotionErrors", "(", "self", ",", "phi", ",", "theta", ",", "sigMuPhiStar", ",", "sigMuTheta", ",", "rhoMuPhiMuTheta", "=", "0", ")", ":", "return", "self", ".", "transformSkyCoordinateErrors", "(", "phi", ",", "theta", ",", "sigMuPhiStar",...
ae972b0622a15f713ffae471f925eac25ccdae47
test
CoordinateTransformation.transformCovarianceMatrix
Transform the astrometric covariance matrix to its representation in the new coordinate system. Parameters ---------- phi - The longitude-like angle of the position of the source (radians). theta - The latitude-like angle of the position of the source (radians). covma...
pygaia/astrometry/coordinates.py
def transformCovarianceMatrix(self, phi, theta, covmat): """ Transform the astrometric covariance matrix to its representation in the new coordinate system. Parameters ---------- phi - The longitude-like angle of the position of the source (radians). theta - T...
def transformCovarianceMatrix(self, phi, theta, covmat): """ Transform the astrometric covariance matrix to its representation in the new coordinate system. Parameters ---------- phi - The longitude-like angle of the position of the source (radians). theta - T...
[ "Transform", "the", "astrometric", "covariance", "matrix", "to", "its", "representation", "in", "the", "new", "coordinate", "system", "." ]
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/astrometry/coordinates.py#L268-L296
[ "def", "transformCovarianceMatrix", "(", "self", ",", "phi", ",", "theta", ",", "covmat", ")", ":", "c", ",", "s", "=", "self", ".", "_getJacobian", "(", "phi", ",", "theta", ")", "jacobian", "=", "identity", "(", "5", ")", "jacobian", "[", "0", "]",...
ae972b0622a15f713ffae471f925eac25ccdae47
test
CoordinateTransformation._getJacobian
Calculates the Jacobian for the transformation of the position errors and proper motion errors between coordinate systems. This Jacobian is also the rotation matrix for the transformation of proper motions. See section 1.5.3 of the Hipparcos Explanatory Volume 1 (equation 1.5.20). This matrix ha...
pygaia/astrometry/coordinates.py
def _getJacobian(self, phi, theta): """ Calculates the Jacobian for the transformation of the position errors and proper motion errors between coordinate systems. This Jacobian is also the rotation matrix for the transformation of proper motions. See section 1.5.3 of the Hipparcos Explan...
def _getJacobian(self, phi, theta): """ Calculates the Jacobian for the transformation of the position errors and proper motion errors between coordinate systems. This Jacobian is also the rotation matrix for the transformation of proper motions. See section 1.5.3 of the Hipparcos Explan...
[ "Calculates", "the", "Jacobian", "for", "the", "transformation", "of", "the", "position", "errors", "and", "proper", "motion", "errors", "between", "coordinate", "systems", ".", "This", "Jacobian", "is", "also", "the", "rotation", "matrix", "for", "the", "transf...
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/astrometry/coordinates.py#L298-L342
[ "def", "_getJacobian", "(", "self", ",", "phi", ",", "theta", ")", ":", "p", ",", "q", ",", "r", "=", "normalTriad", "(", "phi", ",", "theta", ")", "# zRot = z-axis of new coordinate system expressed in terms of old system", "zRot", "=", "self", ".", "rotationMa...
ae972b0622a15f713ffae471f925eac25ccdae47
test
EpochPropagation.propagate_astrometry
Propagate the position of a source from the reference epoch t0 to the new epoch t1. Parameters ---------- phi : float Longitude at reference epoch (radians). theta : float Latitude at reference epoch (radians). parallax : float Parallax at th...
pygaia/astrometry/coordinates.py
def propagate_astrometry(self, phi, theta, parallax, muphistar, mutheta, vrad, t0, t1): """ Propagate the position of a source from the reference epoch t0 to the new epoch t1. Parameters ---------- phi : float Longitude at reference epoch (radians). theta : ...
def propagate_astrometry(self, phi, theta, parallax, muphistar, mutheta, vrad, t0, t1): """ Propagate the position of a source from the reference epoch t0 to the new epoch t1. Parameters ---------- phi : float Longitude at reference epoch (radians). theta : ...
[ "Propagate", "the", "position", "of", "a", "source", "from", "the", "reference", "epoch", "t0", "to", "the", "new", "epoch", "t1", "." ]
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/astrometry/coordinates.py#L354-L411
[ "def", "propagate_astrometry", "(", "self", ",", "phi", ",", "theta", ",", "parallax", ",", "muphistar", ",", "mutheta", ",", "vrad", ",", "t0", ",", "t1", ")", ":", "t", "=", "t1", "-", "t0", "p0", ",", "q0", ",", "r0", "=", "normalTriad", "(", ...
ae972b0622a15f713ffae471f925eac25ccdae47
test
EpochPropagation.propagate_pos
Propagate the position of a source from the reference epoch t0 to the new epoch t1. Parameters ---------- phi : float Longitude at reference epoch (radians). theta : float Latitude at reference epoch (radians). parallax : float Parallax at th...
pygaia/astrometry/coordinates.py
def propagate_pos(self, phi, theta, parallax, muphistar, mutheta, vrad, t0, t1): """ Propagate the position of a source from the reference epoch t0 to the new epoch t1. Parameters ---------- phi : float Longitude at reference epoch (radians). theta : float ...
def propagate_pos(self, phi, theta, parallax, muphistar, mutheta, vrad, t0, t1): """ Propagate the position of a source from the reference epoch t0 to the new epoch t1. Parameters ---------- phi : float Longitude at reference epoch (radians). theta : float ...
[ "Propagate", "the", "position", "of", "a", "source", "from", "the", "reference", "epoch", "t0", "to", "the", "new", "epoch", "t1", "." ]
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/astrometry/coordinates.py#L413-L443
[ "def", "propagate_pos", "(", "self", ",", "phi", ",", "theta", ",", "parallax", ",", "muphistar", ",", "mutheta", ",", "vrad", ",", "t0", ",", "t1", ")", ":", "phi1", ",", "theta1", ",", "parallax1", ",", "muphistar1", ",", "mutheta1", ",", "vrad1", ...
ae972b0622a15f713ffae471f925eac25ccdae47
test
EpochPropagation.propagate_astrometry_and_covariance_matrix
Propagate the covariance matrix of the astrometric parameters and radial proper motion of a source from epoch t0 to epoch t1. Code based on the Hipparcos Fortran implementation by Lennart Lindegren. Parameters ---------- a0 : array_like 6-element vector: (phi, thet...
pygaia/astrometry/coordinates.py
def propagate_astrometry_and_covariance_matrix(self, a0, c0, t0, t1): """ Propagate the covariance matrix of the astrometric parameters and radial proper motion of a source from epoch t0 to epoch t1. Code based on the Hipparcos Fortran implementation by Lennart Lindegren. Param...
def propagate_astrometry_and_covariance_matrix(self, a0, c0, t0, t1): """ Propagate the covariance matrix of the astrometric parameters and radial proper motion of a source from epoch t0 to epoch t1. Code based on the Hipparcos Fortran implementation by Lennart Lindegren. Param...
[ "Propagate", "the", "covariance", "matrix", "of", "the", "astrometric", "parameters", "and", "radial", "proper", "motion", "of", "a", "source", "from", "epoch", "t0", "to", "epoch", "t1", "." ]
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/astrometry/coordinates.py#L445-L599
[ "def", "propagate_astrometry_and_covariance_matrix", "(", "self", ",", "a0", ",", "c0", ",", "t0", ",", "t1", ")", ":", "zero", ",", "one", ",", "two", ",", "three", "=", "0", ",", "1", ",", "2", ",", "3", "tau", "=", "t1", "-", "t0", "# Calculate ...
ae972b0622a15f713ffae471f925eac25ccdae47
test
makePlot
Make the plot with parallax horizons. The plot shows V-band magnitude vs distance for a number of spectral types and over the range 5.7<G<20. In addition a set of crudely drawn contours show the points where 0.1, 1, and 10 per cent relative parallax accracy are reached. Parameters ---------- args - Comman...
examples/radialVelocityHorizons.py
def makePlot(args): """ Make the plot with parallax horizons. The plot shows V-band magnitude vs distance for a number of spectral types and over the range 5.7<G<20. In addition a set of crudely drawn contours show the points where 0.1, 1, and 10 per cent relative parallax accracy are reached. Parameters -...
def makePlot(args): """ Make the plot with parallax horizons. The plot shows V-band magnitude vs distance for a number of spectral types and over the range 5.7<G<20. In addition a set of crudely drawn contours show the points where 0.1, 1, and 10 per cent relative parallax accracy are reached. Parameters -...
[ "Make", "the", "plot", "with", "parallax", "horizons", ".", "The", "plot", "shows", "V", "-", "band", "magnitude", "vs", "distance", "for", "a", "number", "of", "spectral", "types", "and", "over", "the", "range", "5", ".", "7<G<20", ".", "In", "addition"...
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/examples/radialVelocityHorizons.py#L35-L129
[ "def", "makePlot", "(", "args", ")", ":", "distances", "=", "10.0", "**", "np", ".", "linspace", "(", "1", ",", "6", ",", "10001", ")", "spts", "=", "[", "'B0V'", ",", "'A0V'", ",", "'F0V'", ",", "'G0V'", ",", "'K0V'", ",", "'K4V'", ",", "'K1III'...
ae972b0622a15f713ffae471f925eac25ccdae47
test
errorScalingFactor
Look up the numerical factors to apply to the sky averaged parallax error in order to obtain error values for a given astrometric parameter, taking the Ecliptic latitude and the number of transits into account. Parameters ---------- observable - Name of astrometric observable (one of: alphaStar, delta, para...
pygaia/errors/astrometric.py
def errorScalingFactor(observable, beta): """ Look up the numerical factors to apply to the sky averaged parallax error in order to obtain error values for a given astrometric parameter, taking the Ecliptic latitude and the number of transits into account. Parameters ---------- observable - Name of astr...
def errorScalingFactor(observable, beta): """ Look up the numerical factors to apply to the sky averaged parallax error in order to obtain error values for a given astrometric parameter, taking the Ecliptic latitude and the number of transits into account. Parameters ---------- observable - Name of astr...
[ "Look", "up", "the", "numerical", "factors", "to", "apply", "to", "the", "sky", "averaged", "parallax", "error", "in", "order", "to", "obtain", "error", "values", "for", "a", "given", "astrometric", "parameter", "taking", "the", "Ecliptic", "latitude", "and", ...
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/errors/astrometric.py#L28-L54
[ "def", "errorScalingFactor", "(", "observable", ",", "beta", ")", ":", "if", "isscalar", "(", "beta", ")", ":", "index", "=", "int", "(", "floor", "(", "abs", "(", "sin", "(", "beta", ")", ")", "*", "_numStepsSinBeta", ")", ")", "if", "index", "==", ...
ae972b0622a15f713ffae471f925eac25ccdae47
test
parallaxErrorSkyAvg
Calculate the sky averaged parallax error from G and (V-I). Parameters ---------- G - Value(s) of G-band magnitude. vmini - Value(s) of (V-I) colour. Keywords -------- extension - Add this amount of years to the mission lifetime and scale the errors accordingly. Returns ------- The paralla...
pygaia/errors/astrometric.py
def parallaxErrorSkyAvg(G, vmini, extension=0.0): """ Calculate the sky averaged parallax error from G and (V-I). Parameters ---------- G - Value(s) of G-band magnitude. vmini - Value(s) of (V-I) colour. Keywords -------- extension - Add this amount of years to the mission lifetime and scale t...
def parallaxErrorSkyAvg(G, vmini, extension=0.0): """ Calculate the sky averaged parallax error from G and (V-I). Parameters ---------- G - Value(s) of G-band magnitude. vmini - Value(s) of (V-I) colour. Keywords -------- extension - Add this amount of years to the mission lifetime and scale t...
[ "Calculate", "the", "sky", "averaged", "parallax", "error", "from", "G", "and", "(", "V", "-", "I", ")", "." ]
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/errors/astrometric.py#L75-L97
[ "def", "parallaxErrorSkyAvg", "(", "G", ",", "vmini", ",", "extension", "=", "0.0", ")", ":", "factor", "=", "errorScalingMissionLength", "(", "extension", ",", "-", "0.5", ")", "z", "=", "calcZ", "(", "G", ")", "return", "sqrt", "(", "-", "1.631", "+"...
ae972b0622a15f713ffae471f925eac25ccdae47
test
parallaxMinError
Calculate the minimum parallax error from G and (V-I). This correspond to the sky regions with the smallest astrometric errors. At the bright end the parallax error is at least 14 muas due to the gating scheme. Parameters ---------- G - Value(s) of G-band magnitude. vmini - Value(s) of (V-I) colour. ...
pygaia/errors/astrometric.py
def parallaxMinError(G, vmini, extension=0.0): """ Calculate the minimum parallax error from G and (V-I). This correspond to the sky regions with the smallest astrometric errors. At the bright end the parallax error is at least 14 muas due to the gating scheme. Parameters ---------- G - Value(s) of...
def parallaxMinError(G, vmini, extension=0.0): """ Calculate the minimum parallax error from G and (V-I). This correspond to the sky regions with the smallest astrometric errors. At the bright end the parallax error is at least 14 muas due to the gating scheme. Parameters ---------- G - Value(s) of...
[ "Calculate", "the", "minimum", "parallax", "error", "from", "G", "and", "(", "V", "-", "I", ")", ".", "This", "correspond", "to", "the", "sky", "regions", "with", "the", "smallest", "astrometric", "errors", ".", "At", "the", "bright", "end", "the", "para...
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/errors/astrometric.py#L99-L121
[ "def", "parallaxMinError", "(", "G", ",", "vmini", ",", "extension", "=", "0.0", ")", ":", "return", "_astrometricErrorFactors", "[", "\"parallax\"", "]", ".", "min", "(", ")", "*", "parallaxErrorSkyAvg", "(", "G", ",", "vmini", ",", "extension", "=", "ext...
ae972b0622a15f713ffae471f925eac25ccdae47
test
parallaxMaxError
Calculate the maximum parallax error from G and (V-I). This correspond to the sky regions with the largest astrometric errors. At the bright end the parallax error is at least 14 muas due to the gating scheme. Parameters ---------- G - Value(s) of G-band magnitude. vmini - Value(s) of (V-I) colour. ...
pygaia/errors/astrometric.py
def parallaxMaxError(G, vmini, extension=0.0): """ Calculate the maximum parallax error from G and (V-I). This correspond to the sky regions with the largest astrometric errors. At the bright end the parallax error is at least 14 muas due to the gating scheme. Parameters ---------- G - Value(s) of ...
def parallaxMaxError(G, vmini, extension=0.0): """ Calculate the maximum parallax error from G and (V-I). This correspond to the sky regions with the largest astrometric errors. At the bright end the parallax error is at least 14 muas due to the gating scheme. Parameters ---------- G - Value(s) of ...
[ "Calculate", "the", "maximum", "parallax", "error", "from", "G", "and", "(", "V", "-", "I", ")", ".", "This", "correspond", "to", "the", "sky", "regions", "with", "the", "largest", "astrometric", "errors", ".", "At", "the", "bright", "end", "the", "paral...
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/errors/astrometric.py#L123-L148
[ "def", "parallaxMaxError", "(", "G", ",", "vmini", ",", "extension", "=", "0.0", ")", ":", "errors", "=", "_astrometricErrorFactors", "[", "\"parallax\"", "]", ".", "max", "(", ")", "*", "parallaxErrorSkyAvg", "(", "G", ",", "vmini", ",", "extension", "=",...
ae972b0622a15f713ffae471f925eac25ccdae47
test
parallaxErrorSkyAvgAltStartGate
Calculate the sky averaged parallax error from G and (V-I). In this case assume gating starts at G=13.3 (to simulate bright star worst performance) Parameters ---------- G - Value(s) of G-band magnitude. vmini - Value(s) of (V-I) colour. Keywords -------- extension - Add this amount of years to ...
pygaia/errors/astrometric.py
def parallaxErrorSkyAvgAltStartGate(G, vmini, extension=0.0): """ Calculate the sky averaged parallax error from G and (V-I). In this case assume gating starts at G=13.3 (to simulate bright star worst performance) Parameters ---------- G - Value(s) of G-band magnitude. vmini - Value(s) of (V-I) colo...
def parallaxErrorSkyAvgAltStartGate(G, vmini, extension=0.0): """ Calculate the sky averaged parallax error from G and (V-I). In this case assume gating starts at G=13.3 (to simulate bright star worst performance) Parameters ---------- G - Value(s) of G-band magnitude. vmini - Value(s) of (V-I) colo...
[ "Calculate", "the", "sky", "averaged", "parallax", "error", "from", "G", "and", "(", "V", "-", "I", ")", ".", "In", "this", "case", "assume", "gating", "starts", "at", "G", "=", "13", ".", "3", "(", "to", "simulate", "bright", "star", "worst", "perfo...
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/errors/astrometric.py#L178-L201
[ "def", "parallaxErrorSkyAvgAltStartGate", "(", "G", ",", "vmini", ",", "extension", "=", "0.0", ")", ":", "factor", "=", "errorScalingMissionLength", "(", "extension", ",", "-", "0.5", ")", "z", "=", "calcZAltStartGate", "(", "G", ")", "return", "sqrt", "(",...
ae972b0622a15f713ffae471f925eac25ccdae47
test
positionErrorSkyAvg
Calculate the sky averaged position errors from G and (V-I). NOTE! THE ERRORS ARE FOR SKY POSITIONS IN THE ICRS (I.E., RIGHT ASCENSION, DECLINATION). MAKE SURE YOUR SIMULATED ASTROMETRY IS ALSO ON THE ICRS. Parameters ---------- G - Value(s) of G-band magnitude. vmini - Value(s) of (V-I) colour. K...
pygaia/errors/astrometric.py
def positionErrorSkyAvg(G, vmini, extension=0.0): """ Calculate the sky averaged position errors from G and (V-I). NOTE! THE ERRORS ARE FOR SKY POSITIONS IN THE ICRS (I.E., RIGHT ASCENSION, DECLINATION). MAKE SURE YOUR SIMULATED ASTROMETRY IS ALSO ON THE ICRS. Parameters ---------- G - Value(s) of ...
def positionErrorSkyAvg(G, vmini, extension=0.0): """ Calculate the sky averaged position errors from G and (V-I). NOTE! THE ERRORS ARE FOR SKY POSITIONS IN THE ICRS (I.E., RIGHT ASCENSION, DECLINATION). MAKE SURE YOUR SIMULATED ASTROMETRY IS ALSO ON THE ICRS. Parameters ---------- G - Value(s) of ...
[ "Calculate", "the", "sky", "averaged", "position", "errors", "from", "G", "and", "(", "V", "-", "I", ")", "." ]
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/errors/astrometric.py#L203-L228
[ "def", "positionErrorSkyAvg", "(", "G", ",", "vmini", ",", "extension", "=", "0.0", ")", ":", "parallaxError", "=", "parallaxErrorSkyAvg", "(", "G", ",", "vmini", ",", "extension", "=", "extension", ")", "return", "_scalingForPositions", "[", "'AlphaStar'", "]...
ae972b0622a15f713ffae471f925eac25ccdae47
test
positionMinError
Calculate the minimum position errors from G and (V-I). These correspond to the sky regions with the smallest astrometric errors. NOTE! THE ERRORS ARE FOR SKY POSITIONS IN THE ICRS (I.E., RIGHT ASCENSION, DECLINATION). MAKE SURE YOUR SIMULATED ASTROMETRY IS ALSO ON THE ICRS. Parameters ---------- G -...
pygaia/errors/astrometric.py
def positionMinError(G, vmini, extension=0.0): """ Calculate the minimum position errors from G and (V-I). These correspond to the sky regions with the smallest astrometric errors. NOTE! THE ERRORS ARE FOR SKY POSITIONS IN THE ICRS (I.E., RIGHT ASCENSION, DECLINATION). MAKE SURE YOUR SIMULATED ASTROMETRY IS ...
def positionMinError(G, vmini, extension=0.0): """ Calculate the minimum position errors from G and (V-I). These correspond to the sky regions with the smallest astrometric errors. NOTE! THE ERRORS ARE FOR SKY POSITIONS IN THE ICRS (I.E., RIGHT ASCENSION, DECLINATION). MAKE SURE YOUR SIMULATED ASTROMETRY IS ...
[ "Calculate", "the", "minimum", "position", "errors", "from", "G", "and", "(", "V", "-", "I", ")", ".", "These", "correspond", "to", "the", "sky", "regions", "with", "the", "smallest", "astrometric", "errors", "." ]
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/errors/astrometric.py#L230-L256
[ "def", "positionMinError", "(", "G", ",", "vmini", ",", "extension", "=", "0.0", ")", ":", "parallaxError", "=", "parallaxErrorSkyAvg", "(", "G", ",", "vmini", ",", "extension", "=", "extension", ")", "return", "_astrometricErrorFactors", "[", "'alphaStar'", "...
ae972b0622a15f713ffae471f925eac25ccdae47
test
positionMaxError
Calculate the maximum position errors from G and (V-I). These correspond to the sky regions with the largest astrometric errors. NOTE! THE ERRORS ARE FOR SKY POSITIONS IN THE ICRS (I.E., RIGHT ASCENSION, DECLINATION). MAKE SURE YOUR SIMULATED ASTROMETRY IS ALSO ON THE ICRS. Parameters ---------- G - ...
pygaia/errors/astrometric.py
def positionMaxError(G, vmini, extension=0.0): """ Calculate the maximum position errors from G and (V-I). These correspond to the sky regions with the largest astrometric errors. NOTE! THE ERRORS ARE FOR SKY POSITIONS IN THE ICRS (I.E., RIGHT ASCENSION, DECLINATION). MAKE SURE YOUR SIMULATED ASTROMETRY IS A...
def positionMaxError(G, vmini, extension=0.0): """ Calculate the maximum position errors from G and (V-I). These correspond to the sky regions with the largest astrometric errors. NOTE! THE ERRORS ARE FOR SKY POSITIONS IN THE ICRS (I.E., RIGHT ASCENSION, DECLINATION). MAKE SURE YOUR SIMULATED ASTROMETRY IS A...
[ "Calculate", "the", "maximum", "position", "errors", "from", "G", "and", "(", "V", "-", "I", ")", ".", "These", "correspond", "to", "the", "sky", "regions", "with", "the", "largest", "astrometric", "errors", "." ]
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/errors/astrometric.py#L258-L284
[ "def", "positionMaxError", "(", "G", ",", "vmini", ",", "extension", "=", "0.0", ")", ":", "parallaxError", "=", "parallaxErrorSkyAvg", "(", "G", ",", "vmini", ",", "extension", ")", "return", "_astrometricErrorFactors", "[", "'alphaStar'", "]", ".", "max", ...
ae972b0622a15f713ffae471f925eac25ccdae47
test
positionError
Calculate the position errors from G and (V-I) and the Ecliptic latitude beta of the source. NOTE! THE ERRORS ARE FOR SKY POSITIONS IN THE ICRS (I.E., RIGHT ASCENSION, DECLINATION). MAKE SURE YOUR SIMULATED ASTROMETRY IS ALSO ON THE ICRS. Parameters ---------- G - Value(s) of G-band magnitude. vmini ...
pygaia/errors/astrometric.py
def positionError(G, vmini, beta, extension=0.0): """ Calculate the position errors from G and (V-I) and the Ecliptic latitude beta of the source. NOTE! THE ERRORS ARE FOR SKY POSITIONS IN THE ICRS (I.E., RIGHT ASCENSION, DECLINATION). MAKE SURE YOUR SIMULATED ASTROMETRY IS ALSO ON THE ICRS. Parameters --...
def positionError(G, vmini, beta, extension=0.0): """ Calculate the position errors from G and (V-I) and the Ecliptic latitude beta of the source. NOTE! THE ERRORS ARE FOR SKY POSITIONS IN THE ICRS (I.E., RIGHT ASCENSION, DECLINATION). MAKE SURE YOUR SIMULATED ASTROMETRY IS ALSO ON THE ICRS. Parameters --...
[ "Calculate", "the", "position", "errors", "from", "G", "and", "(", "V", "-", "I", ")", "and", "the", "Ecliptic", "latitude", "beta", "of", "the", "source", "." ]
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/errors/astrometric.py#L286-L312
[ "def", "positionError", "(", "G", ",", "vmini", ",", "beta", ",", "extension", "=", "0.0", ")", ":", "parallaxError", "=", "parallaxErrorSkyAvg", "(", "G", ",", "vmini", ",", "extension", "=", "extension", ")", "return", "errorScalingFactor", "(", "'alphaSta...
ae972b0622a15f713ffae471f925eac25ccdae47
test
properMotionMinError
Calculate the minimum proper motion errors from G and (V-I). These correspond to the sky regions with the smallest astrometric errors. NOTE! THE ERRORS ARE FOR PROPER MOTIONS IN THE ICRS (I.E., RIGHT ASCENSION, DECLINATION). MAKE SURE YOUR SIMULATED ASTROMETRY IS ALSO ON THE ICRS. Parameters ---------- G...
pygaia/errors/astrometric.py
def properMotionMinError(G, vmini, extension=0.0): """ Calculate the minimum proper motion errors from G and (V-I). These correspond to the sky regions with the smallest astrometric errors. NOTE! THE ERRORS ARE FOR PROPER MOTIONS IN THE ICRS (I.E., RIGHT ASCENSION, DECLINATION). MAKE SURE YOUR SIMULATED ASTR...
def properMotionMinError(G, vmini, extension=0.0): """ Calculate the minimum proper motion errors from G and (V-I). These correspond to the sky regions with the smallest astrometric errors. NOTE! THE ERRORS ARE FOR PROPER MOTIONS IN THE ICRS (I.E., RIGHT ASCENSION, DECLINATION). MAKE SURE YOUR SIMULATED ASTR...
[ "Calculate", "the", "minimum", "proper", "motion", "errors", "from", "G", "and", "(", "V", "-", "I", ")", ".", "These", "correspond", "to", "the", "sky", "regions", "with", "the", "smallest", "astrometric", "errors", "." ]
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/errors/astrometric.py#L342-L369
[ "def", "properMotionMinError", "(", "G", ",", "vmini", ",", "extension", "=", "0.0", ")", ":", "factor", "=", "errorScalingMissionLength", "(", "extension", ",", "-", "1.5", ")", "parallaxError", "=", "parallaxErrorSkyAvg", "(", "G", ",", "vmini", ")", "*", ...
ae972b0622a15f713ffae471f925eac25ccdae47
test
properMotionMaxError
Calculate the maximum proper motion errors from G and (V-I). These correspond to the sky regions with the largest astrometric errors. NOTE! THE ERRORS ARE FOR PROPER MOTIONS IN THE ICRS (I.E., RIGHT ASCENSION, DECLINATION). MAKE SURE YOUR SIMULATED ASTROMETRY IS ALSO ON THE ICRS. Parameters ---------- G ...
pygaia/errors/astrometric.py
def properMotionMaxError(G, vmini, extension=0.0): """ Calculate the maximum proper motion errors from G and (V-I). These correspond to the sky regions with the largest astrometric errors. NOTE! THE ERRORS ARE FOR PROPER MOTIONS IN THE ICRS (I.E., RIGHT ASCENSION, DECLINATION). MAKE SURE YOUR SIMULATED ASTRO...
def properMotionMaxError(G, vmini, extension=0.0): """ Calculate the maximum proper motion errors from G and (V-I). These correspond to the sky regions with the largest astrometric errors. NOTE! THE ERRORS ARE FOR PROPER MOTIONS IN THE ICRS (I.E., RIGHT ASCENSION, DECLINATION). MAKE SURE YOUR SIMULATED ASTRO...
[ "Calculate", "the", "maximum", "proper", "motion", "errors", "from", "G", "and", "(", "V", "-", "I", ")", ".", "These", "correspond", "to", "the", "sky", "regions", "with", "the", "largest", "astrometric", "errors", "." ]
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/errors/astrometric.py#L371-L400
[ "def", "properMotionMaxError", "(", "G", ",", "vmini", ",", "extension", "=", "0.0", ")", ":", "factor", "=", "errorScalingMissionLength", "(", "extension", ",", "-", "1.5", ")", "parallaxError", "=", "parallaxErrorSkyAvg", "(", "G", ",", "vmini", ")", "*", ...
ae972b0622a15f713ffae471f925eac25ccdae47
test
properMotionError
Calculate the proper motion errors from G and (V-I) and the Ecliptic latitude beta of the source. NOTE! THE ERRORS ARE FOR PROPER MOTIONS IN THE ICRS (I.E., RIGHT ASCENSION, DECLINATION). MAKE SURE YOUR SIMULATED ASTROMETRY IS ALSO ON THE ICRS. Parameters ---------- G - Value(s) of G-band magnitude. ...
pygaia/errors/astrometric.py
def properMotionError(G, vmini, beta, extension=0.0): """ Calculate the proper motion errors from G and (V-I) and the Ecliptic latitude beta of the source. NOTE! THE ERRORS ARE FOR PROPER MOTIONS IN THE ICRS (I.E., RIGHT ASCENSION, DECLINATION). MAKE SURE YOUR SIMULATED ASTROMETRY IS ALSO ON THE ICRS. Param...
def properMotionError(G, vmini, beta, extension=0.0): """ Calculate the proper motion errors from G and (V-I) and the Ecliptic latitude beta of the source. NOTE! THE ERRORS ARE FOR PROPER MOTIONS IN THE ICRS (I.E., RIGHT ASCENSION, DECLINATION). MAKE SURE YOUR SIMULATED ASTROMETRY IS ALSO ON THE ICRS. Param...
[ "Calculate", "the", "proper", "motion", "errors", "from", "G", "and", "(", "V", "-", "I", ")", "and", "the", "Ecliptic", "latitude", "beta", "of", "the", "source", "." ]
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/errors/astrometric.py#L402-L429
[ "def", "properMotionError", "(", "G", ",", "vmini", ",", "beta", ",", "extension", "=", "0.0", ")", ":", "factor", "=", "errorScalingMissionLength", "(", "extension", ",", "-", "1.5", ")", "parallaxError", "=", "parallaxErrorSkyAvg", "(", "G", ",", "vmini", ...
ae972b0622a15f713ffae471f925eac25ccdae47
test
totalProperMotionErrorSkyAvg
Calculate the sky averaged total proper motion error from G and (V-I). This refers to the error on the length of the proper motion vector. NOTE! THE ERRORS ARE FOR PROPER MOTIONS IN THE ICRS (I.E., RIGHT ASCENSION, DECLINATION). MAKE SURE YOUR SIMULATED ASTROMETRY IS ALSO ON THE ICRS. Parameters ---------- ...
pygaia/errors/astrometric.py
def totalProperMotionErrorSkyAvg(G, vmini, extension=0.0): """ Calculate the sky averaged total proper motion error from G and (V-I). This refers to the error on the length of the proper motion vector. NOTE! THE ERRORS ARE FOR PROPER MOTIONS IN THE ICRS (I.E., RIGHT ASCENSION, DECLINATION). MAKE SURE YOUR SI...
def totalProperMotionErrorSkyAvg(G, vmini, extension=0.0): """ Calculate the sky averaged total proper motion error from G and (V-I). This refers to the error on the length of the proper motion vector. NOTE! THE ERRORS ARE FOR PROPER MOTIONS IN THE ICRS (I.E., RIGHT ASCENSION, DECLINATION). MAKE SURE YOUR SI...
[ "Calculate", "the", "sky", "averaged", "total", "proper", "motion", "error", "from", "G", "and", "(", "V", "-", "I", ")", ".", "This", "refers", "to", "the", "error", "on", "the", "length", "of", "the", "proper", "motion", "vector", "." ]
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/errors/astrometric.py#L431-L457
[ "def", "totalProperMotionErrorSkyAvg", "(", "G", ",", "vmini", ",", "extension", "=", "0.0", ")", ":", "factor", "=", "errorScalingMissionLength", "(", "extension", ",", "-", "1.5", ")", "parallaxError", "=", "parallaxErrorSkyAvg", "(", "G", ",", "vmini", ")",...
ae972b0622a15f713ffae471f925eac25ccdae47
test
makePlot
Make the plot with parallax horizons. The plot shows V-band magnitude vs distance for a number of spectral types and over the range 5.7<G<20. In addition a set of crudely drawn contours show the points where 0.1, 1, and 10 per cent relative parallax accracy are reached. Parameters ---------- args - Comman...
examples/parallaxHorizons.py
def makePlot(args): """ Make the plot with parallax horizons. The plot shows V-band magnitude vs distance for a number of spectral types and over the range 5.7<G<20. In addition a set of crudely drawn contours show the points where 0.1, 1, and 10 per cent relative parallax accracy are reached. Parameters -...
def makePlot(args): """ Make the plot with parallax horizons. The plot shows V-band magnitude vs distance for a number of spectral types and over the range 5.7<G<20. In addition a set of crudely drawn contours show the points where 0.1, 1, and 10 per cent relative parallax accracy are reached. Parameters -...
[ "Make", "the", "plot", "with", "parallax", "horizons", ".", "The", "plot", "shows", "V", "-", "band", "magnitude", "vs", "distance", "for", "a", "number", "of", "spectral", "types", "and", "over", "the", "range", "5", ".", "7<G<20", ".", "In", "addition"...
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/examples/parallaxHorizons.py#L35-L136
[ "def", "makePlot", "(", "args", ")", ":", "distances", "=", "10.0", "**", "np", ".", "linspace", "(", "1", ",", "6", ",", "10001", ")", "av", "=", "args", "[", "'extinction'", "]", "ai", "=", "0.479", "*", "av", "#Cardelli et al R=3.1", "spts", "=", ...
ae972b0622a15f713ffae471f925eac25ccdae47
test
vminiFromSpt
Obtain (V-I) for the input spectral type. Parameters ---------- spt - String representing the spectral type of the star. Returns ------- The value of (V-I).
pygaia/photometry/utils.py
def vminiFromSpt(spt): """ Obtain (V-I) for the input spectral type. Parameters ---------- spt - String representing the spectral type of the star. Returns ------- The value of (V-I). """ if spt in _sptToVminiVabsDictionary: return _sptToVminiVabsDictionary[spt][0] else: message="U...
def vminiFromSpt(spt): """ Obtain (V-I) for the input spectral type. Parameters ---------- spt - String representing the spectral type of the star. Returns ------- The value of (V-I). """ if spt in _sptToVminiVabsDictionary: return _sptToVminiVabsDictionary[spt][0] else: message="U...
[ "Obtain", "(", "V", "-", "I", ")", "for", "the", "input", "spectral", "type", "." ]
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/photometry/utils.py#L12-L32
[ "def", "vminiFromSpt", "(", "spt", ")", ":", "if", "spt", "in", "_sptToVminiVabsDictionary", ":", "return", "_sptToVminiVabsDictionary", "[", "spt", "]", "[", "0", "]", "else", ":", "message", "=", "\"Unknown spectral type. Allowed values are: \"", "for", "key", "...
ae972b0622a15f713ffae471f925eac25ccdae47
test
vabsFromSpt
Obtain M_V (absolute magnitude in V-band) for the input spectral type. Parameters ---------- spt - String representing the spectral type of the star. Returns ------- The value of M_V.
pygaia/photometry/utils.py
def vabsFromSpt(spt): """ Obtain M_V (absolute magnitude in V-band) for the input spectral type. Parameters ---------- spt - String representing the spectral type of the star. Returns ------- The value of M_V. """ if spt in _sptToVminiVabsDictionary: return _sptToVminiVabsDictionary[spt]...
def vabsFromSpt(spt): """ Obtain M_V (absolute magnitude in V-band) for the input spectral type. Parameters ---------- spt - String representing the spectral type of the star. Returns ------- The value of M_V. """ if spt in _sptToVminiVabsDictionary: return _sptToVminiVabsDictionary[spt]...
[ "Obtain", "M_V", "(", "absolute", "magnitude", "in", "V", "-", "band", ")", "for", "the", "input", "spectral", "type", "." ]
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/photometry/utils.py#L34-L54
[ "def", "vabsFromSpt", "(", "spt", ")", ":", "if", "spt", "in", "_sptToVminiVabsDictionary", ":", "return", "_sptToVminiVabsDictionary", "[", "spt", "]", "[", "1", "]", "else", ":", "message", "=", "\"Unknown spectral type. Allowed values are: \"", "for", "key", "i...
ae972b0622a15f713ffae471f925eac25ccdae47
test
gabsFromSpt
Obtain M_G (absolute magnitude in G-band) for the input spectral type. Parameters ---------- spt - String representing the spectral type of the star. Returns ------- The value of M_G.
pygaia/photometry/utils.py
def gabsFromSpt(spt): """ Obtain M_G (absolute magnitude in G-band) for the input spectral type. Parameters ---------- spt - String representing the spectral type of the star. Returns ------- The value of M_G. """ if spt in _sptToVminiVabsDictionary: return vabsFromSpt(spt) + gminvFromVm...
def gabsFromSpt(spt): """ Obtain M_G (absolute magnitude in G-band) for the input spectral type. Parameters ---------- spt - String representing the spectral type of the star. Returns ------- The value of M_G. """ if spt in _sptToVminiVabsDictionary: return vabsFromSpt(spt) + gminvFromVm...
[ "Obtain", "M_G", "(", "absolute", "magnitude", "in", "G", "-", "band", ")", "for", "the", "input", "spectral", "type", "." ]
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/pygaia/photometry/utils.py#L56-L76
[ "def", "gabsFromSpt", "(", "spt", ")", ":", "if", "spt", "in", "_sptToVminiVabsDictionary", ":", "return", "vabsFromSpt", "(", "spt", ")", "+", "gminvFromVmini", "(", "vminiFromSpt", "(", "spt", ")", ")", "else", ":", "message", "=", "\"Unknown spectral type. ...
ae972b0622a15f713ffae471f925eac25ccdae47
test
makePlot
Plot relative parallax errors as a function of distance for stars of a given spectral type. Parameters ---------- args - command line arguments
examples/relativeParallaxErrorsVsDistance.py
def makePlot(pdf=False, png=False): """ Plot relative parallax errors as a function of distance for stars of a given spectral type. Parameters ---------- args - command line arguments """ logdistancekpc = np.linspace(-1,np.log10(20.0),100) sptVabsAndVmini=OrderedDict([('K0V',(5.58,0.87)), ('G5V',(4.78...
def makePlot(pdf=False, png=False): """ Plot relative parallax errors as a function of distance for stars of a given spectral type. Parameters ---------- args - command line arguments """ logdistancekpc = np.linspace(-1,np.log10(20.0),100) sptVabsAndVmini=OrderedDict([('K0V',(5.58,0.87)), ('G5V',(4.78...
[ "Plot", "relative", "parallax", "errors", "as", "a", "function", "of", "distance", "for", "stars", "of", "a", "given", "spectral", "type", "." ]
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/examples/relativeParallaxErrorsVsDistance.py#L29-L70
[ "def", "makePlot", "(", "pdf", "=", "False", ",", "png", "=", "False", ")", ":", "logdistancekpc", "=", "np", ".", "linspace", "(", "-", "1", ",", "np", ".", "log10", "(", "20.0", ")", ",", "100", ")", "sptVabsAndVmini", "=", "OrderedDict", "(", "[...
ae972b0622a15f713ffae471f925eac25ccdae47
test
makePlot
Make the plot with radial velocity performance predictions. :argument args: command line arguments
examples/plotRadialVelocityErrorsSkyAvg.py
def makePlot(args): """ Make the plot with radial velocity performance predictions. :argument args: command line arguments """ gRvs=np.linspace(5.7,16.1,101) spts=['B0V', 'B5V', 'A0V', 'A5V', 'F0V', 'G0V', 'G5V', 'K0V', 'K1IIIMP', 'K4V', 'K1III'] fig=plt.figure(figsize=(10,6.5)) deltaHue = 24...
def makePlot(args): """ Make the plot with radial velocity performance predictions. :argument args: command line arguments """ gRvs=np.linspace(5.7,16.1,101) spts=['B0V', 'B5V', 'A0V', 'A5V', 'F0V', 'G0V', 'G5V', 'K0V', 'K1IIIMP', 'K4V', 'K1III'] fig=plt.figure(figsize=(10,6.5)) deltaHue = 24...
[ "Make", "the", "plot", "with", "radial", "velocity", "performance", "predictions", "." ]
agabrown/PyGaia
python
https://github.com/agabrown/PyGaia/blob/ae972b0622a15f713ffae471f925eac25ccdae47/examples/plotRadialVelocityErrorsSkyAvg.py#L32-L71
[ "def", "makePlot", "(", "args", ")", ":", "gRvs", "=", "np", ".", "linspace", "(", "5.7", ",", "16.1", ",", "101", ")", "spts", "=", "[", "'B0V'", ",", "'B5V'", ",", "'A0V'", ",", "'A5V'", ",", "'F0V'", ",", "'G0V'", ",", "'G5V'", ",", "'K0V'", ...
ae972b0622a15f713ffae471f925eac25ccdae47
test
either
A utility function for selecting the first non-null query. Parameters: funcs: One or more functions Returns: A function that, when called with a :class:`Node`, will pass the input to each `func`, and return the first non-Falsey result. Examples: >>> s = Soupy("<p>hi</...
soupy.py
def either(*funcs): """ A utility function for selecting the first non-null query. Parameters: funcs: One or more functions Returns: A function that, when called with a :class:`Node`, will pass the input to each `func`, and return the first non-Falsey result. Examples...
def either(*funcs): """ A utility function for selecting the first non-null query. Parameters: funcs: One or more functions Returns: A function that, when called with a :class:`Node`, will pass the input to each `func`, and return the first non-Falsey result. Examples...
[ "A", "utility", "function", "for", "selecting", "the", "first", "non", "-", "null", "query", "." ]
ChrisBeaumont/soupy
python
https://github.com/ChrisBeaumont/soupy/blob/795f2f61f711f574d5218fc8a3375d02bda1104f/soupy.py#L1264-L1291
[ "def", "either", "(", "*", "funcs", ")", ":", "def", "either", "(", "val", ")", ":", "for", "func", "in", "funcs", ":", "result", "=", "val", ".", "apply", "(", "func", ")", "if", "result", ":", "return", "result", "return", "Null", "(", ")", "re...
795f2f61f711f574d5218fc8a3375d02bda1104f
test
_helpful_failure
Decorator for eval_ that prints a helpful error message if an exception is generated in a Q expression
soupy.py
def _helpful_failure(method): """ Decorator for eval_ that prints a helpful error message if an exception is generated in a Q expression """ @wraps(method) def wrapper(self, val): try: return method(self, val) except: exc_cls, inst, tb = sys.exc_info() ...
def _helpful_failure(method): """ Decorator for eval_ that prints a helpful error message if an exception is generated in a Q expression """ @wraps(method) def wrapper(self, val): try: return method(self, val) except: exc_cls, inst, tb = sys.exc_info() ...
[ "Decorator", "for", "eval_", "that", "prints", "a", "helpful", "error", "message", "if", "an", "exception", "is", "generated", "in", "a", "Q", "expression" ]
ChrisBeaumont/soupy
python
https://github.com/ChrisBeaumont/soupy/blob/795f2f61f711f574d5218fc8a3375d02bda1104f/soupy.py#L1294-L1329
[ "def", "_helpful_failure", "(", "method", ")", ":", "@", "wraps", "(", "method", ")", "def", "wrapper", "(", "self", ",", "val", ")", ":", "try", ":", "return", "method", "(", "self", ",", "val", ")", "except", ":", "exc_cls", ",", "inst", ",", "tb...
795f2f61f711f574d5218fc8a3375d02bda1104f
test
_uniquote
Convert to unicode, and add quotes if initially a string
soupy.py
def _uniquote(value): """ Convert to unicode, and add quotes if initially a string """ if isinstance(value, six.binary_type): try: value = value.decode('utf-8') except UnicodeDecodeError: # Not utf-8. Show the repr value = six.text_type(_dequote(repr(value))) # ...
def _uniquote(value): """ Convert to unicode, and add quotes if initially a string """ if isinstance(value, six.binary_type): try: value = value.decode('utf-8') except UnicodeDecodeError: # Not utf-8. Show the repr value = six.text_type(_dequote(repr(value))) # ...
[ "Convert", "to", "unicode", "and", "add", "quotes", "if", "initially", "a", "string" ]
ChrisBeaumont/soupy
python
https://github.com/ChrisBeaumont/soupy/blob/795f2f61f711f574d5218fc8a3375d02bda1104f/soupy.py#L1583-L1597
[ "def", "_uniquote", "(", "value", ")", ":", "if", "isinstance", "(", "value", ",", "six", ".", "binary_type", ")", ":", "try", ":", "value", "=", "value", ".", "decode", "(", "'utf-8'", ")", "except", "UnicodeDecodeError", ":", "# Not utf-8. Show the repr", ...
795f2f61f711f574d5218fc8a3375d02bda1104f
test
Collection.each
Call `func` on each element in the collection. If multiple functions are provided, each item in the output will be a tuple of each func(item) in self. Returns a new Collection. Example: >>> col = Collection([Scalar(1), Scalar(2)]) >>> col.each(Q * 10) ...
soupy.py
def each(self, *funcs): """ Call `func` on each element in the collection. If multiple functions are provided, each item in the output will be a tuple of each func(item) in self. Returns a new Collection. Example: >>> col = Collection([Scalar(1), S...
def each(self, *funcs): """ Call `func` on each element in the collection. If multiple functions are provided, each item in the output will be a tuple of each func(item) in self. Returns a new Collection. Example: >>> col = Collection([Scalar(1), S...
[ "Call", "func", "on", "each", "element", "in", "the", "collection", "." ]
ChrisBeaumont/soupy
python
https://github.com/ChrisBeaumont/soupy/blob/795f2f61f711f574d5218fc8a3375d02bda1104f/soupy.py#L533-L559
[ "def", "each", "(", "self", ",", "*", "funcs", ")", ":", "funcs", "=", "list", "(", "map", "(", "_make_callable", ",", "funcs", ")", ")", "if", "len", "(", "funcs", ")", "==", "1", ":", "return", "Collection", "(", "map", "(", "funcs", "[", "0", ...
795f2f61f711f574d5218fc8a3375d02bda1104f
test
Collection.exclude
Return a new Collection excluding some items Parameters: func : function(Node) -> Scalar A function that, when called on each item in the collection, returns a boolean-like value. If no function is provided, then truthy items will be...
soupy.py
def exclude(self, func=None): """ Return a new Collection excluding some items Parameters: func : function(Node) -> Scalar A function that, when called on each item in the collection, returns a boolean-like value. If no function is p...
def exclude(self, func=None): """ Return a new Collection excluding some items Parameters: func : function(Node) -> Scalar A function that, when called on each item in the collection, returns a boolean-like value. If no function is p...
[ "Return", "a", "new", "Collection", "excluding", "some", "items" ]
ChrisBeaumont/soupy
python
https://github.com/ChrisBeaumont/soupy/blob/795f2f61f711f574d5218fc8a3375d02bda1104f/soupy.py#L561-L581
[ "def", "exclude", "(", "self", ",", "func", "=", "None", ")", ":", "func", "=", "_make_callable", "(", "func", ")", "inverse", "=", "lambda", "x", ":", "not", "func", "(", "x", ")", "return", "self", ".", "filter", "(", "inverse", ")" ]
795f2f61f711f574d5218fc8a3375d02bda1104f
test
Collection.filter
Return a new Collection with some items removed. Parameters: func : function(Node) -> Scalar A function that, when called on each item in the collection, returns a boolean-like value. If no function is provided, then false-y items wi...
soupy.py
def filter(self, func=None): """ Return a new Collection with some items removed. Parameters: func : function(Node) -> Scalar A function that, when called on each item in the collection, returns a boolean-like value. If no function i...
def filter(self, func=None): """ Return a new Collection with some items removed. Parameters: func : function(Node) -> Scalar A function that, when called on each item in the collection, returns a boolean-like value. If no function i...
[ "Return", "a", "new", "Collection", "with", "some", "items", "removed", "." ]
ChrisBeaumont/soupy
python
https://github.com/ChrisBeaumont/soupy/blob/795f2f61f711f574d5218fc8a3375d02bda1104f/soupy.py#L583-L606
[ "def", "filter", "(", "self", ",", "func", "=", "None", ")", ":", "func", "=", "_make_callable", "(", "func", ")", "return", "Collection", "(", "filter", "(", "func", ",", "self", ".", "_items", ")", ")" ]
795f2f61f711f574d5218fc8a3375d02bda1104f
test
Collection.takewhile
Return a new Collection with the last few items removed. Parameters: func : function(Node) -> Node Returns: A new Collection, discarding all items at and after the first item where bool(func(item)) == False Examples: node.find_all('tr').takew...
soupy.py
def takewhile(self, func=None): """ Return a new Collection with the last few items removed. Parameters: func : function(Node) -> Node Returns: A new Collection, discarding all items at and after the first item where bool(func(item)) == False ...
def takewhile(self, func=None): """ Return a new Collection with the last few items removed. Parameters: func : function(Node) -> Node Returns: A new Collection, discarding all items at and after the first item where bool(func(item)) == False ...
[ "Return", "a", "new", "Collection", "with", "the", "last", "few", "items", "removed", "." ]
ChrisBeaumont/soupy
python
https://github.com/ChrisBeaumont/soupy/blob/795f2f61f711f574d5218fc8a3375d02bda1104f/soupy.py#L608-L627
[ "def", "takewhile", "(", "self", ",", "func", "=", "None", ")", ":", "func", "=", "_make_callable", "(", "func", ")", "return", "Collection", "(", "takewhile", "(", "func", ",", "self", ".", "_items", ")", ")" ]
795f2f61f711f574d5218fc8a3375d02bda1104f
test
Collection.dropwhile
Return a new Collection with the first few items removed. Parameters: func : function(Node) -> Node Returns: A new Collection, discarding all items before the first item where bool(func(item)) == True
soupy.py
def dropwhile(self, func=None): """ Return a new Collection with the first few items removed. Parameters: func : function(Node) -> Node Returns: A new Collection, discarding all items before the first item where bool(func(item)) == True """...
def dropwhile(self, func=None): """ Return a new Collection with the first few items removed. Parameters: func : function(Node) -> Node Returns: A new Collection, discarding all items before the first item where bool(func(item)) == True """...
[ "Return", "a", "new", "Collection", "with", "the", "first", "few", "items", "removed", "." ]
ChrisBeaumont/soupy
python
https://github.com/ChrisBeaumont/soupy/blob/795f2f61f711f574d5218fc8a3375d02bda1104f/soupy.py#L629-L643
[ "def", "dropwhile", "(", "self", ",", "func", "=", "None", ")", ":", "func", "=", "_make_callable", "(", "func", ")", "return", "Collection", "(", "dropwhile", "(", "func", ",", "self", ".", "_items", ")", ")" ]
795f2f61f711f574d5218fc8a3375d02bda1104f
test
Collection.dump
Build a list of dicts, by calling :meth:`Node.dump` on each item. Each keyword provides a function that extracts a value from a Node. Examples: >>> c = Collection([Scalar(1), Scalar(2)]) >>> c.dump(x2=Q*2, m1=Q-1).val() [{'x2': 2, 'm1': 0}, {'x2': 4...
soupy.py
def dump(self, *args, **kwargs): """ Build a list of dicts, by calling :meth:`Node.dump` on each item. Each keyword provides a function that extracts a value from a Node. Examples: >>> c = Collection([Scalar(1), Scalar(2)]) >>> c.dump(x2=Q*2, m1...
def dump(self, *args, **kwargs): """ Build a list of dicts, by calling :meth:`Node.dump` on each item. Each keyword provides a function that extracts a value from a Node. Examples: >>> c = Collection([Scalar(1), Scalar(2)]) >>> c.dump(x2=Q*2, m1...
[ "Build", "a", "list", "of", "dicts", "by", "calling", ":", "meth", ":", "Node", ".", "dump", "on", "each", "item", "." ]
ChrisBeaumont/soupy
python
https://github.com/ChrisBeaumont/soupy/blob/795f2f61f711f574d5218fc8a3375d02bda1104f/soupy.py#L655-L669
[ "def", "dump", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "each", "(", "Q", ".", "dump", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
795f2f61f711f574d5218fc8a3375d02bda1104f
test
Collection.zip
Zip the items of this collection with one or more other sequences, and wrap the result. Unlike Python's zip, all sequences must be the same length. Parameters: others: One or more iterables or Collections Returns: A new collection. Examples: ...
soupy.py
def zip(self, *others): """ Zip the items of this collection with one or more other sequences, and wrap the result. Unlike Python's zip, all sequences must be the same length. Parameters: others: One or more iterables or Collections Returns: A...
def zip(self, *others): """ Zip the items of this collection with one or more other sequences, and wrap the result. Unlike Python's zip, all sequences must be the same length. Parameters: others: One or more iterables or Collections Returns: A...
[ "Zip", "the", "items", "of", "this", "collection", "with", "one", "or", "more", "other", "sequences", "and", "wrap", "the", "result", "." ]
ChrisBeaumont/soupy
python
https://github.com/ChrisBeaumont/soupy/blob/795f2f61f711f574d5218fc8a3375d02bda1104f/soupy.py#L680-L706
[ "def", "zip", "(", "self", ",", "*", "others", ")", ":", "args", "=", "[", "_unwrap", "(", "item", ")", "for", "item", "in", "(", "self", ",", ")", "+", "others", "]", "ct", "=", "self", ".", "count", "(", ")", "if", "not", "all", "(", "len",...
795f2f61f711f574d5218fc8a3375d02bda1104f
test
Collection.dictzip
Turn this collection into a Scalar(dict), by zipping keys and items. Parameters: keys: list or Collection of NavigableStrings The keys of the dictionary Examples: >>> c = Collection([Scalar(1), Scalar(2)]) >>> c.dictzip(['a', 'b']).val() == {'a': 1...
soupy.py
def dictzip(self, keys): """ Turn this collection into a Scalar(dict), by zipping keys and items. Parameters: keys: list or Collection of NavigableStrings The keys of the dictionary Examples: >>> c = Collection([Scalar(1), Scalar(2)]) ...
def dictzip(self, keys): """ Turn this collection into a Scalar(dict), by zipping keys and items. Parameters: keys: list or Collection of NavigableStrings The keys of the dictionary Examples: >>> c = Collection([Scalar(1), Scalar(2)]) ...
[ "Turn", "this", "collection", "into", "a", "Scalar", "(", "dict", ")", "by", "zipping", "keys", "and", "items", "." ]
ChrisBeaumont/soupy
python
https://github.com/ChrisBeaumont/soupy/blob/795f2f61f711f574d5218fc8a3375d02bda1104f/soupy.py#L708-L723
[ "def", "dictzip", "(", "self", ",", "keys", ")", ":", "return", "Scalar", "(", "dict", "(", "zip", "(", "_unwrap", "(", "keys", ")", ",", "self", ".", "val", "(", ")", ")", ")", ")" ]
795f2f61f711f574d5218fc8a3375d02bda1104f
test
Node.find
Find a single Node among this Node's descendants. Returns :class:`NullNode` if nothing matches. This inputs to this function follow the same semantics as BeautifulSoup. See http://bit.ly/bs4doc for more info. Examples: - node.find('a') # look for `a` tags - node.fi...
soupy.py
def find(self, *args, **kwargs): """ Find a single Node among this Node's descendants. Returns :class:`NullNode` if nothing matches. This inputs to this function follow the same semantics as BeautifulSoup. See http://bit.ly/bs4doc for more info. Examples: - n...
def find(self, *args, **kwargs): """ Find a single Node among this Node's descendants. Returns :class:`NullNode` if nothing matches. This inputs to this function follow the same semantics as BeautifulSoup. See http://bit.ly/bs4doc for more info. Examples: - n...
[ "Find", "a", "single", "Node", "among", "this", "Node", "s", "descendants", "." ]
ChrisBeaumont/soupy
python
https://github.com/ChrisBeaumont/soupy/blob/795f2f61f711f574d5218fc8a3375d02bda1104f/soupy.py#L999-L1016
[ "def", "find", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "op", "=", "operator", ".", "methodcaller", "(", "'find'", ",", "*", "args", ",", "*", "*", "kwargs", ")", "return", "self", ".", "_wrap_node", "(", "op", ")" ]
795f2f61f711f574d5218fc8a3375d02bda1104f
test
Node.find_next_sibling
Like :meth:`find`, but searches through :attr:`next_siblings`
soupy.py
def find_next_sibling(self, *args, **kwargs): """ Like :meth:`find`, but searches through :attr:`next_siblings` """ op = operator.methodcaller('find_next_sibling', *args, **kwargs) return self._wrap_node(op)
def find_next_sibling(self, *args, **kwargs): """ Like :meth:`find`, but searches through :attr:`next_siblings` """ op = operator.methodcaller('find_next_sibling', *args, **kwargs) return self._wrap_node(op)
[ "Like", ":", "meth", ":", "find", "but", "searches", "through", ":", "attr", ":", "next_siblings" ]
ChrisBeaumont/soupy
python
https://github.com/ChrisBeaumont/soupy/blob/795f2f61f711f574d5218fc8a3375d02bda1104f/soupy.py#L1018-L1023
[ "def", "find_next_sibling", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "op", "=", "operator", ".", "methodcaller", "(", "'find_next_sibling'", ",", "*", "args", ",", "*", "*", "kwargs", ")", "return", "self", ".", "_wrap_node", "...
795f2f61f711f574d5218fc8a3375d02bda1104f
test
Node.find_parent
Like :meth:`find`, but searches through :attr:`parents`
soupy.py
def find_parent(self, *args, **kwargs): """ Like :meth:`find`, but searches through :attr:`parents` """ op = operator.methodcaller('find_parent', *args, **kwargs) return self._wrap_node(op)
def find_parent(self, *args, **kwargs): """ Like :meth:`find`, but searches through :attr:`parents` """ op = operator.methodcaller('find_parent', *args, **kwargs) return self._wrap_node(op)
[ "Like", ":", "meth", ":", "find", "but", "searches", "through", ":", "attr", ":", "parents" ]
ChrisBeaumont/soupy
python
https://github.com/ChrisBeaumont/soupy/blob/795f2f61f711f574d5218fc8a3375d02bda1104f/soupy.py#L1025-L1030
[ "def", "find_parent", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "op", "=", "operator", ".", "methodcaller", "(", "'find_parent'", ",", "*", "args", ",", "*", "*", "kwargs", ")", "return", "self", ".", "_wrap_node", "(", "op", ...
795f2f61f711f574d5218fc8a3375d02bda1104f
test
Node.find_previous_sibling
Like :meth:`find`, but searches through :attr:`previous_siblings`
soupy.py
def find_previous_sibling(self, *args, **kwargs): """ Like :meth:`find`, but searches through :attr:`previous_siblings` """ op = operator.methodcaller('find_previous_sibling', *args, **kwargs) return self._wrap_node(op)
def find_previous_sibling(self, *args, **kwargs): """ Like :meth:`find`, but searches through :attr:`previous_siblings` """ op = operator.methodcaller('find_previous_sibling', *args, **kwargs) return self._wrap_node(op)
[ "Like", ":", "meth", ":", "find", "but", "searches", "through", ":", "attr", ":", "previous_siblings" ]
ChrisBeaumont/soupy
python
https://github.com/ChrisBeaumont/soupy/blob/795f2f61f711f574d5218fc8a3375d02bda1104f/soupy.py#L1032-L1037
[ "def", "find_previous_sibling", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "op", "=", "operator", ".", "methodcaller", "(", "'find_previous_sibling'", ",", "*", "args", ",", "*", "*", "kwargs", ")", "return", "self", ".", "_wrap_no...
795f2f61f711f574d5218fc8a3375d02bda1104f
test
Node.find_all
Like :meth:`find`, but selects all matches (not just the first one). Returns a :class:`Collection`. If no elements match, this returns a Collection with no items.
soupy.py
def find_all(self, *args, **kwargs): """ Like :meth:`find`, but selects all matches (not just the first one). Returns a :class:`Collection`. If no elements match, this returns a Collection with no items. """ op = operator.methodcaller('find_all', *args, **kwargs) ...
def find_all(self, *args, **kwargs): """ Like :meth:`find`, but selects all matches (not just the first one). Returns a :class:`Collection`. If no elements match, this returns a Collection with no items. """ op = operator.methodcaller('find_all', *args, **kwargs) ...
[ "Like", ":", "meth", ":", "find", "but", "selects", "all", "matches", "(", "not", "just", "the", "first", "one", ")", "." ]
ChrisBeaumont/soupy
python
https://github.com/ChrisBeaumont/soupy/blob/795f2f61f711f574d5218fc8a3375d02bda1104f/soupy.py#L1039-L1048
[ "def", "find_all", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "op", "=", "operator", ".", "methodcaller", "(", "'find_all'", ",", "*", "args", ",", "*", "*", "kwargs", ")", "return", "self", ".", "_wrap_multi", "(", "op", ")"...
795f2f61f711f574d5218fc8a3375d02bda1104f
test
Node.find_next_siblings
Like :meth:`find_all`, but searches through :attr:`next_siblings`
soupy.py
def find_next_siblings(self, *args, **kwargs): """ Like :meth:`find_all`, but searches through :attr:`next_siblings` """ op = operator.methodcaller('find_next_siblings', *args, **kwargs) return self._wrap_multi(op)
def find_next_siblings(self, *args, **kwargs): """ Like :meth:`find_all`, but searches through :attr:`next_siblings` """ op = operator.methodcaller('find_next_siblings', *args, **kwargs) return self._wrap_multi(op)
[ "Like", ":", "meth", ":", "find_all", "but", "searches", "through", ":", "attr", ":", "next_siblings" ]
ChrisBeaumont/soupy
python
https://github.com/ChrisBeaumont/soupy/blob/795f2f61f711f574d5218fc8a3375d02bda1104f/soupy.py#L1050-L1055
[ "def", "find_next_siblings", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "op", "=", "operator", ".", "methodcaller", "(", "'find_next_siblings'", ",", "*", "args", ",", "*", "*", "kwargs", ")", "return", "self", ".", "_wrap_multi", ...
795f2f61f711f574d5218fc8a3375d02bda1104f
test
Node.find_parents
Like :meth:`find_all`, but searches through :attr:`parents`
soupy.py
def find_parents(self, *args, **kwargs): """ Like :meth:`find_all`, but searches through :attr:`parents` """ op = operator.methodcaller('find_parents', *args, **kwargs) return self._wrap_multi(op)
def find_parents(self, *args, **kwargs): """ Like :meth:`find_all`, but searches through :attr:`parents` """ op = operator.methodcaller('find_parents', *args, **kwargs) return self._wrap_multi(op)
[ "Like", ":", "meth", ":", "find_all", "but", "searches", "through", ":", "attr", ":", "parents" ]
ChrisBeaumont/soupy
python
https://github.com/ChrisBeaumont/soupy/blob/795f2f61f711f574d5218fc8a3375d02bda1104f/soupy.py#L1057-L1062
[ "def", "find_parents", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "op", "=", "operator", ".", "methodcaller", "(", "'find_parents'", ",", "*", "args", ",", "*", "*", "kwargs", ")", "return", "self", ".", "_wrap_multi", "(", "op...
795f2f61f711f574d5218fc8a3375d02bda1104f
test
Node.find_previous_siblings
Like :meth:`find_all`, but searches through :attr:`previous_siblings`
soupy.py
def find_previous_siblings(self, *args, **kwargs): """ Like :meth:`find_all`, but searches through :attr:`previous_siblings` """ op = operator.methodcaller('find_previous_siblings', *args, **kwargs) return self._wrap_multi(op)
def find_previous_siblings(self, *args, **kwargs): """ Like :meth:`find_all`, but searches through :attr:`previous_siblings` """ op = operator.methodcaller('find_previous_siblings', *args, **kwargs) return self._wrap_multi(op)
[ "Like", ":", "meth", ":", "find_all", "but", "searches", "through", ":", "attr", ":", "previous_siblings" ]
ChrisBeaumont/soupy
python
https://github.com/ChrisBeaumont/soupy/blob/795f2f61f711f574d5218fc8a3375d02bda1104f/soupy.py#L1064-L1069
[ "def", "find_previous_siblings", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "op", "=", "operator", ".", "methodcaller", "(", "'find_previous_siblings'", ",", "*", "args", ",", "*", "*", "kwargs", ")", "return", "self", ".", "_wrap_...
795f2f61f711f574d5218fc8a3375d02bda1104f
test
Node.select
Like :meth:`find_all`, but takes a CSS selector string as input.
soupy.py
def select(self, selector): """ Like :meth:`find_all`, but takes a CSS selector string as input. """ op = operator.methodcaller('select', selector) return self._wrap_multi(op)
def select(self, selector): """ Like :meth:`find_all`, but takes a CSS selector string as input. """ op = operator.methodcaller('select', selector) return self._wrap_multi(op)
[ "Like", ":", "meth", ":", "find_all", "but", "takes", "a", "CSS", "selector", "string", "as", "input", "." ]
ChrisBeaumont/soupy
python
https://github.com/ChrisBeaumont/soupy/blob/795f2f61f711f574d5218fc8a3375d02bda1104f/soupy.py#L1071-L1076
[ "def", "select", "(", "self", ",", "selector", ")", ":", "op", "=", "operator", ".", "methodcaller", "(", "'select'", ",", "selector", ")", "return", "self", ".", "_wrap_multi", "(", "op", ")" ]
795f2f61f711f574d5218fc8a3375d02bda1104f
test
serach_path
Return potential locations of IACA installation.
kerncraft/iaca_get.py
def serach_path(): """Return potential locations of IACA installation.""" operating_system = get_os() # 1st choice: in ~/.kerncraft/iaca-{} # 2nd choice: in package directory / iaca-{} return [os.path.expanduser("~/.kerncraft/iaca/{}/".format(operating_system)), os.path.abspath(os.path.d...
def serach_path(): """Return potential locations of IACA installation.""" operating_system = get_os() # 1st choice: in ~/.kerncraft/iaca-{} # 2nd choice: in package directory / iaca-{} return [os.path.expanduser("~/.kerncraft/iaca/{}/".format(operating_system)), os.path.abspath(os.path.d...
[ "Return", "potential", "locations", "of", "IACA", "installation", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/iaca_get.py#L32-L39
[ "def", "serach_path", "(", ")", ":", "operating_system", "=", "get_os", "(", ")", "# 1st choice: in ~/.kerncraft/iaca-{}", "# 2nd choice: in package directory / iaca-{}", "return", "[", "os", ".", "path", ".", "expanduser", "(", "\"~/.kerncraft/iaca/{}/\"", ".", "format",...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
find_iaca
Return (hopefully) valid installation of IACA.
kerncraft/iaca_get.py
def find_iaca(): """Return (hopefully) valid installation of IACA.""" requires = ['iaca2.2', 'iaca2.3', 'iaca3.0'] for path in serach_path(): path += 'bin/' valid = True for r in requires: if not os.path.exists(path + r): valid = False brea...
def find_iaca(): """Return (hopefully) valid installation of IACA.""" requires = ['iaca2.2', 'iaca2.3', 'iaca3.0'] for path in serach_path(): path += 'bin/' valid = True for r in requires: if not os.path.exists(path + r): valid = False brea...
[ "Return", "(", "hopefully", ")", "valid", "installation", "of", "IACA", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/iaca_get.py#L42-L55
[ "def", "find_iaca", "(", ")", ":", "requires", "=", "[", "'iaca2.2'", ",", "'iaca2.3'", ",", "'iaca3.0'", "]", "for", "path", "in", "serach_path", "(", ")", ":", "path", "+=", "'bin/'", "valid", "=", "True", "for", "r", "in", "requires", ":", "if", "...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
group_iterator
Yild all groups of simple regex-like expression. The only special character is a dash (-), which take the preceding and the following chars to compute a range. If the range is non-sensical (e.g., b-a) it will be empty Example: >>> list(group_iterator('a-f')) ['a', 'b', 'c', 'd', 'e', 'f'] >>> ...
likwid-counter-packing.py
def group_iterator(group): """ Yild all groups of simple regex-like expression. The only special character is a dash (-), which take the preceding and the following chars to compute a range. If the range is non-sensical (e.g., b-a) it will be empty Example: >>> list(group_iterator('a-f')) ...
def group_iterator(group): """ Yild all groups of simple regex-like expression. The only special character is a dash (-), which take the preceding and the following chars to compute a range. If the range is non-sensical (e.g., b-a) it will be empty Example: >>> list(group_iterator('a-f')) ...
[ "Yild", "all", "groups", "of", "simple", "regex", "-", "like", "expression", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/likwid-counter-packing.py#L7-L33
[ "def", "group_iterator", "(", "group", ")", ":", "ordered_chars", "=", "string", ".", "ascii_letters", "+", "string", ".", "digits", "tokenizer", "=", "(", "'(?P<seq>[a-zA-Z0-9]-[a-zA-Z0-9])|'", "'(?P<chr>.)'", ")", "for", "m", "in", "re", ".", "finditer", "(", ...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
register_options
Very reduced regular expressions for describing a group of registers. Only groups in square bracktes and unions with pipes (|) are supported. Examples: >>> list(register_options('PMC[0-3]')) ['PMC0', 'PMC1', 'PMC2', 'PMC3'] >>> list(register_options('MBOX0C[01]')) ['MBOX0C0', 'MBOX0C1'] >>...
likwid-counter-packing.py
def register_options(regdescr): """ Very reduced regular expressions for describing a group of registers. Only groups in square bracktes and unions with pipes (|) are supported. Examples: >>> list(register_options('PMC[0-3]')) ['PMC0', 'PMC1', 'PMC2', 'PMC3'] >>> list(register_options('MBO...
def register_options(regdescr): """ Very reduced regular expressions for describing a group of registers. Only groups in square bracktes and unions with pipes (|) are supported. Examples: >>> list(register_options('PMC[0-3]')) ['PMC0', 'PMC1', 'PMC2', 'PMC3'] >>> list(register_options('MBO...
[ "Very", "reduced", "regular", "expressions", "for", "describing", "a", "group", "of", "registers", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/likwid-counter-packing.py#L36-L72
[ "def", "register_options", "(", "regdescr", ")", ":", "if", "not", "regdescr", ":", "yield", "None", "tokenizer", "=", "(", "'\\[(?P<grp>[^]]+)\\]|'", "'(?P<chr>.)'", ")", "for", "u", "in", "regdescr", ".", "split", "(", "'|'", ")", ":", "m", "=", "re", ...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
eventstr
Return a LIKWID event string from an event tuple or keyword arguments. *event_tuple* may have two or three arguments: (event, register) or (event, register, parameters) Keyword arguments will be overwritten by *event_tuple*. >>> eventstr(('L1D_REPLACEMENT', 'PMC0', None)) 'L1D_REPLACEMENT:PMC0' ...
likwid-counter-packing.py
def eventstr(event_tuple=None, event=None, register=None, parameters=None): """ Return a LIKWID event string from an event tuple or keyword arguments. *event_tuple* may have two or three arguments: (event, register) or (event, register, parameters) Keyword arguments will be overwritten by *event_t...
def eventstr(event_tuple=None, event=None, register=None, parameters=None): """ Return a LIKWID event string from an event tuple or keyword arguments. *event_tuple* may have two or three arguments: (event, register) or (event, register, parameters) Keyword arguments will be overwritten by *event_t...
[ "Return", "a", "LIKWID", "event", "string", "from", "an", "event", "tuple", "or", "keyword", "arguments", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/likwid-counter-packing.py#L75-L104
[ "def", "eventstr", "(", "event_tuple", "=", "None", ",", "event", "=", "None", ",", "register", "=", "None", ",", "parameters", "=", "None", ")", ":", "if", "len", "(", "event_tuple", ")", "==", "3", ":", "event", ",", "register", ",", "parameters", ...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
build_minimal_runs
Compile list of minimal runs for given events.
likwid-counter-packing.py
def build_minimal_runs(events): """Compile list of minimal runs for given events.""" # Eliminate multiples events = [e for i, e in enumerate(events) if events.index(e) == i] # Build list of runs per register group scheduled_runs = {} scheduled_events = [] cur_run = 0 while len(scheduled...
def build_minimal_runs(events): """Compile list of minimal runs for given events.""" # Eliminate multiples events = [e for i, e in enumerate(events) if events.index(e) == i] # Build list of runs per register group scheduled_runs = {} scheduled_events = [] cur_run = 0 while len(scheduled...
[ "Compile", "list", "of", "minimal", "runs", "for", "given", "events", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/likwid-counter-packing.py#L107-L136
[ "def", "build_minimal_runs", "(", "events", ")", ":", "# Eliminate multiples", "events", "=", "[", "e", "for", "i", ",", "e", "in", "enumerate", "(", "events", ")", "if", "events", ".", "index", "(", "e", ")", "==", "i", "]", "# Build list of runs per regi...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
Roofline.calculate_cache_access
Apply cache prediction to generate cache access behaviour.
kerncraft/models/roofline.py
def calculate_cache_access(self): """Apply cache prediction to generate cache access behaviour.""" self.results = {'misses': self.predictor.get_misses(), 'hits': self.predictor.get_hits(), 'evicts': self.predictor.get_evicts(), 'ver...
def calculate_cache_access(self): """Apply cache prediction to generate cache access behaviour.""" self.results = {'misses': self.predictor.get_misses(), 'hits': self.predictor.get_hits(), 'evicts': self.predictor.get_evicts(), 'ver...
[ "Apply", "cache", "prediction", "to", "generate", "cache", "access", "behaviour", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/models/roofline.py#L62-L161
[ "def", "calculate_cache_access", "(", "self", ")", ":", "self", ".", "results", "=", "{", "'misses'", ":", "self", ".", "predictor", ".", "get_misses", "(", ")", ",", "'hits'", ":", "self", ".", "predictor", ".", "get_hits", "(", ")", ",", "'evicts'", ...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
Roofline.analyze
Run analysis.
kerncraft/models/roofline.py
def analyze(self): """Run analysis.""" precision = 'DP' if self.kernel.datatype == 'double' else 'SP' self.calculate_cache_access() self.results['max_perf'] = self.conv_perf(self.machine['clock'] * self.cores * \ self.machine['FLOPs per cycle'][precision]['total'])
def analyze(self): """Run analysis.""" precision = 'DP' if self.kernel.datatype == 'double' else 'SP' self.calculate_cache_access() self.results['max_perf'] = self.conv_perf(self.machine['clock'] * self.cores * \ self.machine['FLOPs per cycle'][precision]['total'])
[ "Run", "analysis", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/models/roofline.py#L163-L169
[ "def", "analyze", "(", "self", ")", ":", "precision", "=", "'DP'", "if", "self", ".", "kernel", ".", "datatype", "==", "'double'", "else", "'SP'", "self", ".", "calculate_cache_access", "(", ")", "self", ".", "results", "[", "'max_perf'", "]", "=", "self...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
Roofline.conv_perf
Convert performance (FLOP/s) to other units, such as It/s or cy/CL.
kerncraft/models/roofline.py
def conv_perf(self, performance): """Convert performance (FLOP/s) to other units, such as It/s or cy/CL.""" clock = self.machine['clock'] flops_per_it = sum(self.kernel._flops.values()) it_s = performance/flops_per_it it_s.unit = 'It/s' element_size = self.kernel.datatype...
def conv_perf(self, performance): """Convert performance (FLOP/s) to other units, such as It/s or cy/CL.""" clock = self.machine['clock'] flops_per_it = sum(self.kernel._flops.values()) it_s = performance/flops_per_it it_s.unit = 'It/s' element_size = self.kernel.datatype...
[ "Convert", "performance", "(", "FLOP", "/", "s", ")", "to", "other", "units", "such", "as", "It", "/", "s", "or", "cy", "/", "CL", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/models/roofline.py#L171-L187
[ "def", "conv_perf", "(", "self", ",", "performance", ")", ":", "clock", "=", "self", ".", "machine", "[", "'clock'", "]", "flops_per_it", "=", "sum", "(", "self", ".", "kernel", ".", "_flops", ".", "values", "(", ")", ")", "it_s", "=", "performance", ...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
Roofline.report
Report analysis outcome in human readable form.
kerncraft/models/roofline.py
def report(self, output_file=sys.stdout): """Report analysis outcome in human readable form.""" max_perf = self.results['max_perf'] if self._args and self._args.verbose >= 3: print('{}'.format(pformat(self.results)), file=output_file) if self._args and self._args.verbose >=...
def report(self, output_file=sys.stdout): """Report analysis outcome in human readable form.""" max_perf = self.results['max_perf'] if self._args and self._args.verbose >= 3: print('{}'.format(pformat(self.results)), file=output_file) if self._args and self._args.verbose >=...
[ "Report", "analysis", "outcome", "in", "human", "readable", "form", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/models/roofline.py#L189-L227
[ "def", "report", "(", "self", ",", "output_file", "=", "sys", ".", "stdout", ")", ":", "max_perf", "=", "self", ".", "results", "[", "'max_perf'", "]", "if", "self", ".", "_args", "and", "self", ".", "_args", ".", "verbose", ">=", "3", ":", "print", ...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
RooflineIACA.analyze
Run complete analysis.
kerncraft/models/roofline.py
def analyze(self): """Run complete analysis.""" self.results = self.calculate_cache_access() try: iaca_analysis, asm_block = self.kernel.iaca_analysis( micro_architecture=self.machine['micro-architecture'], asm_block=self.asm_block, poi...
def analyze(self): """Run complete analysis.""" self.results = self.calculate_cache_access() try: iaca_analysis, asm_block = self.kernel.iaca_analysis( micro_architecture=self.machine['micro-architecture'], asm_block=self.asm_block, poi...
[ "Run", "complete", "analysis", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/models/roofline.py#L281-L337
[ "def", "analyze", "(", "self", ")", ":", "self", ".", "results", "=", "self", ".", "calculate_cache_access", "(", ")", "try", ":", "iaca_analysis", ",", "asm_block", "=", "self", ".", "kernel", ".", "iaca_analysis", "(", "micro_architecture", "=", "self", ...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
RooflineIACA.report
Print human readable report of model.
kerncraft/models/roofline.py
def report(self, output_file=sys.stdout): """Print human readable report of model.""" cpu_perf = self.results['cpu bottleneck']['performance throughput'] if self.verbose >= 3: print('{}'.format(pformat(self.results)), file=output_file) if self.verbose >= 1: prin...
def report(self, output_file=sys.stdout): """Print human readable report of model.""" cpu_perf = self.results['cpu bottleneck']['performance throughput'] if self.verbose >= 3: print('{}'.format(pformat(self.results)), file=output_file) if self.verbose >= 1: prin...
[ "Print", "human", "readable", "report", "of", "model", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/models/roofline.py#L339-L386
[ "def", "report", "(", "self", ",", "output_file", "=", "sys", ".", "stdout", ")", ":", "cpu_perf", "=", "self", ".", "results", "[", "'cpu bottleneck'", "]", "[", "'performance throughput'", "]", "if", "self", ".", "verbose", ">=", "3", ":", "print", "("...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
LC.calculate_cache_access
Apply layer condition model to calculate cache accesses.
kerncraft/models/layer_condition.py
def calculate_cache_access(self): """Apply layer condition model to calculate cache accesses.""" # FIXME handle multiple datatypes element_size = self.kernel.datatypes_size[self.kernel.datatype] results = {'dimensions': {}} def sympy_compare(a, b): c = 0 ...
def calculate_cache_access(self): """Apply layer condition model to calculate cache accesses.""" # FIXME handle multiple datatypes element_size = self.kernel.datatypes_size[self.kernel.datatype] results = {'dimensions': {}} def sympy_compare(a, b): c = 0 ...
[ "Apply", "layer", "condition", "model", "to", "calculate", "cache", "accesses", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/models/layer_condition.py#L46-L179
[ "def", "calculate_cache_access", "(", "self", ")", ":", "# FIXME handle multiple datatypes", "element_size", "=", "self", ".", "kernel", ".", "datatypes_size", "[", "self", ".", "kernel", ".", "datatype", "]", "results", "=", "{", "'dimensions'", ":", "{", "}", ...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
LC.analyze
Run complete analysis.
kerncraft/models/layer_condition.py
def analyze(self): """Run complete analysis.""" # check that layer conditions can be applied on this kernel: # 1. All iterations may only have a step width of 1 loop_stack = list(self.kernel.get_loop_stack()) if any([l['increment'] != 1 for l in loop_stack]): raise Va...
def analyze(self): """Run complete analysis.""" # check that layer conditions can be applied on this kernel: # 1. All iterations may only have a step width of 1 loop_stack = list(self.kernel.get_loop_stack()) if any([l['increment'] != 1 for l in loop_stack]): raise Va...
[ "Run", "complete", "analysis", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/models/layer_condition.py#L181-L227
[ "def", "analyze", "(", "self", ")", ":", "# check that layer conditions can be applied on this kernel:", "# 1. All iterations may only have a step width of 1", "loop_stack", "=", "list", "(", "self", ".", "kernel", ".", "get_loop_stack", "(", ")", ")", "if", "any", "(", ...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
LC.report
Report generated model in human readable form.
kerncraft/models/layer_condition.py
def report(self, output_file=sys.stdout): """Report generated model in human readable form.""" if self._args and self._args.verbose > 2: pprint(self.results) for dimension, lc_info in self.results['dimensions'].items(): print("{}D layer condition:".format(dimension), fil...
def report(self, output_file=sys.stdout): """Report generated model in human readable form.""" if self._args and self._args.verbose > 2: pprint(self.results) for dimension, lc_info in self.results['dimensions'].items(): print("{}D layer condition:".format(dimension), fil...
[ "Report", "generated", "model", "in", "human", "readable", "form", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/models/layer_condition.py#L229-L248
[ "def", "report", "(", "self", ",", "output_file", "=", "sys", ".", "stdout", ")", ":", "if", "self", ".", "_args", "and", "self", ".", "_args", ".", "verbose", ">", "2", ":", "pprint", "(", "self", ".", "results", ")", "for", "dimension", ",", "lc_...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
clean_code
Naive comment and macro striping from source code :param comments: If True, all comments are stripped from code :param macros: If True, all macros are stripped from code :param pragmas: If True, all pragmas are stripped from code :return: cleaned code. Line numbers are preserved with blank lines, ...
kerncraft/pycparser_utils.py
def clean_code(code, comments=True, macros=False, pragmas=False): """ Naive comment and macro striping from source code :param comments: If True, all comments are stripped from code :param macros: If True, all macros are stripped from code :param pragmas: If True, all pragmas are stripped from code...
def clean_code(code, comments=True, macros=False, pragmas=False): """ Naive comment and macro striping from source code :param comments: If True, all comments are stripped from code :param macros: If True, all macros are stripped from code :param pragmas: If True, all pragmas are stripped from code...
[ "Naive", "comment", "and", "macro", "striping", "from", "source", "code" ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/pycparser_utils.py#L9-L54
[ "def", "clean_code", "(", "code", ",", "comments", "=", "True", ",", "macros", "=", "False", ",", "pragmas", "=", "False", ")", ":", "if", "macros", "or", "pragmas", ":", "lines", "=", "code", ".", "split", "(", "'\\n'", ")", "in_macro", "=", "False"...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
replace_id
Replace all matching ID nodes in ast (in-place), with replacement. :param id_name: name of ID node to match :param replacement: single or list of node to insert in replacement for ID node.
kerncraft/pycparser_utils.py
def replace_id(ast, id_name, replacement): """ Replace all matching ID nodes in ast (in-place), with replacement. :param id_name: name of ID node to match :param replacement: single or list of node to insert in replacement for ID node. """ for a in ast: if isinstance(a, c_ast.ID) and a....
def replace_id(ast, id_name, replacement): """ Replace all matching ID nodes in ast (in-place), with replacement. :param id_name: name of ID node to match :param replacement: single or list of node to insert in replacement for ID node. """ for a in ast: if isinstance(a, c_ast.ID) and a....
[ "Replace", "all", "matching", "ID", "nodes", "in", "ast", "(", "in", "-", "place", ")", "with", "replacement", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/pycparser_utils.py#L57-L86
[ "def", "replace_id", "(", "ast", ",", "id_name", ",", "replacement", ")", ":", "for", "a", "in", "ast", ":", "if", "isinstance", "(", "a", ",", "c_ast", ".", "ID", ")", "and", "a", ".", "name", "==", "id_name", ":", "# Check all attributes of ast", "fo...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
round_to_next
Round float to next multiple of base.
kerncraft/models/ecm.py
def round_to_next(x, base): """Round float to next multiple of base.""" # Based on: http://stackoverflow.com/a/2272174 return int(base * math.ceil(float(x)/base))
def round_to_next(x, base): """Round float to next multiple of base.""" # Based on: http://stackoverflow.com/a/2272174 return int(base * math.ceil(float(x)/base))
[ "Round", "float", "to", "next", "multiple", "of", "base", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/models/ecm.py#L22-L25
[ "def", "round_to_next", "(", "x", ",", "base", ")", ":", "# Based on: http://stackoverflow.com/a/2272174", "return", "int", "(", "base", "*", "math", ".", "ceil", "(", "float", "(", "x", ")", "/", "base", ")", ")" ]
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
blocking
Split list of integers into blocks of block_size and return block indices. First block element will be located at initial_boundary (default 0). >>> blocking([0, -1, -2, -3, -4, -5, -6, -7, -8, -9], 8) [0,-1] >>> blocking([0], 8) [0] >>> blocking([0], 8, initial_boundary=32) [-4]
kerncraft/models/ecm.py
def blocking(indices, block_size, initial_boundary=0): """ Split list of integers into blocks of block_size and return block indices. First block element will be located at initial_boundary (default 0). >>> blocking([0, -1, -2, -3, -4, -5, -6, -7, -8, -9], 8) [0,-1] >>> blocking([0], 8) [0...
def blocking(indices, block_size, initial_boundary=0): """ Split list of integers into blocks of block_size and return block indices. First block element will be located at initial_boundary (default 0). >>> blocking([0, -1, -2, -3, -4, -5, -6, -7, -8, -9], 8) [0,-1] >>> blocking([0], 8) [0...
[ "Split", "list", "of", "integers", "into", "blocks", "of", "block_size", "and", "return", "block", "indices", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/models/ecm.py#L28-L49
[ "def", "blocking", "(", "indices", ",", "block_size", ",", "initial_boundary", "=", "0", ")", ":", "blocks", "=", "[", "]", "for", "idx", "in", "indices", ":", "bl_idx", "=", "(", "idx", "-", "initial_boundary", ")", "//", "float", "(", "block_size", "...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
ECMData.calculate_cache_access
Dispatch to cache predictor to get cache stats.
kerncraft/models/ecm.py
def calculate_cache_access(self): """Dispatch to cache predictor to get cache stats.""" self.results.update({ 'cycles': [], # will be filled by caclculate_cycles() 'misses': self.predictor.get_misses(), 'hits': self.predictor.get_h...
def calculate_cache_access(self): """Dispatch to cache predictor to get cache stats.""" self.results.update({ 'cycles': [], # will be filled by caclculate_cycles() 'misses': self.predictor.get_misses(), 'hits': self.predictor.get_h...
[ "Dispatch", "to", "cache", "predictor", "to", "get", "cache", "stats", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/models/ecm.py#L90-L97
[ "def", "calculate_cache_access", "(", "self", ")", ":", "self", ".", "results", ".", "update", "(", "{", "'cycles'", ":", "[", "]", ",", "# will be filled by caclculate_cycles()", "'misses'", ":", "self", ".", "predictor", ".", "get_misses", "(", ")", ",", "...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
ECMData.calculate_cycles
Calculate performance model cycles from cache stats. calculate_cache_access() needs to have been execute before.
kerncraft/models/ecm.py
def calculate_cycles(self): """ Calculate performance model cycles from cache stats. calculate_cache_access() needs to have been execute before. """ element_size = self.kernel.datatypes_size[self.kernel.datatype] elements_per_cacheline = float(self.machine['cacheline siz...
def calculate_cycles(self): """ Calculate performance model cycles from cache stats. calculate_cache_access() needs to have been execute before. """ element_size = self.kernel.datatypes_size[self.kernel.datatype] elements_per_cacheline = float(self.machine['cacheline siz...
[ "Calculate", "performance", "model", "cycles", "from", "cache", "stats", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/models/ecm.py#L99-L165
[ "def", "calculate_cycles", "(", "self", ")", ":", "element_size", "=", "self", ".", "kernel", ".", "datatypes_size", "[", "self", ".", "kernel", ".", "datatype", "]", "elements_per_cacheline", "=", "float", "(", "self", ".", "machine", "[", "'cacheline size'",...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
ECMData.analyze
Run complete anaylysis and return results.
kerncraft/models/ecm.py
def analyze(self): """Run complete anaylysis and return results.""" self.calculate_cache_access() self.calculate_cycles() self.results['flops per iteration'] = sum(self.kernel._flops.values()) return self.results
def analyze(self): """Run complete anaylysis and return results.""" self.calculate_cache_access() self.calculate_cycles() self.results['flops per iteration'] = sum(self.kernel._flops.values()) return self.results
[ "Run", "complete", "anaylysis", "and", "return", "results", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/models/ecm.py#L167-L173
[ "def", "analyze", "(", "self", ")", ":", "self", ".", "calculate_cache_access", "(", ")", "self", ".", "calculate_cycles", "(", ")", "self", ".", "results", "[", "'flops per iteration'", "]", "=", "sum", "(", "self", ".", "kernel", ".", "_flops", ".", "v...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
ECMData.report
Print generated model data in human readable format.
kerncraft/models/ecm.py
def report(self, output_file=sys.stdout): """Print generated model data in human readable format.""" if self.verbose > 1: print('{}'.format(pprint.pformat(self.results['verbose infos'])), file=output_file) for level, cycles in self.results['cycles']: print('{} = {}'.form...
def report(self, output_file=sys.stdout): """Print generated model data in human readable format.""" if self.verbose > 1: print('{}'.format(pprint.pformat(self.results['verbose infos'])), file=output_file) for level, cycles in self.results['cycles']: print('{} = {}'.form...
[ "Print", "generated", "model", "data", "in", "human", "readable", "format", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/models/ecm.py#L210-L228
[ "def", "report", "(", "self", ",", "output_file", "=", "sys", ".", "stdout", ")", ":", "if", "self", ".", "verbose", ">", "1", ":", "print", "(", "'{}'", ".", "format", "(", "pprint", ".", "pformat", "(", "self", ".", "results", "[", "'verbose infos'...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
ECMCPU.analyze
Run complete analysis and return results.
kerncraft/models/ecm.py
def analyze(self): """ Run complete analysis and return results. """ try: incore_analysis, asm_block = self.kernel.iaca_analysis( micro_architecture=self.machine['micro-architecture'], asm_block=self.asm_block, pointer_incremen...
def analyze(self): """ Run complete analysis and return results. """ try: incore_analysis, asm_block = self.kernel.iaca_analysis( micro_architecture=self.machine['micro-architecture'], asm_block=self.asm_block, pointer_incremen...
[ "Run", "complete", "analysis", "and", "return", "results", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/models/ecm.py#L284-L337
[ "def", "analyze", "(", "self", ")", ":", "try", ":", "incore_analysis", ",", "asm_block", "=", "self", ".", "kernel", ".", "iaca_analysis", "(", "micro_architecture", "=", "self", ".", "machine", "[", "'micro-architecture'", "]", ",", "asm_block", "=", "self...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
ECMCPU.conv_cy
Convert cycles (cy/CL) to other units, such as FLOP/s or It/s.
kerncraft/models/ecm.py
def conv_cy(self, cy_cl): """Convert cycles (cy/CL) to other units, such as FLOP/s or It/s.""" if not isinstance(cy_cl, PrefixedUnit): cy_cl = PrefixedUnit(cy_cl, '', 'cy/CL') clock = self.machine['clock'] element_size = self.kernel.datatypes_size[self.kernel.datatype] ...
def conv_cy(self, cy_cl): """Convert cycles (cy/CL) to other units, such as FLOP/s or It/s.""" if not isinstance(cy_cl, PrefixedUnit): cy_cl = PrefixedUnit(cy_cl, '', 'cy/CL') clock = self.machine['clock'] element_size = self.kernel.datatypes_size[self.kernel.datatype] ...
[ "Convert", "cycles", "(", "cy", "/", "CL", ")", "to", "other", "units", "such", "as", "FLOP", "/", "s", "or", "It", "/", "s", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/models/ecm.py#L339-L357
[ "def", "conv_cy", "(", "self", ",", "cy_cl", ")", ":", "if", "not", "isinstance", "(", "cy_cl", ",", "PrefixedUnit", ")", ":", "cy_cl", "=", "PrefixedUnit", "(", "cy_cl", ",", "''", ",", "'cy/CL'", ")", "clock", "=", "self", ".", "machine", "[", "'cl...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
ECMCPU.report
Print generated model data in human readable format.
kerncraft/models/ecm.py
def report(self, output_file=sys.stdout): """Print generated model data in human readable format.""" if self.verbose > 2: print("IACA Output:", file=output_file) print(self.results['IACA output'], file=output_file) print('', file=output_file) if self.verbose ...
def report(self, output_file=sys.stdout): """Print generated model data in human readable format.""" if self.verbose > 2: print("IACA Output:", file=output_file) print(self.results['IACA output'], file=output_file) print('', file=output_file) if self.verbose ...
[ "Print", "generated", "model", "data", "in", "human", "readable", "format", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/models/ecm.py#L359-L378
[ "def", "report", "(", "self", ",", "output_file", "=", "sys", ".", "stdout", ")", ":", "if", "self", ".", "verbose", ">", "2", ":", "print", "(", "\"IACA Output:\"", ",", "file", "=", "output_file", ")", "print", "(", "self", ".", "results", "[", "'I...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
ECM.analyze
Run complete analysis.
kerncraft/models/ecm.py
def analyze(self): """Run complete analysis.""" self._CPU.analyze() self._data.analyze() self.results = copy.deepcopy(self._CPU.results) self.results.update(copy.deepcopy(self._data.results)) cores_per_numa_domain = self.machine['cores per NUMA domain'] # Compil...
def analyze(self): """Run complete analysis.""" self._CPU.analyze() self._data.analyze() self.results = copy.deepcopy(self._CPU.results) self.results.update(copy.deepcopy(self._data.results)) cores_per_numa_domain = self.machine['cores per NUMA domain'] # Compil...
[ "Run", "complete", "analysis", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/models/ecm.py#L425-L514
[ "def", "analyze", "(", "self", ")", ":", "self", ".", "_CPU", ".", "analyze", "(", ")", "self", ".", "_data", ".", "analyze", "(", ")", "self", ".", "results", "=", "copy", ".", "deepcopy", "(", "self", ".", "_CPU", ".", "results", ")", "self", "...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
ECM.report
Print generated model data in human readable format.
kerncraft/models/ecm.py
def report(self, output_file=sys.stdout): """Print generated model data in human readable format.""" report = '' if self.verbose > 1: self._CPU.report() self._data.report() report += '{{ {:.1f} || {:.1f} | {} }} cy/CL'.format( self.results['T_OL'], ...
def report(self, output_file=sys.stdout): """Print generated model data in human readable format.""" report = '' if self.verbose > 1: self._CPU.report() self._data.report() report += '{{ {:.1f} || {:.1f} | {} }} cy/CL'.format( self.results['T_OL'], ...
[ "Print", "generated", "model", "data", "in", "human", "readable", "format", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/models/ecm.py#L516-L569
[ "def", "report", "(", "self", ",", "output_file", "=", "sys", ".", "stdout", ")", ":", "report", "=", "''", "if", "self", ".", "verbose", ">", "1", ":", "self", ".", "_CPU", ".", "report", "(", ")", "self", ".", "_data", ".", "report", "(", ")", ...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
ECM.plot
Plot visualization of model prediction.
kerncraft/models/ecm.py
def plot(self, fig=None): """Plot visualization of model prediction.""" if not fig: fig = plt.gcf() fig.subplots_adjust(left=0.1, right=0.9, top=0.9, bottom=0.15) ax = fig.add_subplot(1, 1, 1) sorted_overlapping_ports = sorted( [(p, self.results['port cy...
def plot(self, fig=None): """Plot visualization of model prediction.""" if not fig: fig = plt.gcf() fig.subplots_adjust(left=0.1, right=0.9, top=0.9, bottom=0.15) ax = fig.add_subplot(1, 1, 1) sorted_overlapping_ports = sorted( [(p, self.results['port cy...
[ "Plot", "visualization", "of", "model", "prediction", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/models/ecm.py#L571-L628
[ "def", "plot", "(", "self", ",", "fig", "=", "None", ")", ":", "if", "not", "fig", ":", "fig", "=", "plt", ".", "gcf", "(", ")", "fig", ".", "subplots_adjust", "(", "left", "=", "0.1", ",", "right", "=", "0.9", ",", "top", "=", "0.9", ",", "b...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
strip_and_uncomment
Strip whitespaces and comments from asm lines.
kerncraft/iaca.py
def strip_and_uncomment(asm_lines): """Strip whitespaces and comments from asm lines.""" asm_stripped = [] for line in asm_lines: # Strip comments and whitespaces asm_stripped.append(line.split('#')[0].strip()) return asm_stripped
def strip_and_uncomment(asm_lines): """Strip whitespaces and comments from asm lines.""" asm_stripped = [] for line in asm_lines: # Strip comments and whitespaces asm_stripped.append(line.split('#')[0].strip()) return asm_stripped
[ "Strip", "whitespaces", "and", "comments", "from", "asm", "lines", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/iaca.py#L31-L37
[ "def", "strip_and_uncomment", "(", "asm_lines", ")", ":", "asm_stripped", "=", "[", "]", "for", "line", "in", "asm_lines", ":", "# Strip comments and whitespaces", "asm_stripped", ".", "append", "(", "line", ".", "split", "(", "'#'", ")", "[", "0", "]", ".",...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
strip_unreferenced_labels
Strip all labels, which are never referenced.
kerncraft/iaca.py
def strip_unreferenced_labels(asm_lines): """Strip all labels, which are never referenced.""" asm_stripped = [] for line in asm_lines: if re.match(r'^\S+:', line): # Found label label = line[0:line.find(':')] # Search for references to current label if...
def strip_unreferenced_labels(asm_lines): """Strip all labels, which are never referenced.""" asm_stripped = [] for line in asm_lines: if re.match(r'^\S+:', line): # Found label label = line[0:line.find(':')] # Search for references to current label if...
[ "Strip", "all", "labels", "which", "are", "never", "referenced", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/iaca.py#L40-L52
[ "def", "strip_unreferenced_labels", "(", "asm_lines", ")", ":", "asm_stripped", "=", "[", "]", "for", "line", "in", "asm_lines", ":", "if", "re", ".", "match", "(", "r'^\\S+:'", ",", "line", ")", ":", "# Found label", "label", "=", "line", "[", "0", ":",...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
find_asm_blocks
Find blocks probably corresponding to loops in assembly.
kerncraft/iaca.py
def find_asm_blocks(asm_lines): """Find blocks probably corresponding to loops in assembly.""" blocks = [] last_labels = OrderedDict() packed_ctr = 0 avx_ctr = 0 xmm_references = [] ymm_references = [] zmm_references = [] gp_references = [] mem_references = [] increments = {...
def find_asm_blocks(asm_lines): """Find blocks probably corresponding to loops in assembly.""" blocks = [] last_labels = OrderedDict() packed_ctr = 0 avx_ctr = 0 xmm_references = [] ymm_references = [] zmm_references = [] gp_references = [] mem_references = [] increments = {...
[ "Find", "blocks", "probably", "corresponding", "to", "loops", "in", "assembly", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/iaca.py#L59-L217
[ "def", "find_asm_blocks", "(", "asm_lines", ")", ":", "blocks", "=", "[", "]", "last_labels", "=", "OrderedDict", "(", ")", "packed_ctr", "=", "0", "avx_ctr", "=", "0", "xmm_references", "=", "[", "]", "ymm_references", "=", "[", "]", "zmm_references", "="...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
select_best_block
Return best block selected based on simple heuristic.
kerncraft/iaca.py
def select_best_block(blocks): """Return best block selected based on simple heuristic.""" # TODO make this cleverer with more stats if not blocks: raise ValueError("No suitable blocks were found in assembly.") best_block = max(blocks, key=lambda b: b[1]['packed_instr']) if best_block[1]['pa...
def select_best_block(blocks): """Return best block selected based on simple heuristic.""" # TODO make this cleverer with more stats if not blocks: raise ValueError("No suitable blocks were found in assembly.") best_block = max(blocks, key=lambda b: b[1]['packed_instr']) if best_block[1]['pa...
[ "Return", "best", "block", "selected", "based", "on", "simple", "heuristic", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/iaca.py#L220-L230
[ "def", "select_best_block", "(", "blocks", ")", ":", "# TODO make this cleverer with more stats", "if", "not", "blocks", ":", "raise", "ValueError", "(", "\"No suitable blocks were found in assembly.\"", ")", "best_block", "=", "max", "(", "blocks", ",", "key", "=", "...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
userselect_increment
Let user interactively select byte increment.
kerncraft/iaca.py
def userselect_increment(block): """Let user interactively select byte increment.""" print("Selected block:") print('\n ' + ('\n '.join(block['lines']))) print() increment = None while increment is None: increment = input("Choose store pointer increment (number of bytes): ") ...
def userselect_increment(block): """Let user interactively select byte increment.""" print("Selected block:") print('\n ' + ('\n '.join(block['lines']))) print() increment = None while increment is None: increment = input("Choose store pointer increment (number of bytes): ") ...
[ "Let", "user", "interactively", "select", "byte", "increment", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/iaca.py#L233-L248
[ "def", "userselect_increment", "(", "block", ")", ":", "print", "(", "\"Selected block:\"", ")", "print", "(", "'\\n '", "+", "(", "'\\n '", ".", "join", "(", "block", "[", "'lines'", "]", ")", ")", ")", "print", "(", ")", "increment", "=", "None",...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
userselect_block
Let user interactively select block.
kerncraft/iaca.py
def userselect_block(blocks, default=None, debug=False): """Let user interactively select block.""" print("Blocks found in assembly file:") print(" block | OPs | pck. | AVX || Registers | ZMM | YMM | XMM | GP ||ptr.inc|\n" "----------------+-----+------+-----++--------...
def userselect_block(blocks, default=None, debug=False): """Let user interactively select block.""" print("Blocks found in assembly file:") print(" block | OPs | pck. | AVX || Registers | ZMM | YMM | XMM | GP ||ptr.inc|\n" "----------------+-----+------+-----++--------...
[ "Let", "user", "interactively", "select", "block", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/iaca.py#L251-L284
[ "def", "userselect_block", "(", "blocks", ",", "default", "=", "None", ",", "debug", "=", "False", ")", ":", "print", "(", "\"Blocks found in assembly file:\"", ")", "print", "(", "\" block | OPs | pck. | AVX || Registers | ZMM | YMM | XMM | GP ||...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
insert_markers
Insert IACA marker into list of ASM instructions at given indices.
kerncraft/iaca.py
def insert_markers(asm_lines, start_line, end_line): """Insert IACA marker into list of ASM instructions at given indices.""" asm_lines = (asm_lines[:start_line] + START_MARKER + asm_lines[start_line:end_line + 1] + END_MARKER + asm_lines[end_line + 1:]) return asm_lines
def insert_markers(asm_lines, start_line, end_line): """Insert IACA marker into list of ASM instructions at given indices.""" asm_lines = (asm_lines[:start_line] + START_MARKER + asm_lines[start_line:end_line + 1] + END_MARKER + asm_lines[end_line + 1:]) return asm_lines
[ "Insert", "IACA", "marker", "into", "list", "of", "ASM", "instructions", "at", "given", "indices", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/iaca.py#L287-L292
[ "def", "insert_markers", "(", "asm_lines", ",", "start_line", ",", "end_line", ")", ":", "asm_lines", "=", "(", "asm_lines", "[", ":", "start_line", "]", "+", "START_MARKER", "+", "asm_lines", "[", "start_line", ":", "end_line", "+", "1", "]", "+", "END_MA...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
iaca_instrumentation
Add IACA markers to an assembly file. If instrumentation fails because loop increment could not determined automatically, a ValueError is raised. :param input_file: file-like object to read from :param output_file: file-like object to write to :param block_selection: index of the assembly block to...
kerncraft/iaca.py
def iaca_instrumentation(input_file, output_file, block_selection='auto', pointer_increment='auto_with_manual_fallback', debug=False): """ Add IACA markers to an assembly file. If instrumentation fails because loop increment could n...
def iaca_instrumentation(input_file, output_file, block_selection='auto', pointer_increment='auto_with_manual_fallback', debug=False): """ Add IACA markers to an assembly file. If instrumentation fails because loop increment could n...
[ "Add", "IACA", "markers", "to", "an", "assembly", "file", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/iaca.py#L295-L360
[ "def", "iaca_instrumentation", "(", "input_file", ",", "output_file", ",", "block_selection", "=", "'auto'", ",", "pointer_increment", "=", "'auto_with_manual_fallback'", ",", "debug", "=", "False", ")", ":", "assembly_orig", "=", "input_file", ".", "readlines", "("...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
iaca_analyse_instrumented_binary
Run IACA analysis on an instrumented binary. :param instrumented_binary_file: path of binary that was built with IACA markers :param micro_architecture: micro architecture string as taken by IACA. one of: NHM, WSM, SNB, IVB, HSW, BDW :return: a dictionary with the following k...
kerncraft/iaca.py
def iaca_analyse_instrumented_binary(instrumented_binary_file, micro_architecture): """ Run IACA analysis on an instrumented binary. :param instrumented_binary_file: path of binary that was built with IACA markers :param micro_architecture: micro architecture string as taken by IACA. ...
def iaca_analyse_instrumented_binary(instrumented_binary_file, micro_architecture): """ Run IACA analysis on an instrumented binary. :param instrumented_binary_file: path of binary that was built with IACA markers :param micro_architecture: micro architecture string as taken by IACA. ...
[ "Run", "IACA", "analysis", "on", "an", "instrumented", "binary", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/iaca.py#L363-L438
[ "def", "iaca_analyse_instrumented_binary", "(", "instrumented_binary_file", ",", "micro_architecture", ")", ":", "# Select IACA version and executable based on micro_architecture:", "arch_map", "=", "{", "# arch: (binary name, version string, required additional arguments)", "'NHM'", ":"...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
main
Execute command line interface.
kerncraft/iaca.py
def main(): """Execute command line interface.""" parser = argparse.ArgumentParser( description='Find and analyze basic loop blocks and mark for IACA.', epilog='For help, examples, documentation and bug reports go to:\nhttps://github.com' '/RRZE-HPC/kerncraft\nLicense: AGPLv3') ...
def main(): """Execute command line interface.""" parser = argparse.ArgumentParser( description='Find and analyze basic loop blocks and mark for IACA.', epilog='For help, examples, documentation and bug reports go to:\nhttps://github.com' '/RRZE-HPC/kerncraft\nLicense: AGPLv3') ...
[ "Execute", "command", "line", "interface", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/iaca.py#L441-L459
[ "def", "main", "(", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "'Find and analyze basic loop blocks and mark for IACA.'", ",", "epilog", "=", "'For help, examples, documentation and bug reports go to:\\nhttps://github.com'", "'/RRZE-HPC/k...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
simulate
Setup and execute model with given blocking length
kerncraft/cachetile.py
def simulate(kernel, model, define_dict, blocking_constant, blocking_length): """Setup and execute model with given blocking length""" kernel.clear_state() # Add constants from define arguments for k, v in define_dict.items(): kernel.set_constant(k, v) kernel.set_constant(blocking_constant...
def simulate(kernel, model, define_dict, blocking_constant, blocking_length): """Setup and execute model with given blocking length""" kernel.clear_state() # Add constants from define arguments for k, v in define_dict.items(): kernel.set_constant(k, v) kernel.set_constant(blocking_constant...
[ "Setup", "and", "execute", "model", "with", "given", "blocking", "length" ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/cachetile.py#L31-L42
[ "def", "simulate", "(", "kernel", ",", "model", ",", "define_dict", ",", "blocking_constant", ",", "blocking_length", ")", ":", "kernel", ".", "clear_state", "(", ")", "# Add constants from define arguments", "for", "k", ",", "v", "in", "define_dict", ".", "item...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
PrefixedUnit.good_prefix
returns the largest prefix where the relative error is bellow *max_error* although rounded by *round_length* if *max_prefix* is found in PrefixedUnit.PREFIXES, returned value will not exceed this prefix. if *min_prefix* is given, returned value will atleast be of that prefix (no matter ...
kerncraft/prefixedunit.py
def good_prefix(self, max_error=0.01, round_length=2, min_prefix='', max_prefix=None): """ returns the largest prefix where the relative error is bellow *max_error* although rounded by *round_length* if *max_prefix* is found in PrefixedUnit.PREFIXES, returned value will not exceed this ...
def good_prefix(self, max_error=0.01, round_length=2, min_prefix='', max_prefix=None): """ returns the largest prefix where the relative error is bellow *max_error* although rounded by *round_length* if *max_prefix* is found in PrefixedUnit.PREFIXES, returned value will not exceed this ...
[ "returns", "the", "largest", "prefix", "where", "the", "relative", "error", "is", "bellow", "*", "max_error", "*", "although", "rounded", "by", "*", "round_length", "*" ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/prefixedunit.py#L59-L92
[ "def", "good_prefix", "(", "self", ",", "max_error", "=", "0.01", ",", "round_length", "=", "2", ",", "min_prefix", "=", "''", ",", "max_prefix", "=", "None", ")", ":", "good_prefix", "=", "min_prefix", "base_value", "=", "self", ".", "base_value", "(", ...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
space
Return list of evenly spaced integers over an interval. Numbers can either be evenly distributed in a linear space (if *log* is False) or in a log space (if *log* is True). If *log* is True, base is used to define the log space basis. If *endpoint* is True, *stop* will be the last retruned value, as long ...
kerncraft/kerncraft.py
def space(start, stop, num, endpoint=True, log=False, base=10): """ Return list of evenly spaced integers over an interval. Numbers can either be evenly distributed in a linear space (if *log* is False) or in a log space (if *log* is True). If *log* is True, base is used to define the log space basis. ...
def space(start, stop, num, endpoint=True, log=False, base=10): """ Return list of evenly spaced integers over an interval. Numbers can either be evenly distributed in a linear space (if *log* is False) or in a log space (if *log* is True). If *log* is True, base is used to define the log space basis. ...
[ "Return", "list", "of", "evenly", "spaced", "integers", "over", "an", "interval", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/kerncraft.py#L24-L52
[ "def", "space", "(", "start", ",", "stop", ",", "num", ",", "endpoint", "=", "True", ",", "log", "=", "False", ",", "base", "=", "10", ")", ":", "assert", "type", "(", "start", ")", "is", "int", "and", "type", "(", "stop", ")", "is", "int", "an...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
get_last_modified_datetime
Return datetime object of latest change in kerncraft module directory.
kerncraft/kerncraft.py
def get_last_modified_datetime(dir_path=os.path.dirname(__file__)): """Return datetime object of latest change in kerncraft module directory.""" max_mtime = 0 for root, dirs, files in os.walk(dir_path): for f in files: p = os.path.join(root, f) try: max_mtime ...
def get_last_modified_datetime(dir_path=os.path.dirname(__file__)): """Return datetime object of latest change in kerncraft module directory.""" max_mtime = 0 for root, dirs, files in os.walk(dir_path): for f in files: p = os.path.join(root, f) try: max_mtime ...
[ "Return", "datetime", "object", "of", "latest", "change", "in", "kerncraft", "module", "directory", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/kerncraft.py#L70-L80
[ "def", "get_last_modified_datetime", "(", "dir_path", "=", "os", ".", "path", ".", "dirname", "(", "__file__", ")", ")", ":", "max_mtime", "=", "0", "for", "root", ",", "dirs", ",", "files", "in", "os", ".", "walk", "(", "dir_path", ")", ":", "for", ...
c60baf8043e4da8d8d66da7575021c2f4c6c78af
test
create_parser
Return argparse parser.
kerncraft/kerncraft.py
def create_parser(): """Return argparse parser.""" parser = argparse.ArgumentParser( description='Analytical performance modelling and benchmarking toolkit.', epilog='For help, examples, documentation and bug reports go to:\nhttps://github.com' '/RRZE-HPC/kerncraft\nLicense: AGPLv...
def create_parser(): """Return argparse parser.""" parser = argparse.ArgumentParser( description='Analytical performance modelling and benchmarking toolkit.', epilog='For help, examples, documentation and bug reports go to:\nhttps://github.com' '/RRZE-HPC/kerncraft\nLicense: AGPLv...
[ "Return", "argparse", "parser", "." ]
RRZE-HPC/kerncraft
python
https://github.com/RRZE-HPC/kerncraft/blob/c60baf8043e4da8d8d66da7575021c2f4c6c78af/kerncraft/kerncraft.py#L126-L186
[ "def", "create_parser", "(", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "'Analytical performance modelling and benchmarking toolkit.'", ",", "epilog", "=", "'For help, examples, documentation and bug reports go to:\\nhttps://github.com'", ...
c60baf8043e4da8d8d66da7575021c2f4c6c78af