stfc / fparser

This project maintains and develops a Fortran parser called fparser2 written purely in Python which supports Fortran 2003 and some Fortran 2008. A legacy parser fparser1 is also available but is not supported. The parsers were originally part of the f2py project by Pearu Peterson.
https://fparser.readthedocs.io
Other
64 stars 29 forks source link

add support for do concurrent - 2nd try (closes #403) #423

Closed rupertford closed 1 year ago

rupertford commented 1 year ago

The f2008 do concurrent functionality has already been added but does not get called as the original f2003 classes get called directly from other f2003 classes. In this PR, 2008 versions of these other f2003 classes are added so all should be well.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.03% :tada:

Comparison is base (38364a9) 91.77% compared to head (b109852) 91.81%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #423 +/- ## ========================================== + Coverage 91.77% 91.81% +0.03% ========================================== Files 38 43 +5 Lines 13415 13470 +55 ========================================== + Hits 12312 12367 +55 Misses 1103 1103 ``` | [Files Changed](https://app.codecov.io/gh/stfc/fparser/pull/423?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=stfc) | Coverage Δ | | |---|---|---| | [src/fparser/two/Fortran2003.py](https://app.codecov.io/gh/stfc/fparser/pull/423?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=stfc#diff-c3JjL2ZwYXJzZXIvdHdvL0ZvcnRyYW4yMDAzLnB5) | `94.43% <100.00%> (+0.01%)` | :arrow_up: | | [src/fparser/two/Fortran2008/\_\_init\_\_.py](https://app.codecov.io/gh/stfc/fparser/pull/423?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=stfc#diff-c3JjL2ZwYXJzZXIvdHdvL0ZvcnRyYW4yMDA4L19faW5pdF9fLnB5) | `100.00% <100.00%> (ø)` | | | [...r/two/Fortran2008/action\_term\_do\_construct\_r824.py](https://app.codecov.io/gh/stfc/fparser/pull/423?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=stfc#diff-c3JjL2ZwYXJzZXIvdHdvL0ZvcnRyYW4yMDA4L2FjdGlvbl90ZXJtX2RvX2NvbnN0cnVjdF9yODI0LnB5) | `100.00% <100.00%> (ø)` | | | [...two/Fortran2008/block\_label\_do\_construct\_r814\_1.py](https://app.codecov.io/gh/stfc/fparser/pull/423?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=stfc#diff-c3JjL2ZwYXJzZXIvdHdvL0ZvcnRyYW4yMDA4L2Jsb2NrX2xhYmVsX2RvX2NvbnN0cnVjdF9yODE0XzEucHk=) | `100.00% <100.00%> (ø)` | | | [.../Fortran2008/block\_nonlabel\_do\_construct\_r814\_2.py](https://app.codecov.io/gh/stfc/fparser/pull/423?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=stfc#diff-c3JjL2ZwYXJzZXIvdHdvL0ZvcnRyYW4yMDA4L2Jsb2NrX25vbmxhYmVsX2RvX2NvbnN0cnVjdF9yODE0XzIucHk=) | `100.00% <100.00%> (ø)` | | | [src/fparser/two/Fortran2008/label\_do\_stmt\_r816.py](https://app.codecov.io/gh/stfc/fparser/pull/423?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=stfc#diff-c3JjL2ZwYXJzZXIvdHdvL0ZvcnRyYW4yMDA4L2xhYmVsX2RvX3N0bXRfcjgxNi5weQ==) | `100.00% <100.00%> (ø)` | | | [...c/fparser/two/Fortran2008/nonlabel\_do\_stmt\_r817.py](https://app.codecov.io/gh/stfc/fparser/pull/423?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=stfc#diff-c3JjL2ZwYXJzZXIvdHdvL0ZvcnRyYW4yMDA4L25vbmxhYmVsX2RvX3N0bXRfcjgxNy5weQ==) | `100.00% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

rupertford commented 1 year ago

Ready for first review from @arporter or @sergisiso

rupertford commented 1 year ago

Ready for next review from @arporter

rupertford commented 1 year ago

Perhaps the rule should be that any classes that simply subclass another class in a different API so that subsequent classes use the the new API, should have functional tests? I think that would then cover all cases and more. I've not done this in this PR but would be happy to do so if the reviewer thinks this is a better solution than the single functional test I've added for one case when using concurrent.

arporter commented 1 year ago

Perhaps the rule should be that any classes that simply subclass another class in a different API so that subsequent classes use the the new API, should have functional tests? I think that would then cover all cases and more. I've not done this in this PR but would be happy to do so if the reviewer thinks this is a better solution than the single functional test I've added for one case when using concurrent.

Something like that, yes. (I don't quite follow what you mean.) In this case I'd be happier if we at least check for the case where the DO CONCURRENT is a child of:

rupertford commented 1 year ago

I've added functional tests where the modified classes are purely there to connect the f2003 to the f2008 concurrent classes. I've just added basic functional tests as everything else will work fine, the important thing is that the different flavours of f2008 concurrent can be parsed from f2003 classes (I've just used program).

Ready for next review from @arporter