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

Add comments and tidy _rewrite function. #59

Merged
merged 3 commits into from
Nov 12, 2020
Merged

Add comments and tidy _rewrite function. #59

merged 3 commits into from
Nov 12, 2020

Conversation

odow
Copy link
Member

@odow odow commented Nov 12, 2020

I started fixing a bug for Julia 1.6, and got thoroughly confused
with what this function was doing. Hopefully this is more readable.

@codecov
Copy link

codecov bot commented Nov 12, 2020

Codecov Report

Merging #59 (edaef8e) into master (c27d53c) will increase coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #59      +/-   ##
==========================================
+ Coverage   85.18%   85.26%   +0.08%     
==========================================
  Files          19       19              
  Lines        1343     1344       +1     
==========================================
+ Hits         1144     1146       +2     
+ Misses        199      198       -1     
Impacted Files Coverage Δ
src/rewrite.jl 90.24% <100.00%> (+0.67%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c27d53c...edaef8e. Read the comment docs.

@blegat
Copy link
Member

blegat commented Nov 12, 2020

Could you split the style fixes and code changes ? It is indeed hardly readable and it's one of the reason I move it to a separate package to at least remove any JuMP-specific stuff and try to make it simpler. I agree that it could still be improved with refactoring.

src/rewrite.jl Outdated Show resolved Hide resolved
I started fixing a bug for Julia 1.6, and got thoroughly confused
with what this function was doing. Hopefully this is more readable.
@odow
Copy link
Member Author

odow commented Nov 12, 2020

It's notnow just style fixes.

@blegat
Copy link
Member

blegat commented Nov 12, 2020

It's not just style fixes.

By "not", you mean "now" ?

@odow
Copy link
Member Author

odow commented Nov 12, 2020

It's not just style fixes.

By "not", you mean "now" ?

Haha. Yes.

minus,
current_sum,
left_factors,
(esc(inner_factor),),
Copy link
Member Author

Choose a reason for hiding this comment

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

The bug for 1.6 is here. If inner_factor contains a sum(1 for _ = 1:0), then this evaluates it and throws an error. I'll think about what extra logic needs to be added to fix it in #60

@odow odow merged commit a627628 into master Nov 12, 2020
@odow odow deleted the od/rewrite branch November 12, 2020 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants