Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Links work, but "Could not match transformation" warning is shown #96

Closed
mgeier opened this issue Jan 14, 2022 · 3 comments
Closed

Links work, but "Could not match transformation" warning is shown #96

mgeier opened this issue Jan 14, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@mgeier
Copy link
Contributor

mgeier commented Jan 14, 2022

When enabling the sphinx_codeautolink extension at AudioSceneDescriptionFormat/splines#6, I'm getting this warning (see log: https://github.com/AudioSceneDescriptionFormat/splines/runs/4820248267):

/home/runner/work/splines/splines/_build/html/euclidean/piecewise-monotone.html.rst: WARNING: Could not match transformation of `` on source lines 5-5, source:
def compare_pchip(values, times):
    plot_times = np.linspace(times[0], times[-1], 100)
    plt.plot(
        plot_times,
        PchipInterpolator(times, values)(plot_times),
        label='PCHIP')
    plt.plot(
        plot_times,
        splines.PiecewiseMonotoneCubic(values, times).evaluate(plot_times),
        label='PiecewiseMonotoneCubic')
    plt.legend()
    grid_lines(x=times)

I'm getting the same warning locally, on Github Actions and on RTD (https://readthedocs.org/projects/splines/builds/15774840/), however, the generated HTML page seems to contain the correct links: https://splines--6.org.readthedocs.build/en/6/euclidean/piecewise-monotone.html#More-Examples

On RTD, I'm getting additional warnings (which I don't get locally nor on Github Actions):

/home/docs/checkouts/readthedocs.org/user_builds/splines/checkouts/6/doc/_build/html/euclidean/catmull-rom-uniform.html.rst: WARNING: Could not match transformation of `T` on source lines 1-1, source:
b_CR = sp.Matrix([
    expr.subs(t, t + cond.args[1] - 1)
    for expr, cond in C01.args[1:-1][::-1]]).T
b_CR.T
/home/docs/checkouts/readthedocs.org/user_builds/splines/checkouts/6/doc/_build/html/rotation/end-conditions-natural.html.rst: WARNING: Could not match transformation of `evaluate` on source lines 3-3, source:
def calculate_rotations(control_quaternions):
    times = np.linspace(0, 1, 50)
    return DeCasteljau(
        segments=[control_quaternions],
    ).evaluate(times)

Again, the links seem to be working fine:

https://splines--6.org.readthedocs.build/en/6/euclidean/catmull-rom-uniform.html#Basis-Polynomials

https://splines--6.org.readthedocs.build/en/6/rotation/end-conditions-natural.html#Examples

If the example is too complicated to reproduce, I can try to come up with a more minimal example.

@mgeier mgeier added the bug Something isn't working label Jan 14, 2022
@felix-hilden
Copy link
Owner

felix-hilden commented Jan 14, 2022

Oh that might just be the double call on line 5! Haven't probably taken into account that it's perfectly valid as well. So now we're trying to link the empty string between the calls.

@felix-hilden
Copy link
Owner

Yep, that's it, and the second call target doesn't even have to be valid type hint wise.

As to your other errors: I suspect updating the Python version of your RTD build will fix them, because the AST module provides better line number ranges for multiline statements from 3.8+ But let me know if the issues persist!

@mgeier
Copy link
Contributor Author

mgeier commented Jan 15, 2022

Thanks for fixing this so quickly!

As to your other errors: I suspect updating the Python version of your RTD build will fix them, because the AST module provides better line number ranges for multiline statements from 3.8+

Indeed!

RTD was using Python 3.7, but I just found out that there is a new way to specify the Python version on RTD: https://docs.readthedocs.io/en/stable/config-file/v2.html#build-tools-python

With this I can use Python 3.10 and the additional warnings are gone!

BTW, the warnings refer to nonsensical files, see #99.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants