Skip to content
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.

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

Macro declarations #1529

Open
videlec opened this issue Oct 13, 2023 · 2 comments
Open

Macro declarations #1529

videlec opened this issue Oct 13, 2023 · 2 comments

Comments

@videlec
Copy link
Contributor

videlec commented Oct 13, 2023

When parsing .rst files to produce Cython .pxd files (as in sagemath/sage#36449) I would like to also be able to parse macros. However, Cython is completely agnostic to macros that must be defined as functions. Would it be fine to do changes in the flint doc such as

diff --git a/doc/source/acb_mat.rst b/doc/source/acb_mat.rst
index 5d18fd0f3..3240d0260 100644
--- a/doc/source/acb_mat.rst
+++ b/doc/source/acb_mat.rst
@@ -38,15 +38,15 @@ Types, macros and constants
     *acb_mat_struct*, permitting an *acb_mat_t* to
     be passed by reference.
 
-.. macro:: acb_mat_entry(mat, i, j)
+.. macro:: acb_ptr acb_mat_entry(acb_mat_t mat, slong i, slong j)
 
     Macro giving a pointer to the entry at row *i* and column *j*.
 
-.. macro:: acb_mat_nrows(mat)
+.. macro:: slong acb_mat_nrows(acb_mat_t mat)
 
     Returns the number of rows of the matrix.
 
-.. macro:: acb_mat_ncols(mat)
+.. macro:: slong acb_mat_ncols(acb_mat_t mat)
 
     Returns the number of columns of the matrix.

(where appropriate)

vbraun pushed a commit to vbraun/sage that referenced this issue Dec 24, 2023
    
We
- write down a script to auto-generate flint header files (currently at
https://github.com/videlec/flint-header-sage-autogen)
- replace most of the files in `src/sage/libs/flint` by auto-generated
files. Doing so, the custom sage code in `src/sage/libs/flint` is always
contained in files suffixed by `_sage.pxd`/`_sage.pyx`.
- deprecate the files in `src/sage/libs/arb/`

### 📝 Checklist

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

sagemath#35848

#### Upstream issues and patches

- flintlib/flint#1523
- flintlib/flint#1529
- flintlib/flint#1532
- flintlib/flint#1535
- flintlib/flint#1536
- cython/cython#5779
- flintlib/flint#1653
- flintlib/flint#1655
    
URL: sagemath#36449
Reported by: Vincent Delecroix
Reviewer(s): Marc Mezzarobba, Matthias Köppe, Vincent Delecroix
vbraun pushed a commit to vbraun/sage that referenced this issue Dec 25, 2023
We
- write down a script to auto-generate flint header files (currently at
https://github.com/videlec/flint-header-sage-autogen)
- replace most of the files in `src/sage/libs/flint` by auto-generated
files. Doing so, the custom sage code in `src/sage/libs/flint` is always
contained in files suffixed by `_sage.pxd`/`_sage.pyx`.
- deprecate the files in `src/sage/libs/arb/`

### 📝 Checklist

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

sagemath#35848

#### Upstream issues and patches

- flintlib/flint#1523
- flintlib/flint#1529
- flintlib/flint#1532
- flintlib/flint#1535
- flintlib/flint#1536
- cython/cython#5779
- flintlib/flint#1653
- flintlib/flint#1655

URL: sagemath#36449
Reported by: Vincent Delecroix
Reviewer(s): Marc Mezzarobba, Matthias Köppe, Vincent Delecroix
vbraun pushed a commit to vbraun/sage that referenced this issue Dec 27, 2023
    
We
- write down a script to auto-generate flint header files (currently at
https://github.com/videlec/flint-header-sage-autogen)
- replace most of the files in `src/sage/libs/flint` by auto-generated
files. Doing so, the custom sage code in `src/sage/libs/flint` is always
contained in files suffixed by `_sage.pxd`/`_sage.pyx`.
- deprecate the files in `src/sage/libs/arb/`

### 📝 Checklist

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

sagemath#35848

#### Upstream issues and patches

- flintlib/flint#1523
- flintlib/flint#1529
- flintlib/flint#1532
- flintlib/flint#1535
- flintlib/flint#1536
- cython/cython#5779
- flintlib/flint#1653
- flintlib/flint#1655
    
URL: sagemath#36449
Reported by: Vincent Delecroix
Reviewer(s): Marc Mezzarobba, Matthias Köppe, Vincent Delecroix
vbraun pushed a commit to vbraun/sage that referenced this issue Jan 2, 2024
    
We
- write down a script to auto-generate flint header files (currently at
https://github.com/videlec/flint-header-sage-autogen)
- replace most of the files in `src/sage/libs/flint` by auto-generated
files. Doing so, the custom sage code in `src/sage/libs/flint` is always
contained in files suffixed by `_sage.pxd`/`_sage.pyx`.
- deprecate the files in `src/sage/libs/arb/`

### 📝 Checklist

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

sagemath#35848

#### Upstream issues and patches

- flintlib/flint#1523
- flintlib/flint#1529
- flintlib/flint#1532
- flintlib/flint#1535
- flintlib/flint#1536
- cython/cython#5779
- flintlib/flint#1653
- flintlib/flint#1655
    
URL: sagemath#36449
Reported by: Vincent Delecroix
Reviewer(s): Marc Mezzarobba, Matthias Köppe, Vincent Delecroix
vbraun pushed a commit to vbraun/sage that referenced this issue Jan 5, 2024
    
We
- write down a script to auto-generate flint header files (currently at
https://github.com/videlec/flint-header-sage-autogen)
- replace most of the files in `src/sage/libs/flint` by auto-generated
files. Doing so, the custom sage code in `src/sage/libs/flint` is always
contained in files suffixed by `_sage.pxd`/`_sage.pyx`.
- deprecate the files in `src/sage/libs/arb/`

### 📝 Checklist

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

sagemath#35848

#### Upstream issues and patches

- flintlib/flint#1523
- flintlib/flint#1529
- flintlib/flint#1532
- flintlib/flint#1535
- flintlib/flint#1536
- cython/cython#5779
- flintlib/flint#1653
- flintlib/flint#1655
    
URL: sagemath#36449
Reported by: Vincent Delecroix
Reviewer(s): Marc Mezzarobba, Matthias Köppe, Vincent Delecroix
vbraun pushed a commit to vbraun/sage that referenced this issue Jan 13, 2024
    
We
- write down a script to auto-generate flint header files (currently at
https://github.com/videlec/flint-header-sage-autogen)
- replace most of the files in `src/sage/libs/flint` by auto-generated
files. Doing so, the custom sage code in `src/sage/libs/flint` is always
contained in files suffixed by `_sage.pxd`/`_sage.pyx`.
- deprecate the files in `src/sage/libs/arb/`

### 📝 Checklist

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

sagemath#35848

#### Upstream issues and patches

- flintlib/flint#1523
- flintlib/flint#1529
- flintlib/flint#1532
- flintlib/flint#1535
- flintlib/flint#1536
- cython/cython#5779
- flintlib/flint#1653
- flintlib/flint#1655
    
URL: sagemath#36449
Reported by: Vincent Delecroix
Reviewer(s): Marc Mezzarobba, Matthias Köppe, Vincent Delecroix
@albinahlback
Copy link
Collaborator

If such a change is only for type specific macros, I have no problem with this. However, macros like FLINT_MAX are not type specific.

@albinahlback
Copy link
Collaborator

I suppose Cython would not be able to handle what I proposed in #1985, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants