File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8686
8787myst_enable_extensions = ["dollarmath" , "amsmath" ]
8888
89+ def is_non_standard_version (version ):
90+ """
91+ Determine if the given version string has more than 3 components (e.g., from a developer version).
92+ """
93+
94+ return len (version .split ("." )) > 3
95+
8996# based on pandas doc/source/conf.py
9097def linkcode_resolve (domain , info ):
9198 """Determine the URL corresponding to Python object."""
@@ -136,10 +143,10 @@ def linkcode_resolve(domain, info):
136143
137144 fn = os .path .relpath (fn , start = os .path .dirname (plasticparcels .__file__ ))
138145
139- if "-" in plasticparcels .__version__ :
140- return f"https://github.com/OceanParcels/plasticparcels/blob/master /plasticparcels/{ fn } { linespec } "
146+ if is_non_standard_version ( plasticparcels .__version__ ) :
147+ return f"https://github.com/OceanParcels/plasticparcels/blob/main /plasticparcels/{ fn } { linespec } "
141148 else :
142149 return (
143150 f"https://github.com/OceanParcels/plasticparcels/blob/"
144- f"{ plasticparcels .__version__ } /plasticparcels/{ fn } { linespec } "
151+ f"v { plasticparcels .__version__ } /plasticparcels/{ fn } { linespec } "
145152 )
You can’t perform that action at this time.
0 commit comments