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

[Python] fix ProjData_read_from_file #1230

Merged

Conversation

KrisThielemans
Copy link
Collaborator

stir.ProjData_read_from_file is not available on recent SWIG (4.1) unless you use a specific switch, see https://swig.org/Doc4.1/Python.html#Python_nn20. So use stir.ProjData.read_from_file

stir.ProjData_read_from_file is not available on recent SWIG
so use stir.ProjData.read_from_file

[ci skip]
@robbietuk
Copy link
Collaborator

Looks good to me.

Can the swig compiler detect earlier swig versions? If so, could the stir.ProjData_read_from_file function wrap a stir.ProjData.read_from_file call? It would streamline a lot of code and make it SWIG version invariant.

@KrisThielemans
Copy link
Collaborator Author

Can the swig compiler detect earlier swig versions? If so, could the stir.ProjData_read_from_file function wrap a stir.ProjData.read_from_file call? It would streamline a lot of code and make it SWIG version invariant.

Not really I guess. We can do it in our own .i file, and add the function. However, I wouldn't bother. The . syntax is much more natural, and there already a long time, see e.g. in 3.0
https://swig.org/Doc3.0/Python.html#Python_nn20. I guess you might have had problems with my MATLAB swig branch, which is quite out-of-date...

@KrisThielemans KrisThielemans merged commit 31a5ace into UCL:master Jul 23, 2023
5 checks passed
@KrisThielemans KrisThielemans deleted the python_ProjData_read_from_file branch July 23, 2023 20:55
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

Successfully merging this pull request may close these issues.

2 participants