MCPcopy Index your code
hub / github.com/numpy/numpy / load_f2cmap_file

Function load_f2cmap_file

numpy/f2py/capi_maps.py:140–163  ·  view source on GitHub ↗
(f2cmap_file)

Source from the content-addressed store, hash-verified

138f2cmap_mapped = []
139
140def load_f2cmap_file(f2cmap_file):
141 global f2cmap_all, f2cmap_mapped
142
143 f2cmap_all = copy.deepcopy(f2cmap_default)
144
145 if f2cmap_file is None:
146 # Default value
147 f2cmap_file = '.f2py_f2cmap'
148 if not os.path.isfile(f2cmap_file):
149 return
150
151 # User defined additions to f2cmap_all.
152 # f2cmap_file must contain a dictionary of dictionaries, only. For
153 # example, {'real':{'low':'float'}} means that Fortran 'real(low)' is
154 # interpreted as C 'float'. This feature is useful for F90/95 users if
155 # they use PARAMETERS in type specifications.
156 try:
157 outmess(f'Reading f2cmap from {f2cmap_file!r} ...\n')
158 with open(f2cmap_file) as f:
159 d = eval(f.read().lower(), {}, {})
160 f2cmap_all, f2cmap_mapped = process_f2cmap_dict(f2cmap_all, d, c2py_map, True)
161 outmess('Successfully applied user defined f2cmap changes\n')
162 except Exception as msg:
163 errmess(f'Failed to apply user defined f2cmap changes: {msg}. Skipping.\n')
164
165
166cformat_map = {'double': '%g',

Callers

nothing calls this directly

Calls 6

openFunction · 0.85
process_f2cmap_dictFunction · 0.85
errmessFunction · 0.85
lowerMethod · 0.80
outmessFunction · 0.70
readMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…