-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathcf.pathjoin.html
More file actions
188 lines (149 loc) · 10.1 KB
/
cf.pathjoin.html
File metadata and controls
188 lines (149 loc) · 10.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<!DOCTYPE html>
<html lang="en" data-content_root="../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>cf.pathjoin — Documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=61cd365c" />
<link rel="stylesheet" type="text/css" href="../_static/alabaster.css?v=a5d0ad34" />
<link rel="stylesheet" type="text/css" href="../_static/graphviz.css?v=fd3f3429" />
<link rel="stylesheet" type="text/css" href="../_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="../_static/customise-alabaster.css?v=5dec66a6" />
<script src="../_static/documentation_options.js?v=b14d8abf"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/clipboard.min.js?v=a7894cd8"></script>
<script src="../_static/copybutton.js?v=b578dfe4"></script>
<script src="../_static/toggleprompt.js?v=1b41717f"></script>
<link rel="icon" href="../_static/favicon.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="cf.relaxed_identities" href="cf.relaxed_identities.html" />
<link rel="prev" title="cf.log_level" href="cf.log_level.html" />
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
</head><body>
<div class="document">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../index.html">
<img class="logo" src="../_static/logo.svg" alt="Logo"/>
</a></p>
<h1 class="logo"><a href="../index.html">cf 3.19.0</a></h1>
<p class="blurb">A CF-compliant earth science data analysis library</p>
<p>
<iframe src="https://ghbtns.com/github-btn.html?user=NCAS-CMS&repo=cf-python&type=star&count=true&size=large&v=2"
allowtransparency="true" frameborder="0" scrolling="0" width="200px" height="35px"></iframe>
</p>
<search id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../introduction.html"><strong>Introduction</strong></a></li>
<li class="toctree-l1"><a class="reference internal" href="../installation.html"><strong>Installation</strong></a></li>
<li class="toctree-l1"><a class="reference internal" href="../cheat_sheet.html"><strong>Cheat Sheet</strong></a></li>
<li class="toctree-l1"><a class="reference internal" href="../recipes/index.html"><strong>Recipes using cf</strong></a></li>
<li class="toctree-l1"><a class="reference internal" href="../tutorial.html"><strong>Tutorial</strong></a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../api_reference.html"><strong>API reference</strong></a></li>
<li class="toctree-l1"><a class="reference internal" href="../aggregation_rules.html"><strong>Aggregation rules</strong></a></li>
<li class="toctree-l1"><a class="reference internal" href="../performance.html"><strong>Performance</strong></a></li>
<li class="toctree-l1"><a class="reference internal" href="../releases.html"><strong>Releases</strong></a></li>
<li class="toctree-l1"><a class="reference internal" href="../Changelog.html"><strong>Change log</strong></a></li>
<li class="toctree-l1"><a class="reference internal" href="../contributing.html"><strong>Contributing</strong></a></li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li><a href="../api_reference.html"><strong>API reference</strong></a><ul>
<li><a href="../function.html"><strong>cf functions</strong></a><ul>
<li>Previous: <a href="cf.log_level.html" title="previous chapter">cf.log_level</a></li>
<li>Next: <a href="cf.relaxed_identities.html" title="next chapter">cf.relaxed_identities</a></li>
</ul></li>
</ul></li>
</ul></li>
</ul>
</div>
<br>
cf development has been supported by
the <a href="https://erc.europa.eu/">ERC</a>
through <a href="https://cordis.europa.eu/project/id/247220">Seachange</a>
and
<a href="https://cordis.europa.eu/project/id/786427">Couplet</a>; by
the <a href="https://ec.europa.eu/programmes/horizon2020/">EC Horizon
2020 programme</a> through
<a href="https://cordis.europa.eu/project/id/824084">IS-ENES3</a>;
by <a href="https://nerc.ukri.org/">NERC</a> through
<a href="https://gtr.ukri.org/project/0D95A6DB-0B95-48F7-8A8B-7B9A47DEA117">UKFAFMIP</a>;
and by <a href="https://ncas.ac.uk/">NCAS</a>.
<br>
<br>
<img src="../_static/logo_EC.png" height="40">
<img src="../_static/logo_ERC.png" height="40">
<img src="../_static/logo_NERC.png" height="40">
<br>
<img src="../_static/logo_NCAS.png" height="40">
</div>
</div>
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="cf-pathjoin">
<h1>cf.pathjoin<a class="headerlink" href="#cf-pathjoin" title="Link to this heading">¶</a></h1>
<dl class="py function">
<dt class="sig sig-object py" id="cf.pathjoin">
<span class="sig-prename descclassname"><span class="pre">cf.</span></span><span class="sig-name descname"><span class="pre">pathjoin</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">path2</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/NCAS-CMS/cf-python/blob/v3.19.0/cf/functions.py#L2791-L2827"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#cf.pathjoin" title="Link to this definition">¶</a></dt>
<dd><p>Join two file path components intelligently.</p>
<p>If either of the paths is a URL then a URL will be returned</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="cf.abspath.html#cf.abspath" title="cf.abspath"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cf.abspath</span></code></a>, <a class="reference internal" href="cf.dirname.html#cf.dirname" title="cf.dirname"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cf.dirname</span></code></a>, <a class="reference internal" href="cf.relpath.html#cf.relpath" title="cf.relpath"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cf.relpath</span></code></a></p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><dl class="simple">
<dt>path1: <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.14)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">str</span></code></a></dt><dd><p>The first component of the path.</p>
</dd>
<dt>path2: <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.14)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">str</span></code></a></dt><dd><p>The second component of the path.</p>
</dd>
</dl>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><dl class="simple">
<dt><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.14)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">str</span></code></a></dt><dd><p>The joined paths.</p>
</dd>
</dl>
</dd>
</dl>
<p><strong>Examples</strong></p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">cf</span><span class="o">.</span><span class="n">pathjoin</span><span class="p">(</span><span class="s1">'/data/archive'</span><span class="p">,</span> <span class="s1">'../archive/file.nc'</span><span class="p">)</span>
<span class="go">'/data/archive/../archive/file.nc'</span>
<span class="gp">>>> </span><span class="n">cf</span><span class="o">.</span><span class="n">pathjoin</span><span class="p">(</span><span class="s1">'/data/archive'</span><span class="p">,</span> <span class="s1">'../archive/file.nc'</span><span class="p">)</span>
<span class="go">'/data/archive/../archive/file.nc'</span>
<span class="gp">>>> </span><span class="n">cf</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">cf</span><span class="o">.</span><span class="n">pathjoin</span><span class="p">(</span><span class="s1">'/data/'</span><span class="p">,</span> <span class="s1">'archive/'</span><span class="p">))</span>
<span class="go">'/data/archive'</span>
<span class="gp">>>> </span><span class="n">cf</span><span class="o">.</span><span class="n">pathjoin</span><span class="p">(</span><span class="s1">'http://data'</span><span class="p">,</span> <span class="s1">'archive/file.nc'</span><span class="p">)</span>
<span class="go">'http://data/archive/file.nc'</span>
</pre></div>
</div>
</dd></dl>
</section>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
©2026, NCAS | Page built on 2026-01-19.
|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.3.7</a>
& <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>
</div>
</body>
</html>