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

Fortran object oriented support #239

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

danbeibei
Copy link

@danbeibei danbeibei commented Dec 5, 2024

This PR sits on top of #230, #231, #232, #237 and #238
It adds partial support for Fortran object oriented syntax

Support for:

  • Specific binding
  • Generic binging
  • Binding overload
  • abstract fortran keyword
  • deferred fortran keyword
  • Type inheritance
  • Explicite fortran constructor (if unique)
  • Polymorphic variable (class(...))

No support for:

  • Operator binding
  • Multiple explicite constructors for one type
  • non_overridable fortran keyword
  • Procedure pointer component
  • pass/nopass fortran keywords
  • Final binding
  • Implicite fortran constructors

@danbeibei danbeibei changed the title Fortran oo support Fortran object oriented support Dec 5, 2024
@danbeibei
Copy link
Author

@jameskermode I'm not sure what is wrong with the builds, could you help me figure out?

@krystophny
Copy link
Contributor

@danbeibei this looks great! Looks like we did some work in parallel in #233 and #236 in the last week (what a coincidence). Does this already allow also allocatable output of polymorphic class instances in factory procedures? If yes, did you follow the same strategy of wrapping a class into another type container? It would be great if we could cross-check our example cases in the each others branch and then see how to proceed with merging.

@danbeibei
Copy link
Author

Hi @krystophny, great stuff! No, it does not allow allocatable output. I have rapidly checked out the examples in your branch and can confirm my changes do not actually address what you changes do. I'll take the time in a few weeks to have a look into the code you pushed.

@krystophny
Copy link
Contributor

krystophny commented Dec 26, 2024

@danbeibei @jameskermode I have now summarized all PRs on #240 in order, rebased mine on top of this one here, and merged everything in master of https://github.com/itpplasma/f90wrap for testing until you can dig through the reviews. Until then, happy holidays!

@@ -13,7 +13,7 @@ description = "Fortran to Python interface generator with derived type support"
authors = [{name = "James Kermode", email = "[email protected]"}]
python-requires = ">=3.8"
urls = {Homepage = "https://github.com/jameskermode/f90wrap"}
dependencies = ["numpy>=1.13", "packaging"]
dependencies = ["numpy>=1.13", "packaging", "pytest", "pytest-dependency"]
Copy link
Contributor

@krystophny krystophny Dec 26, 2024

Choose a reason for hiding this comment

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

Two questions here:

  1. Should pytest-dependency really be used? Avoiding dependencies between tests is usually considered good practice.
  2. If 1) can be avoided, is pytest even necessary, or better stick to good old unittest (I rewrote my tests after realizing that pytest has not been a requirement up to now)?

Copy link
Owner

Choose a reason for hiding this comment

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

I would indeed prefer to stick to unittest and avoid adding dependencies if possible

Copy link
Owner

@jameskermode jameskermode left a comment

Choose a reason for hiding this comment

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

Happy to merge this if the pytest dependency can be removed

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.

3 participants