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

tests: Add test and patch for issue 2325 #2416

Closed
wants to merge 1 commit into from
Closed

Conversation

EdCaunt
Copy link
Contributor

@EdCaunt EdCaunt commented Jul 19, 2024

Fixes #2325.

Copy link

codecov bot commented Jul 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.72%. Comparing base (ea94a0f) to head (3e3e963).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2416      +/-   ##
==========================================
- Coverage   86.72%   86.72%   -0.01%     
==========================================
  Files         235      235              
  Lines       44698    44705       +7     
  Branches     8286     8287       +1     
==========================================
+ Hits        38766    38770       +4     
- Misses       5207     5208       +1     
- Partials      725      727       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@mloubout mloubout left a comment

Choose a reason for hiding this comment

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

I don't really see what's the issue there and why we would need two separate properties.
If the factor is None it will rebuild with factor=1 that is treated as None so it will rebuild correctly so I don't see where the issue is

@mloubout
Copy link
Contributor

I don't see anything wrong on master


In [1]: from devito import *

In [2]: x = Dimension(name='x')
   ...: cd = ConditionalDimension(name='cd', parent=x, condition=Ge(x, 1))

In [3]: cd._rebuild()._factor

In [4]: cd._rebuild().factor
Out[4]: 1

In [5]: cd.factor
Out[5]: 1

In [6]: cd._factor


@@ -966,6 +966,10 @@ def spacing(self):

@property
def factor(self):
return self._factor
Copy link
Contributor

Choose a reason for hiding this comment

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

Cant this be return self._factor or 1
and drop def factor_default ?

@EdCaunt
Copy link
Contributor Author

EdCaunt commented Jul 22, 2024

Looks like this was actually fixed in a separate patch (blame says @mloubout fixed it 5 days ago). Closing.

@EdCaunt EdCaunt closed this Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rebuilding a ConditionalDimension with no factor adds a factor.
3 participants