Skip to content

Add PyLinOp allow python create a class inherit from it and override apply#96

Open
yhmtsai wants to merge 1 commit into
mainfrom
pylinop
Open

Add PyLinOp allow python create a class inherit from it and override apply#96
yhmtsai wants to merge 1 commit into
mainfrom
pylinop

Conversation

@yhmtsai
Copy link
Copy Markdown
Collaborator

@yhmtsai yhmtsai commented Jan 22, 2026

Description

This add a PyLinOp class in pyGinkgoExtensions with some necessary components to allow users to create a class inheriting from PyLinOp and overriding the apply function.
This will allow users to write their own linop in pure python and use it in Ginkgo framework, such as Krylov solvers.

This is in early stage and most code are changed from the example in pybind11 https://pybind11.readthedocs.io/en/stable/advanced/classes.html

Type of change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Copy link
Copy Markdown
Collaborator

@greole greole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! But maybe add some documentation how to use it and if possible an example.

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