GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — MAINT: Minor cleanup for auxfuncs · numpy/numpy@cbdcbb4

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • numpy/f2py
    • auxfuncs.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎numpy/f2py/auxfuncs.py‎

Copy file name to clipboardExpand all lines: numpy/f2py/auxfuncs.py
+19-19Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -958,31 +958,31 @@ def process_f2cmap_dict(f2cmap_all, new_map, c2py_map, verbose = False):
958958
"""
959959
f2cmap_mapped = []
960960

961-
new_map_lower = {}
962-
for k, d1 in new_map.items():
963-
d1_lower = {k1.lower(): v1 for k1, v1 in d1.items()}
964-
new_map_lower[k.lower()] = d1_lower
965-
966-
for k, d1 in new_map_lower.items():
967-
if k not in f2cmap_all:
968-
f2cmap_all[k] = {}
969-
970-
for k1, v1 in d1.items():
971-
if v1 in c2py_map:
972-
if k1 in f2cmap_all[k]:
961+
new_map_lower = {
962+
k.lower(): {k1.lower(): v1 for k1, v1 in d.items()}
963+
for k, d in new_map.items()
964+
}
965+
966+
for fortran_type, c_types in new_map_lower.items():
967+
if fortran_type not in f2cmap_all:
968+
f2cmap_all[fortran_type] = {}
969+
970+
for c_type, py_type in c_types.items():
971+
if py_type in c2py_map:
972+
if c_type in f2cmap_all[fortran_type]:
973973
outmess(
974-
"\tWarning: redefinition of {'%s':{'%s':'%s'->'%s'}}\n"
975-
% (k, k1, f2cmap_all[k][k1], v1)
974+
f"\tWarning: redefinition of '{{{fortran_type}:{{'{c_type}':'{f2cmap_all[fortran_type][c_type]}'->'{py_type}'}}}}\n"
976975
)
977-
f2cmap_all[k][k1] = v1
976+
f2cmap_all[fortran_type][c_type] = c2py_map[py_type]
978977
if verbose:
979-
outmess('\tMapping "%s(kind=%s)" to "%s"\n' % (k, k1, v1))
980-
f2cmap_mapped.append(v1)
978+
outmess(
979+
f'\tMapping "{fortran_type}(kind={c_type})" to "{py_type}"\n'
980+
)
981+
f2cmap_mapped.append(py_type)
981982
else:
982983
if verbose:
983984
errmess(
984-
"\tIgnoring map {'%s':{'%s':'%s'}}: '%s' must be in %s\n"
985-
% (k, k1, v1, v1, list(c2py_map.keys()))
985+
f"\tIgnoring map '{{{fortran_type}:{{'{c_type}':'{py_type}'}}}}': '{py_type}' must be in {list(c2py_map.keys())}\n"
986986
)
987987

988988
return f2cmap_all, f2cmap_mapped

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.