PSyclone icon indicating copy to clipboard operation
PSyclone copied to clipboard

array notation to array range transformation (closes #1576)

Open rupertford opened this issue 1 year ago • 5 comments

Will also be implemented in PSyAD as part of the preprocessing.

rupertford avatar Aug 03 '22 23:08 rupertford

Need to add tests, doc string example for transformation, update documentation and look at dotproduct transformation to see how the bounds are determined - as we currently just add lbound and ubound whereas the dotproduct transformation provides actual values from the array declaration where possible.

rupertford avatar Aug 03 '22 23:08 rupertford

Also currently failing for PSyAD with helmholtz_operator_kernel (but seems to work for w2_to_w1_projection_kernel).

rupertford avatar Aug 03 '22 23:08 rupertford

Codecov Report

Base: 99.51% // Head: 99.51% // Increases project coverage by +0.00% :tada:

Coverage data is based on head (366ee20) compared to base (fa0b77e). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1825   +/-   ##
=======================================
  Coverage   99.51%   99.51%           
=======================================
  Files         268      269    +1     
  Lines       39347    39380   +33     
=======================================
+ Hits        39155    39188   +33     
  Misses        192      192           
Impacted Files Coverage Δ
src/psyclone/psyir/frontend/fparser2.py 100.00% <ø> (ø)
src/psyclone/psyir/transformations/__init__.py 100.00% <100.00%> (ø)
...syir/transformations/reference2arrayrange_trans.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Aug 09 '22 16:08 codecov[bot]

Ready for first review from @arporter or @sergisiso. This transformation returns the bounds of the array range if they can be determined. I think this is the right thing to do, rather than just returning ':'.

rupertford avatar Aug 09 '22 18:08 rupertford

The PSyAD part has been dropped as the implementation does not work with the dotproduct transformation, which needs modifying.

rupertford avatar Aug 09 '22 18:08 rupertford

I removed the #1576 todo in fparser2.py as it changes the code to use loop variables rather than ":" notation which is not relevant to what we are doing here.

rupertford avatar Sep 05 '22 16:09 rupertford

Ready for next review from @arporter

rupertford avatar Sep 05 '22 16:09 rupertford

Added a test showing that an array within a structure causes the transformation to raise an exception. Also added a new issue #1858 about supporting arrays within structures and referenced this issue in the transformation.

rupertford avatar Sep 08 '22 09:09 rupertford

Removed unnecessary import from test file.

rupertford avatar Sep 08 '22 09:09 rupertford

Ready for next review from @arporter

rupertford avatar Sep 08 '22 10:09 rupertford

I've hopefully made the required changes. Ready for another look from @arporter.

rupertford avatar Sep 08 '22 13:09 rupertford