MCPcopy Create free account
hub / github.com/numpy/numpy / njoin

Function njoin

numpy/distutils/misc_util.py:178–203  ·  view source on GitHub ↗

Join two or more pathname components + - convert a /-separated pathname to one using the OS's path separator. - resolve `..` and `.` from path. Either passing n arguments as in njoin('a','b'), or a sequence of n names as in njoin(['a','b']) is handled, or a mixture of such arguments

(*path)

Source from the content-addressed store, hash-verified

176 return d or '.'
177
178def njoin(*path):
179 """Join two or more pathname components +
180 - convert a /-separated pathname to one using the OS's path separator.
181 - resolve `..` and `.` from path.
182
183 Either passing n arguments as in njoin('a','b'), or a sequence
184 of n names as in njoin(['a','b']) is handled, or a mixture of such arguments.
185 """
186 paths = []
187 for p in path:
188 if is_sequence(p):
189 # njoin(['a', 'b'], 'c')
190 paths.append(njoin(*p))
191 else:
192 assert is_string(p)
193 paths.append(p)
194 path = paths
195 if not path:
196 # njoin()
197 joined = ''
198 else:
199 # njoin('a', 'b')
200 joined = os.path.join(*path)
201 if os.path.sep != '/':
202 joined = joined.replace('/', os.path.sep)
203 return minrelpath(joined)
204
205def get_mathlibs(path=None):
206 """Return the MATHLIB line from numpyconfig.h

Callers 11

_fix_pathsFunction · 0.85
__init__Method · 0.85
get_subpackageMethod · 0.85
add_extensionMethod · 0.85
_get_svn_revisionMethod · 0.85
_get_hg_revisionMethod · 0.85
get_versionMethod · 0.85
make_svn_version_pyMethod · 0.85
make_hg_version_pyMethod · 0.85
appendpathFunction · 0.85

Calls 5

is_sequenceFunction · 0.85
is_stringFunction · 0.85
minrelpathFunction · 0.85
replaceMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected