-
Notifications
You must be signed in to change notification settings - Fork 20
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
796 always return #953
base: main
Are you sure you want to change the base?
796 always return #953
Conversation
I'm not sure all the files should be changed with adding 'return.' |
@@ -441,8 +442,7 @@ See the file <benchmark/profiling.jl> for an example of profiling code. | |||
When publishing a new version of the model to the Julia Registry, follow this procedure: | |||
|
|||
> **Note:** | |||
> To be able to register, you need to be a member of the organisation TulipaEnergy and have your visibility set to public:<br> | |||
> ![Screenshot of public members of TulipaEnergy on GitHub](./images/PublicMember.png) | |||
> To be able to register, you need to be a member of the organisation TulipaEnergy and have your visibility set to public:<br> > ![Screenshot of public members of TulipaEnergy on GitHub](./images/PublicMember.png) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why this changed.
@@ -19,7 +19,7 @@ function add_consumer_constraints!(model, constraints, graph, sets) | |||
|
|||
# - Balance constraint (using the lowest temporal resolution) | |||
df = filter(:asset => ∈(Ac), constraints[:highest_in_out].indices; view = true) | |||
model[:consumer_balance] = [ | |||
return model[:consumer_balance] = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this is correct or these should all be return nothing
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The JuliaFormatter is technically correct, because these were indeed being returned implicitly. But we don't expect any return, so adding an empty return
after this is better, in my opinion
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #953 +/- ##
=======================================
Coverage 95.50% 95.50%
=======================================
Files 30 30
Lines 1045 1045
=======================================
Hits 998 998
Misses 47 47 ☔ View full report in Codecov by Sentry. |
@@ -198,6 +198,7 @@ We will try to follow these during development and reviews. | |||
- List obvious objects, e.g., `using JuMP: @variable`, since `@variable` is obviously from JuMP in this context, or `using Graph: SimpleDiGraph`, because it's a constructor with an obvious name. | |||
- For other objects inside `Package`, use `using Package: Package` and explicitly call `Package.A` to use it, e.g., `DataFrames.groupby`. | |||
- List all `using` in <src/TulipaEnergyModel.jl>. | |||
- Explicitly state what a function will `return`, including `return nothing`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Explicitly state what a function will `return`, including `return nothing`. | |
- Explicitly state what a function will `return`, including `return nothing`. |
Indeed, many places will be changed with this new rule because all functions return something (implicit rule is to return the last thing in a function). This is annoying, but necessary with this change. For most places, we are going to need manual intervention to add and empty |
Related issues
Closes #796
Closes #940
Checklist
I am following the contributing guidelines
Tests are passing
Lint workflow is passing
Docs were updated and workflow is passing