Skip to content

"View on github" links not working #2456

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

Open
cwhanse opened this issue May 17, 2025 · 3 comments
Open

"View on github" links not working #2456

cwhanse opened this issue May 17, 2025 · 3 comments

Comments

@cwhanse
Copy link
Member

cwhanse commented May 17, 2025

Some "View on github" links return "page not found" or direct to lines different from the source function.

To Reproduce
I tested three links:

For pvsystem.v_from_i the "View on github" link directs to these lines in the max_power_pt function.

For pvsystem.max_power_point the "View on github" link directs to these lines.

For ivtools.sdm.pvsyst_temperature_coeff the "View on github" link returns page not found.

@echedey-ls
Copy link
Contributor

The reason is that there have been PRs that added content before those lines, shifting the content down when there were additions between last release (the time those line numbers were taken, and the current main).

For pvsystem.v_from_i the "View on github" link directs to these lines in the max_power_pt function.

For pvsystem.max_power_point the "View on github" link directs to these lines.

#2434, #2433, #2435 and #2428 side effect

For ivtools.sdm.pvsyst_temperature_coeff the "View on github" link returns page not found.

#2256 side effect

I will have a look at it (I would expect Sphinx to link to the latest version commit SHA).

@cwhanse
Copy link
Member Author

cwhanse commented May 17, 2025

@echedey-ls yup, when I switch my RTD view from "stable" to "latest", the links work correctly. I'm OK if this issue is closed with nothing to fix, if that's your assessment.

@kandersolar
Copy link
Member

I will have a look at it (I would expect Sphinx to link to the latest version commit SHA).

It's our own code actually. We overrode sphinx's behavior so that generated pages link to the relevant source code, even when the source code structure doesn't match the built website structure (see https://github.com/pvlib/pvlib-python/pull/913/files).

Anyway I think it should be possible to fix the issue @cwhanse encountered. Instead of hardcoding the link to the main branch here, we would have have some logic to point to either main (for latest) or the relevant github tag (for stable). I think RTD sets an environment variable we can use to determine which of those two options is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants