-
Notifications
You must be signed in to change notification settings - Fork 30
(#Closes 468) Added Directive node separated from comments #469
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
Conversation
I've realised that this only works with 3.10 and above due to type declarations. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #469 +/- ##
==========================================
+ Coverage 92.16% 92.19% +0.02%
==========================================
Files 86 86
Lines 13752 13802 +50
==========================================
+ Hits 12675 12725 +50
Misses 1077 1077 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Pushed some changes now to fix some docs issues and coverage updates. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Aidan. Everything looks sensible but I do have a couple questions about inheritance and valid locations for directives.
In fact, now that I write that, please could you add a new section to the documentation - probably just before https://fparser.readthedocs.io/en/latest/fparser2.html#preprocessing-directives.
I'm wondering whether it would be wise for us to make this behaviour configurable somehow, just in case interpreting things as directives causes problems for downstream applications. I guess we could do this in the same way as we do for the support for non-standard extensions.
Addressed most of the comments. |
@LonelyCat124 I know we talked about that but I forgot. What is the benefit of differentiating in fparser between Comments and Directives? Are you planning to parse the body of the directive in the future? |
@sergisiso yes - its to separate directives from comments to make handling them in PSyclone better in the future (which I plan to continue down that avenue now). It also cleans up even the current implementation I think. |
@arporter I think this is cleaned up and ready for another look now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with the functionality now but I think the docs need a bit more work - readfortran.py has its own section that needs updating.
Apart from that, we need to hear back from @hiker about the Fab issue.
I think the PSyclone CI branch of Fab needs a patch that I had applied a while ago. Sorry, with UKMO moving slow, I have too many branches in progress. I will verify that. |
Confirmed, I needed to update the PSyclone CI branch of our lfric Fab build repo. That's done now, please try again. |
Thanks @hiker. I've just tried again and we now get a failure to find netcdf.mod:
Does that ring a bell for either yourself or @sergisiso ? |
@arporter I think I've addressed the remaining comments now, and fixed up the confusing test to test what it actually wants to test. Once we have the issues with building the integration tests resolved this should be ok for another look. |
I repeated this in a brach that previously successed and now it fails. So I don't think it is from this branch. https://github.com/stfc/PSyclone-mirror/actions/runs/17321986403/job/49677018062 |
@arporter , @sergisiso It appears that the include path is missing. Typically, that should be taken from $FFLAGS (unless manually added). There was some change with regards to handling flags, which is now on your Fab. What would you usually use to get the include paths? |
@hiker The include path to netcdf is in FFLAGS. Could it be that fab does not take the existing environment values, I noticed that in this line:
you add them explictily but not FFLAGS. |
Yes, indeed - after I updated the Fab version here, we now have an inconsistent set of lfric scripts and Fab in the PSyclone branch :( In the new Fab version, support for environment variable has been removed, but it has been moved into the (new) FabBase class instead. BUT, the lfric script doesn't yet use the new FabBase class, it uses an older version (when it was still called BafBase), and the version used did not yet support FFLAGS. Too many branches and repos (fab, lfric-baf, and then our LFRic CI build). I've just tried to update the PSyclone CI branch for PSyclone's lfric builds again, it should now have the right version. But I don't have time to test, so feel free to ignore this (including failures in the extraction step for now), and I will verify and if necessary properly fix this on Monday. Sorry for that mess, we are just in the middle of migrating scripts from Baf to Fab (and while this is technically only a name change, the code reviews do cause a few differences and conflicts), so this work is still sitting on a branch, not really ready to be merged in yet (i.e. has not been fully propagated through all three repos to check that all LFRic scripts still work). I shouldn't have updated fab itself (then again, not sure how I would have fixed the fparser change, which does require a small change in Fab ... maybe we should have created a custom Fab branch for you as well :) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Aidan (and Joerg). Very nearly there now - we'll ignore the problem with the LFRic extraction test as it's nothing to do with this PR.
There's just a tweak needed to the documentation and I've requested an extension to a docstring in the tests to clarify where the reader functionality is actually tested. (I think this again points to it being in the wrong place but that's not for this PR).
FWIW, I've fixed the CI. Sorry, our fab and lfric branches are changing quit heavily atm, and we are struggling keeping everything after Fab *(lfric-Fab scripts, and our lfric CI) up-to-date. |
@arporter I think I got everything - I wasn't sure if you wanted anything else adding to the FortranReaderBase introduction - if so let me know and I'll try to add more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Aidan. Looks good now - the autoclass gives all the information I think was missing.
I'll proceed to merge.
Initial implementation of this feature.
Ready for a look from any of @arporter @sergisiso @hiker