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 — BUG: Handle ``iso_c_type`` mappings more consistently by charris · Pull Request #25480 · numpy/numpy

BUG: Handle iso_c_type mappings more consistently #25480

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
charris merged 9 commits into numpy:maintenance/1.26.x from charris:backport-25226
Dec 23, 2023

Uh oh!

There was an error while loading. Please reload this page.

Merged

BUG: Handle iso_c_type mappings more consistently #25480

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit Hold shift + click to select a range
3e6606e
TST: Add one for gh-25207
HaoZeke Nov 22, 2023
d7e78b6
BUG: Work with the ISOC_BINDINGS more consisently
HaoZeke Nov 22, 2023
47dfd65
MAINT: Kill now unused deep-merge [f2py]
HaoZeke Nov 22, 2023
05d161f
ENH: Populate all maps for iso_c bindings
HaoZeke Nov 22, 2023
1e127aa
MAINT: Correctly return mapped types [f2py]
HaoZeke Nov 22, 2023
62676de
DOC: Add a note on the iso_c2py_map implementation
HaoZeke Nov 22, 2023
2368305
MAINT: Reduce chatter to pass tests
HaoZeke Nov 22, 2023
599e427
BUG: Map to types with bindings [f2py]
HaoZeke Nov 26, 2023
da7713d
TST: Add a another test for gh-25207
HaoZeke Nov 26, 2023
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Prev Previous commit
Next Next commit
DOC: Add a note on the iso_c2py_map implementation
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@HaoZeke @charris
HaoZeke authored and charris committed Dec 23, 2023
commit 62676de04402bf9f8b8a4c6cab697f7c96c3c86b

There are no files selected for viewing

67 changes: 36 additions & 31 deletions 67 numpy/f2py/_isocbind.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -72,37 +72,42 @@
'char': 'c', # char
}

iso_c2py_map = {
'int': 'int',
'short int': 'int', # forced casting
'long': 'int',
'long long': 'long',
'signed char': 'int', # forced casting
'size_t': 'int', # approx Python int
'int8_t': 'int', # forced casting
'int16_t': 'int', # forced casting
'int32_t': 'int',
'int64_t': 'long',
'int_least8_t': 'int', # forced casting
'int_least16_t': 'int', # forced casting
'int_least32_t': 'int',
'int_least64_t': 'long',
'int_fast8_t': 'int', # forced casting
'int_fast16_t': 'int', # forced casting
'int_fast32_t': 'int',
'int_fast64_t': 'long',
'intmax_t': 'long',
'intptr_t': 'long',
'ptrdiff_t': 'long',
'float': 'float',
'double': 'float', # forced casting
'long double': 'float', # forced casting
'float _Complex': 'complex', # forced casting
'double _Complex': 'complex',
'long double _Complex': 'complex', # forced casting
'_Bool': 'bool',
'char': 'bytes', # approx Python bytes
}
# TODO: At some point these should be included, but then they'd need special
# handling in cfuncs.py e.g. needs[int64_t_from_pyobj] These are not very hard
# to add, since they all derive from the base `int_from_pyobj`, e.g. the way
# `short_from_pyobj` and others do
iso_c2py_map = {}
# iso_c2py_map = {
# 'int': 'int',
# 'short int': 'int', # forced casting
# 'long': 'int',
# 'long long': 'long',
# 'signed char': 'int', # forced casting
# 'size_t': 'int', # approx Python int
# 'int8_t': 'int', # forced casting
# 'int16_t': 'int', # forced casting
# 'int32_t': 'int',
# 'int64_t': 'long',
# 'int_least8_t': 'int', # forced casting
# 'int_least16_t': 'int', # forced casting
# 'int_least32_t': 'int',
# 'int_least64_t': 'long',
# 'int_fast8_t': 'int', # forced casting
# 'int_fast16_t': 'int', # forced casting
# 'int_fast32_t': 'int',
# 'int_fast64_t': 'long',
# 'intmax_t': 'long',
# 'intptr_t': 'long',
# 'ptrdiff_t': 'long',
# 'float': 'float',
# 'double': 'float', # forced casting
# 'long double': 'float', # forced casting
# 'float _Complex': 'complex', # forced casting
# 'double _Complex': 'complex',
# 'long double _Complex': 'complex', # forced casting
# '_Bool': 'bool',
# 'char': 'bytes', # approx Python bytes
# }

isoc_kindmap = {}
for fortran_type, c_type_dict in iso_c_binding_map.items():
Expand Down
2 changes: 2 additions & 0 deletions 2 numpy/f2py/cfuncs.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,8 @@
}
"""

# TODO: These should be dynamically generated, too many mapped to int things,
# see note in _isocbind.py
needs['char_from_pyobj'] = ['int_from_pyobj']
cfuncs['char_from_pyobj'] = """
static int
Expand Down
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
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.