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

Extract/Improve Polyhedron class #178

Merged
merged 22 commits into from
Nov 9, 2023

Conversation

joscao
Copy link
Contributor

@joscao joscao commented Oct 23, 2023

  • extract polyhedron class from loki/transform/transform_loop.py into loki/analyse/util_polyhedron.py
  • extract testing from tests/test_transform_loop.py into tests/test_util_polyhedron.py
  • add __repr__ to Polyhedron class
  • add utility function for construction from_nested_loops
  • add is_empty functionality

@codecov
Copy link

codecov bot commented Oct 23, 2023

Codecov Report

Merging #178 (cfc998c) into main (af8ec9f) will decrease coverage by 0.02%.
The diff coverage is 92.80%.

@@            Coverage Diff             @@
##             main     #178      +/-   ##
==========================================
- Coverage   92.14%   92.12%   -0.02%     
==========================================
  Files          90       91       +1     
  Lines       16690    16713      +23     
==========================================
+ Hits        15379    15397      +18     
- Misses       1311     1316       +5     
Flag Coverage Δ
lint_rules 96.22% <ø> (ø)
loki 92.09% <92.80%> (-0.03%) ⬇️
transformations 91.40% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
loki/transform/transform_loop.py 96.12% <100.00%> (+0.03%) ⬆️
loki/analyse/util_polyhedron.py 92.68% <92.68%> (ø)

@joscao joscao mentioned this pull request Oct 24, 2023
2 tasks
@joscao
Copy link
Contributor Author

joscao commented Oct 24, 2023

Code-checks is complaining about a cyclic import, but in the tests/test_build.py which I cant seem to reproduce (there linter is running fine) on my local machine. Could somebody help me out please?

Error: tests/test_build/test_build.py:1:0: R0401: Cyclic import (loki -> loki.lint -> loki.lint.linter -> loki.transform -> loki.transform.transform_loop -> loki.analyse.util_polyhedron) (cyclic-import)
Error: tests/test_build/test_build.py:1:0: R0401: Cyclic import (loki -> loki.transform -> loki.transform.transform_loop -> loki.analyse.util_polyhedron) (cyclic-import)

Copy link
Collaborator

@reuterbal reuterbal left a comment

Choose a reason for hiding this comment

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

Thanks, this looks great. We need to take care of resolving the type hint problem with 3.8, and it would be wise to add another test for the construction from nested loops that ensures the resulting polyhedron looks fine.

loki/analyse/util_polyhedron.py Outdated Show resolved Hide resolved
loki/analyse/util_polyhedron.py Outdated Show resolved Hide resolved
loki/analyse/util_polyhedron.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@reuterbal reuterbal left a comment

Choose a reason for hiding this comment

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

Fantastic, many thanks. I think this is ready for merging.

@reuterbal reuterbal added the ready for merge This PR has been approved and is ready to be merged label Nov 9, 2023
@reuterbal reuterbal merged commit df3f99a into ecmwf-ifs:main Nov 9, 2023
8 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for merge This PR has been approved and is ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants