text stringlengths 81 112k |
|---|
Image for :meth`.Surface.subdivide` docstring.
def surface_subdivide1():
"""Image for :meth`.Surface.subdivide` docstring."""
if NO_IMAGES:
return
surface = bezier.Surface.from_nodes(
np.asfortranarray([[0.0, 1.0, 0.0], [0.0, 0.0, 1.0]])
)
surf_a, surf_b, surf_c, surf_d = surface.s... |
Image for :meth`.Surface.subdivide` docstring.
def surface_subdivide2(surface, sub_surface_b):
"""Image for :meth`.Surface.subdivide` docstring."""
if NO_IMAGES:
return
# Plot set-up.
figure = plt.figure()
ax = figure.gca()
colors = seaborn.husl_palette(6)
N = 128
s_vals = np.l... |
Image for :class`.CurvedPolygon` docstring.
def curved_polygon_constructor1(curved_poly):
"""Image for :class`.CurvedPolygon` docstring."""
if NO_IMAGES:
return
ax = curved_poly.plot(256)
ax.axis("scaled")
ax.set_xlim(-0.125, 2.125)
ax.set_ylim(-0.625, 1.625)
save_image(ax.figure, ... |
Image for :meth`.Curve.specialize` docstring.
def curve_specialize(curve, new_curve):
"""Image for :meth`.Curve.specialize` docstring."""
if NO_IMAGES:
return
ax = curve.plot(256)
interval = r"$\left[0, 1\right]$"
line = ax.lines[-1]
line.set_label(interval)
color1 = line.get_color... |
Image for :func:`._surface_helpers.newton_refine` docstring.
def newton_refine_surface(surface, x_val, y_val, s, t, new_s, new_t):
"""Image for :func:`._surface_helpers.newton_refine` docstring."""
if NO_IMAGES:
return
figure, (ax1, ax2) = plt.subplots(1, 2)
# Plot features of the parameter sp... |
Image for :func:`._surface_helpers.classify_intersection` docstring.
def classify_intersection1(s, curve1, tangent1, curve2, tangent2):
"""Image for :func:`._surface_helpers.classify_intersection` docstring."""
if NO_IMAGES:
return
surface1 = bezier.Surface.from_nodes(
np.asfortranarray(
... |
Image for :func:`._surface_helpers.classify_intersection` docstring.
def classify_intersection2(s, curve1, curve2):
"""Image for :func:`._surface_helpers.classify_intersection` docstring."""
if NO_IMAGES:
return
surface1 = bezier.Surface.from_nodes(
np.asfortranarray(
[[1.0, 1.... |
Image for :func:`._surface_helpers.classify_intersection` docstring.
def classify_intersection5(s, curve1, curve2):
"""Image for :func:`._surface_helpers.classify_intersection` docstring."""
if NO_IMAGES:
return
surface1 = bezier.Surface.from_nodes(
np.asfortranarray(
[
... |
Image for :func:`._surface_helpers.classify_intersection` docstring.
def classify_intersection7(s, curve1a, curve1b, curve2):
"""Image for :func:`._surface_helpers.classify_intersection` docstring."""
if NO_IMAGES:
return
surface1 = bezier.Surface.from_nodes(
np.asfortranarray(
... |
Image for :func:`get_curvature` docstring.
def get_curvature(nodes, s, tangent_vec, curvature):
"""Image for :func:`get_curvature` docstring."""
if NO_IMAGES:
return
curve = bezier.Curve.from_nodes(nodes)
# Find the center of the circle along the direction
# perpendicular to the tangent ve... |
Image for :meth`.Curve.locate` docstring.
def curve_locate(curve, point1, point2, point3):
"""Image for :meth`.Curve.locate` docstring."""
if NO_IMAGES:
return
ax = curve.plot(256)
points = np.hstack([point1, point2, point3])
ax.plot(
points[0, :], points[1, :], color="black", line... |
Image for :func:`._curve_helpers.newton_refine` docstring.
def newton_refine_curve(curve, point, s, new_s):
"""Image for :func:`._curve_helpers.newton_refine` docstring."""
if NO_IMAGES:
return
ax = curve.plot(256)
ax.plot(point[0, :], point[1, :], marker="H")
wrong_points = curve.evaluate... |
Image for :func:`._curve_helpers.newton_refine` docstring.
def newton_refine_curve_cusp(curve, s_vals):
"""Image for :func:`._curve_helpers.newton_refine` docstring."""
if NO_IMAGES:
return
ax = curve.plot(256)
ax.lines[-1].zorder = 1
points = curve.evaluate_multi(np.asfortranarray(s_vals)... |
Image for :func:`._surface_helpers.classify_intersection` docstring.
def classify_intersection8(s, curve1, surface1, curve2, surface2):
"""Image for :func:`._surface_helpers.classify_intersection` docstring."""
if NO_IMAGES:
return
ax = classify_help(s, curve1, surface1, curve2, surface2, None)
... |
The edges for the curved polygon intersection used below.
Helper for :func:`classify_intersection9`.
def _edges_classify_intersection9():
"""The edges for the curved polygon intersection used below.
Helper for :func:`classify_intersection9`.
"""
edges1 = (
bezier.Curve.from_nodes(
... |
Image for :func:`._surface_helpers.classify_intersection` docstring.
def classify_intersection9(s, curve1, curve2):
"""Image for :func:`._surface_helpers.classify_intersection` docstring."""
if NO_IMAGES:
return
surface1 = bezier.Surface.from_nodes(
np.asfortranarray(
[
... |
Image for :meth:`.curve.Curve.elevate` docstring.
def curve_elevate(curve, elevated):
"""Image for :meth:`.curve.Curve.elevate` docstring."""
if NO_IMAGES:
return
figure, (ax1, ax2) = plt.subplots(1, 2)
curve.plot(256, ax=ax1)
color = ax1.lines[-1].get_color()
add_patch(ax1, curve._nod... |
Image for :class:`.surface.Surface` docstring.
def unit_triangle():
"""Image for :class:`.surface.Surface` docstring."""
if NO_IMAGES:
return
nodes = np.asfortranarray([[0.0, 1.0, 0.0], [0.0, 0.0, 1.0]])
surface = bezier.Surface(nodes, degree=1)
ax = surface.plot(256)
ax.axis("scaled")... |
Image for :meth:`.curve.Curve.reduce` docstring.
def curve_reduce(curve, reduced):
"""Image for :meth:`.curve.Curve.reduce` docstring."""
if NO_IMAGES:
return
figure, (ax1, ax2) = plt.subplots(1, 2, sharex=True, sharey=True)
curve.plot(256, ax=ax1)
color = ax1.lines[-1].get_color()
add... |
Image for :meth:`.curve.Curve.reduce` docstring.
def curve_reduce_approx(curve, reduced):
"""Image for :meth:`.curve.Curve.reduce` docstring."""
if NO_IMAGES:
return
ax = curve.plot(256)
color = ax.lines[-1].get_color()
add_patch(ax, curve._nodes, color, alpha=0.25, node_color=color)
r... |
r"""Helper for :func:`newton_refine`.
We have a system:
.. code-block:: rest
[A C][ds] = [E]
[B D][dt] [F]
This is not a typo, ``A->B->C->D`` matches the data in ``jac_both``.
We solve directly rather than using a linear algebra utility:
.. code-block:: rest
ds = (D E - ... |
r"""Refine a solution to :math:`B(s, t) = p` using Newton's method.
.. note::
There is also a Fortran implementation of this function, which
will be used if it can be built.
Computes updates via
.. math::
\left[\begin{array}{c}
0 \\ 0 \end{array}\right] \approx
... |
Update list of candidate surfaces during geometric search for a point.
.. note::
This is used **only** as a helper for :func:`locate_point`.
Checks if the point ``(x_val, y_val)`` is contained in the ``candidate``
surface. If not, this function does nothing. If the point is contaned,
the four ... |
Take the mean of all centroids in set of reference triangles.
.. note::
This is used **only** as a helper for :func:`locate_point`.
Args:
candidates (List[Tuple[float, float, float, numpy.ndarray]): List of
4-tuples, each of which has been produced by :func:`locate_point`.
... |
r"""Locate a point on a surface.
.. note::
There is also a Fortran implementation of this function, which
will be used if it can be built.
Does so by recursively subdividing the surface and rejecting
sub-surfaces with bounding boxes that don't contain the point.
After the sub-surfaces a... |
Check if two intersections are close to machine precision.
.. note::
This is a helper used only by :func:`verify_duplicates`, which in turn
is only used by :func:`generic_intersect`.
Args:
intersection1 (.Intersection): The first intersection.
intersection2 (.Intersection): The ... |
Verify that a set of intersections had expected duplicates.
.. note::
This is a helper used only by :func:`generic_intersect`.
Args:
duplicates (List[.Intersection]): List of intersections
corresponding to duplicates that were filtered out.
uniques (List[.Intersection]): Li... |
Verify that the edge segments in an intersection are valid.
.. note::
This is a helper used only by :func:`generic_intersect`.
Args:
edge_infos (Optional[list]): List of "edge info" lists. Each list
represents a curved polygon and contains 3-tuples of edge index,
start ... |
Add intersection that is ``COINCIDENT_UNUSED`` but on an edge end.
This is a helper for :func:`~._surface_intersection.add_intersection`.
It assumes that
* ``intersection`` will have at least one of ``s == 0.0`` or ``t == 0.0``
* A "misclassified" intersection in ``intersections`` that matches
`... |
Check if a "valid" ``intersection`` is already in ``intersections``.
This assumes that
* ``intersection`` will have at least one of ``s == 0.0`` or ``t == 0.0``
* At least one of the intersections in ``intersections`` is classified as
``COINCIDENT_UNUSED``.
Args:
intersection (.Intersec... |
Create an :class:`Intersection` and append.
The intersection will be classified as either a duplicate or a valid
intersection and appended to one of ``duplicates`` or ``intersections``
depending on that classification.
Args:
index1 (int): The index (among 0, 1, 2) of the first edge in the
... |
r"""Determine if coincident parameters are "unused".
.. note::
This is a helper for :func:`surface_intersections`.
In the case that ``coincident`` is :data:`True`, then we'll have two
sets of parameters :math:`(s_1, t_1)` and :math:`(s_2, t_2)`.
If one of :math:`s1 < s2` or :math:`t1 < t2` is... |
Check if an intersection can be used as part of a curved polygon.
Will return :data:`True` if the intersection is classified as
:attr:`~.IntersectionClassification.FIRST`,
:attr:`~.IntersectionClassification.SECOND` or
:attr:`~.IntersectionClassification.COINCIDENT` or if the intersection
is classi... |
Find all intersections among edges of two surfaces.
This treats intersections which have ``s == 1.0`` or ``t == 1.0``
as duplicates. The duplicates may be checked by the caller, e.g.
by :func:`verify_duplicates`.
Args:
edge_nodes1 (Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]): The
... |
r"""Find all intersections among edges of two surfaces.
This treats intersections which have ``s == 1.0`` or ``t == 1.0``
as duplicates. The duplicates will be checked by :func:`verify_duplicates`
if ``verify`` is :data:`True`.
Args:
nodes1 (numpy.ndarray): The nodes defining the first surface... |
r"""Find all intersections among edges of two surfaces.
.. note::
There is also a Fortran implementation of this function, which
will be used if it can be built.
Uses :func:`generic_intersect` with the
:attr:`~.IntersectionStrategy.GEOMETRIC` intersection strategy.
Args:
nodes1... |
r"""Find all intersections among edges of two surfaces.
Uses :func:`generic_intersect` with the
:attr:`~.IntersectionStrategy.ALGEBRAIC` intersection strategy.
Args:
nodes1 (numpy.ndarray): The nodes defining the first surface in
the intersection (assumed in :math:\mathbf{R}^2`).
... |
Modify the module search path.
def modify_path():
"""Modify the module search path."""
# Only modify path on Windows.
if os.name != "nt":
return
path = os.environ.get("PATH")
if path is None:
return
try:
extra_dll_dir = pkg_resources.resource_filename("bezier", "extra-... |
Allow or re-raise an import error.
This is to distinguish between expected and unexpected import errors.
If the module is not found, it simply means the Cython / Fortran speedups
were not built with the package. If the error message is different, e.g.
``... undefined symbol: __curve_intersection_MOD_al... |
Checks if the current build is ``gfortran`` on macOS.
Args:
f90_compiler (numpy.distutils.fcompiler.FCompiler): A Fortran compiler
instance.
Returns:
bool: Only :data:`True` if
* Current OS is macOS (checked via ``sys.platform``).
* ``f90_compiler`` corresponds to ... |
Patch up ``f90_compiler.library_dirs``.
On macOS, a Homebrew installed ``gfortran`` needs some help. The
``numpy.distutils`` "default" constructor for ``Gnu95FCompiler`` only has
a single library search path, but there are many library paths included in
the full ``gcc`` install.
Args:
f90_... |
Convert a description of edges into a curved polygon.
.. note::
This is a helper used only by :meth:`.Surface.intersect`.
Args:
edge_info (Tuple[Tuple[int, float, float], ...]): Information
describing each edge in the curved polygon by indicating which
surface / edge on... |
Create a :class:`.Surface` from nodes.
Computes the ``degree`` based on the shape of ``nodes``.
Args:
nodes (numpy.ndarray): The nodes in the surface. The columns
represent each node while the rows are the dimension
of the ambient space.
_copy (b... |
Get the degree of the current surface.
Args:
num_nodes (int): The number of control points for a
B |eacute| zier surface.
Returns:
int: The degree :math:`d` such that :math:`(d + 1)(d + 2)/2`
equals ``num_nodes``.
Raises:
ValueEr... |
r"""The area of the current surface.
For surfaces in :math:`\mathbf{R}^2`, this computes the area via
Green's theorem. Using the vector field :math:`\mathbf{F} =
\left[-y, x\right]^T`, since :math:`\partial_x(x) - \partial_y(-y) = 2`
Green's theorem says twice the area is equal to
... |
Compute the edges of the current surface.
Returns:
Tuple[~curve.Curve, ~curve.Curve, ~curve.Curve]: The edges of
the surface.
def _compute_edges(self):
"""Compute the edges of the current surface.
Returns:
Tuple[~curve.Curve, ~curve.Curve, ~curve.Curve]: Th... |
Get the edges for the current surface.
If they haven't been computed yet, first compute and store them.
This is provided as a means for internal calls to get the edges
without copying (since :attr:`.edges` copies before giving to
a user to keep the stored data immutable).
Retu... |
The edges of the surface.
.. doctest:: surface-edges
:options: +NORMALIZE_WHITESPACE
>>> nodes = np.asfortranarray([
... [0.0, 0.5 , 1.0, 0.1875, 0.625, 0.0],
... [0.0, -0.1875, 0.0, 0.5 , 0.625, 1.0],
... ])
>>> surface = bezier.S... |
Verifies that weights are barycentric and on the reference triangle.
I.e., checks that they sum to one and are all non-negative.
Args:
lambda1 (float): Parameter along the reference triangle.
lambda2 (float): Parameter along the reference triangle.
lambda3 (float): ... |
r"""Compute a point on the surface.
Evaluates :math:`B\left(\lambda_1, \lambda_2, \lambda_3\right)`.
.. image:: ../../images/surface_evaluate_barycentric.png
:align: center
.. testsetup:: surface-barycentric, surface-barycentric-fail1,
surface-barycentric-fai... |
r"""Compute multiple points on the surface.
Assumes ``param_vals`` has three columns of barycentric coordinates.
See :meth:`evaluate_barycentric` for more details on how each row of
parameter values is evaluated.
.. image:: ../../images/surface_evaluate_barycentric_multi.png
... |
Verifies that a point is in the reference triangle.
I.e., checks that they sum to <= one and are each non-negative.
Args:
s (float): Parameter along the reference triangle.
t (float): Parameter along the reference triangle.
Raises:
ValueError: If the point ... |
r"""Compute a point on the surface.
Evaluates :math:`B\left(1 - s - t, s, t\right)` by calling
:meth:`evaluate_barycentric`:
This method acts as a (partial) inverse to :meth:`locate`.
.. testsetup:: surface-cartesian
import numpy as np
import bezier
.. ... |
r"""Compute multiple points on the surface.
Assumes ``param_vals`` has two columns of Cartesian coordinates.
See :meth:`evaluate_cartesian` for more details on how each row of
parameter values is evaluated.
.. image:: ../../images/surface_evaluate_cartesian_multi.png
:align:... |
Plot the current surface.
Args:
pts_per_edge (int): Number of points to plot per edge.
color (Optional[Tuple[float, float, float]]): Color as RGB profile.
ax (Optional[matplotlib.artist.Artist]): matplotlib axis object
to add plot to.
with_nodes (... |
r"""Split the surface into four sub-surfaces.
Does so by taking the unit triangle (i.e. the domain
of the surface) and splitting it into four sub-triangles
.. image:: ../../images/surface_subdivide1.png
:align: center
Then the surface is re-parameterized via the map to / fr... |
r"""Determines if the current surface is "valid".
Does this by checking if the Jacobian of the map from the
reference triangle is everywhere positive.
Returns:
bool: Flag indicating if the current surface is valid.
Raises:
NotImplementedError: If the surface is... |
r"""Find a point on the current surface.
Solves for :math:`s` and :math:`t` in :math:`B(s, t) = p`.
This method acts as a (partial) inverse to :meth:`evaluate_cartesian`.
.. warning::
A unique solution is only guaranteed if the current surface is
valid. This code assume... |
Find the common intersection with another surface.
Args:
other (Surface): Other surface to intersect with.
strategy (Optional[~bezier.curve.IntersectionStrategy]): The
intersection algorithm to use. Defaults to geometric.
_verify (Optional[bool]): Indicates i... |
r"""Return a degree-elevated version of the current surface.
Does this by converting the current nodes
:math:`\left\{v_{i, j, k}\right\}_{i + j + k = d}` to new nodes
:math:`\left\{w_{i, j, k}\right\}_{i + j + k = d + 1}`. Does so
by re-writing
.. math::
E\left(\lam... |
r"""Apply one step of 2D Newton's method.
.. note::
There is also a Fortran implementation of this function, which
will be used if it can be built.
We want to use Newton's method on the function
.. math::
F(s, t) = B_1(s) - B_2(t)
to refine :math:`\left(s_{\ast}, t_{\ast}\righ... |
r"""Perform a Newton iteration.
In this function, we assume that :math:`s` and :math:`t` are nonzero,
this makes convergence easier to detect since "relative error" at
``0.0`` is not a useful measure.
There are several tolerance / threshold quantities used below:
* :math:`10` (:attr:`MAX_NEWTON_I... |
r"""Perform a Newton iteration until convergence to a solution.
This is the "implementation" for :func:`full_newton`. In this
function, we assume that :math:`s` and :math:`t` are nonzero.
Args:
s (float): The parameter along the first curve where the iteration
will start.
nodes... |
r"""Perform a Newton iteration until convergence to a solution.
This assumes :math:`s` and :math:`t` are sufficiently close to an
intersection. It **does not** govern the maximum distance away
that the solution can lie, though the subdivided intervals that contain
:math:`s` and :math:`t` could be used.... |
Get the library directory paths for ``gfortran``.
Looks for ``libraries: =`` in the output of ``gfortran -print-search-dirs``
and then parses the paths. If this fails for any reason, this method will
print an error and return ``library_dirs``.
Args:
library_dirs (List[str]): Existing library d... |
Update a given set of compiler flags.
Args:
compiler_flags (List[str]): Existing flags associated with a compiler.
remove_flags (Optional[Container[str]]): A container of flags to remove
that will override any of the defaults.
Returns:
List[str]: The modified list (i.e. som... |
Patch up ``f90_compiler``.
For now, only updates the flags for ``gfortran``. In this case, it add
any of ``GFORTRAN_SHARED_FLAGS`` that are missing. In debug mode, it also
adds any flags in ``GFORTRAN_DEBUG_FLAGS`` and makes sure none of the flags
in ``GFORTRAN_OPTIMIZE_FLAGS`` are present. In standard... |
Capture calls to the system by compilers.
See: https://github.com/numpy/numpy/blob/v1.15.2/\
numpy/distutils/ccompiler.py#L154
Intercepts all calls to ``CCompiler.spawn`` and keeps the
arguments around to be stored in the local ``commands``
instance attribute.
def start_journa... |
Save journaled commands to file.
If there is no active journal, does nothing.
If saving the commands to a file fails, a message will be printed to
STDERR but the failure will be swallowed so that the extension can
be built successfully.
def save_journal(self):
"""Save journale... |
Create a static library (i.e. a ``.a`` / ``.lib`` file).
Args:
obj_files (List[str]): List of paths of compiled object files.
def _default_static_lib(self, obj_files):
"""Create a static library (i.e. a ``.a`` / ``.lib`` file).
Args:
obj_files (List[str]): List of path... |
Default cleanup after :meth:`run`.
For in-place builds, moves the built shared library into the source
directory.
def _default_cleanup(self):
"""Default cleanup after :meth:`run`.
For in-place builds, moves the built shared library into the source
directory.
"""
... |
Verify a pair of sides share an endpoint.
.. note::
This currently checks that edge endpoints match **exactly**
but allowing some roundoff may be desired.
Args:
prev (.Curve): "Previous" curve at piecewise junction.
curr (.Curve): "Next" curve at piecewis... |
Verify that the edges define a curved polygon.
This may not be entirely comprehensive, e.g. won't check
self-intersection of the defined polygon.
.. note::
This currently checks that edge endpoints match **exactly**
but allowing some roundoff may be desired.
Rai... |
r"""The area of the current curved polygon.
This assumes, but does not check, that the current curved polygon
is valid (i.e. it is bounded by the edges).
This computes the area via Green's theorem. Using the vector field
:math:`\mathbf{F} = \left[-y, x\right]^T`, since
:math:`\... |
Plot the current curved polygon.
Args:
pts_per_edge (int): Number of points to plot per curved edge.
color (Optional[Tuple[float, float, float]]): Color as RGB profile.
ax (Optional[matplotlib.artist.Artist]): matplotlib axis object
to add plot to.
R... |
Compute the implicit form of the line connecting curve endpoints.
.. note::
This assumes, but does not check, that the first and last nodes
in ``nodes`` are different.
Computes :math:`a, b` and :math:`c` in the normalized implicit equation
for the line
.. math::
ax + by + c = 0... |
Compute the "fat line" around a B |eacute| zier curve.
Both computes the implicit (normalized) form
.. math::
ax + by + c = 0
for the line connecting the first and last node in ``nodes``.
Also computes the maximum and minimum distances to that line
from each control point.
Args:
... |
Update clipped parameter range.
.. note::
This is a helper for :func:`clip_range`.
Does so by intersecting one of the two fat lines with an edge
of the convex hull of the distance polynomial of the curve being
clipped.
If both of ``s_min`` and ``s_max`` are "unset", then any :math:`s`
... |
r"""Performs a final check on a clipped parameter range.
.. note::
This is a helper for :func:`clip_range`.
If both values are unchanged from the "unset" default, this returns
the whole interval :math:`\left[0.0, 1.0\right]`.
If only one of the values is set to some parameter :math:`s`, this
... |
r"""Reduce the parameter range where two curves can intersect.
Does so by using the "fat line" for ``nodes1`` and computing the
distance polynomial against ``nodes2``.
.. note::
This assumes, but does not check that the curves being considered
will only have one intersection in the paramete... |
Post-process a generated journal file on Travis macOS.
Args:
journal_filename (str): The name of the journal file.
def post_process_travis_macos(journal_filename):
"""Post-process a generated journal file on Travis macOS.
Args:
journal_filename (str): The name of the journal file.
"""... |
Convert Sphinx ``:mod:`` to plain reST link.
Args:
match (_sre.SRE_Match): A match (from ``re``) to be used
in substitution.
sphinx_modules (list): List to be track the modules that have been
encountered.
Returns:
str: The ``match`` converted to a link.
def mod... |
Convert Sphinx ``:doc:`` to plain reST link.
Args:
match (_sre.SRE_Match): A match (from ``re``) to be used
in substitution.
sphinx_docs (list): List to be track the documents that have been
encountered.
Returns:
str: The ``match`` converted to a link.
def doc_... |
Get a diff between two strings.
Args:
value1 (str): First string to be compared.
value2 (str): Second string to be compared.
name1 (str): Name of the first string.
name2 (str): Name of the second string.
Returns:
str: The full diff.
def get_diff(value1, value2, name1, ... |
Populate README template with values.
Args:
revision (str): The branch, commit, etc. being referred to (e.g.
``master``).
rtd_version (str): The version to use for RTD (Read the Docs) links
(e.g. ``latest``).
extra_kwargs (Dict[str, str]): Over-ride for template argu... |
Populate the template and compare to ``README``.
Raises:
ValueError: If the current README doesn't agree with the expected
value computed from the template.
def readme_verify():
"""Populate the template and compare to ``README``.
Raises:
ValueError: If the current README doesn... |
Specialize the template to a PyPI release template.
Once populated, compare to ``README.rst.release.template``.
Raises:
ValueError: If the current template doesn't agree with the expected
value specialized from the template.
def release_readme_verify():
"""Specialize the template to a... |
Populate the template and compare to documentation index file.
Used for both ``docs/index.rst`` and ``docs/index.rst.release.template``.
Args:
index_file (str): Filename to compare against.
extra_kwargs (Dict[str, str]): Over-ride for template arguments.
One **special** keyword is ... |
Updates the template so that curly braces are escaped correctly.
Args:
content (str): The template for ``docs/index.rst.release.template``.
Returns:
str: The updated template with properly escaped curly braces.
def release_docs_side_effect(content):
"""Updates the template so that curly b... |
Populate template and compare to ``docs/index.rst.release.template``.
Raises:
ValueError: If the current ``index.rst.release.template`` doesn't
agree with the expected value computed from the template.
def release_docs_index_verify():
"""Populate template and compare to ``docs/index.rst.re... |
Populate template and compare to ``DEVELOPMENT.rst``
Raises:
ValueError: If the current ``DEVELOPMENT.rst`` doesn't
agree with the expected value computed from the template.
def development_verify():
"""Populate template and compare to ``DEVELOPMENT.rst``
Raises:
ValueError: I... |
Populate the template and compare to ``binary-extension.rst``.
Raises:
ValueError: If the current ``docs/python/binary-extension.rst`` doesn't
agree with the expected value computed from the template.
def native_libraries_verify():
"""Populate the template and compare to ``binary-extension... |
Helper for :func:`evaluate` when ``nodes`` is degree 3.
Args:
nodes (numpy.ndarray): ``2 x 4`` array of nodes in a curve.
x_val (float): ``x``-coordinate for evaluation.
y_val (float): ``y``-coordinate for evaluation.
Returns:
float: The computed value of :math:`f(x, y)`.
def ... |
r"""Evaluate the implicitized bivariate polynomial containing the curve.
Assumes `algebraic curve`_ containing :math:`B(s, t)` is given by
:math:`f(x, y) = 0`. This function evaluates :math:`f(x, y)`.
.. note::
This assumes, but doesn't check, that ``nodes`` has 2 rows.
.. note::
This... |
r"""Evaluates a parametric curve **on** an implicitized algebraic curve.
Uses :func:`evaluate` to evaluate :math:`f_1(x, y)`, the implicitization
of ``nodes1``. Then plugs ``t`` into the second parametric curve to
get an ``x``- and ``y``-coordinate and evaluate the
**intersection polynomial**:
.. ... |
r"""Compute the coefficients of an **intersection polynomial**.
Helper for :func:`to_power_basis` in the case that each curve is
degree one. In this case, B |eacute| zout's `theorem`_ tells us
that the **intersection polynomial** is degree :math:`1 \cdot 1`
hence we return two coefficients.
Args:
... |
r"""Compute the coefficients of an **intersection polynomial**.
Helper for :func:`to_power_basis` in the case that the first curve is
degree one and the second is degree two. In this case, B |eacute|
zout's `theorem`_ tells us that the **intersection polynomial** is
degree :math:`1 \cdot 2` hence we re... |
r"""Compute the coefficients of an **intersection polynomial**.
Helper for :func:`to_power_basis` in the case that the first curve is
degree one and the second is degree three. In this case, B |eacute|
zout's `theorem`_ tells us that the **intersection polynomial** is
degree :math:`1 \cdot 3` hence we ... |
r"""Compute the coefficients of an **intersection polynomial**.
Helper for :func:`to_power_basis` in the case that B |eacute| zout's
`theorem`_ tells us the **intersection polynomial** is degree
:math:`4`. This happens if the two curves have degrees two and two
or have degrees one and four.
Args:
... |
r"""Compute the coefficients of an **intersection polynomial**.
Helper for :func:`to_power_basis` in the case that the first curve is
degree two and the second is degree three. In this case, B |eacute|
zout's `theorem`_ tells us that the **intersection polynomial** is
degree :math:`2 \cdot 3` hence we ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.