-
Notifications
You must be signed in to change notification settings - Fork 112
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
Throw error in trixi_include
when assignment is not found
#1737
Throw error in trixi_include
when assignment is not found
#1737
Conversation
Review checklistThis checklist is meant to assist creators of PRs (to let them know what reviewers will typically look for) and reviewers (to guide them in a structured review process). Items do not need to be checked explicitly for a PR to be eligible for merging. Purpose and scope
Code quality
Documentation
Testing
Performance
Verification
Created with ❤️ by the Trixi.jl community. |
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 like the idea. Have you checked if this has any measurable impact on run time?
Not noticeable during normal usage: main:
This branch:
Also, as you know, I'm a big fan of proper testing, so I added tests as well. |
Please fix the formatting 🙂 |
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.
Small modification, but other than that it LGTM! One look at the code part by @ranocha would be useful though
Co-authored-by: Michael Schlottke-Lakemper <[email protected]>
…into trixi-include-error
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.
Thanks a lot! I do like the idea 👍
Looks like the insertion of
|
Yes, but I don't see why. It's working locally. |
Update: I can reproduce it now. When running the tests with coverage, |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1737 +/- ##
==========================================
- Coverage 96.28% 95.83% -0.45%
==========================================
Files 428 428
Lines 34621 34635 +14
==========================================
- Hits 33333 33192 -141
- Misses 1288 1443 +155
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Co-authored-by: Michael Schlottke-Lakemper <[email protected]>
Co-authored-by: Michael Schlottke-Lakemper <[email protected]>
Another real error:
|
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.
Thanks a lot!
Does that mean I cannot use trixi_include for non Trixi files anymore? Ie, to include files that do not have a tspan variable etc? Because I have to admit, I liked the ability to include files and change variables also for non elixir files. |
As far as I understand, you can include whatever you like - you just get an error when you try to set a variable via a keyword argument of |
Ah, ok. So it does not have a set of variables like |
I agree 👍 There seems to be just some last fix to make CI pass, and we can merge this great contribution. |
Only |
Thanks for the explanation! |
…into trixi-include-error
Head branch was pushed to by a user without write access
There is always another failing test after I fixed the single failing one 🙄 |
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.
Thanks a lot!
This gives more safety by throwing an error when an assignment to be replaced is passed to
trixi_include
and can't be found.I implemented this for TrixiParticles, where it's really useful to catch errors not just when including elixirs from the REPL, but especially in the tests. It happened quite often that we changed a variable name in an elixir, but didn't notice that it was replaced in the tests with
trixi_include
, which then didn't work as expected. With this PR, it will just throw an error and fail.