stfc / PSyclone

Domain-specific compiler and code transformation system for Finite Difference/Volume/Element Earth-system models in Fortran
BSD 3-Clause "New" or "Revised" License
107 stars 29 forks source link

(Closes #2622) Add convenient methods `SymbolTable.insert_argument` and `.append_argument`. #2626

Closed JulienRemy closed 4 months ago

JulienRemy commented 5 months ago

Arguments currently have to be inserted in SymbolTable().argument_list using a workaround:

This introduces SymbolTable().insert_argument(index, argument) and .append_argument(argument) to hopefully cover most use cases.

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.86%. Comparing base (647447e) to head (9c966a9).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2626 +/- ## ======================================= Coverage 99.86% 99.86% ======================================= Files 356 356 Lines 48457 48483 +26 ======================================= + Hits 48392 48418 +26 Misses 65 65 ```

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

JulienRemy commented 5 months ago

@arporter @sergisiso What do you think about these?

JulienRemy commented 5 months ago

@arporter I edited w.r.t. all the points above, except for unindenting as I get Flake8 complaints if I do. I also formatted the docstrings of the neighboring methods (no \, indentation) and added my name in the Modified or Authors sections, which I always forget to do.

JulienRemy commented 4 months ago

asserts are now unindented and I also changed the _validate_... error strings to use type(object).__name__.