-
Notifications
You must be signed in to change notification settings - Fork 0
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
Adding reification step4 #38
Conversation
It looks good. Now we have to apply this to reife the whole rule. For instance, the following test eclingo/tests/test_reification.py Lines 60 to 63 in 6f81113
should now be def test_epistemic_atom(self):
self.assert_equal_program(
parse_program(":- &k{a}."), ":- k(u(a)). {k(u(a))} :- u(a)."
) This is the next step. |
Okay, I was thinking through it. In this case, do you want to make the call to parse_progrma function and do a reification there and then continue with the parse of the program, or will we need a new parse_program function that accounts for the reification steps? |
@jorgefandinno While I'm looking into completing the reification as we talked, for which I'll post a couple comments since I have seen there are a couple ways of addressing it, I have gotten the 3 test_app.Test_Examples to fail. I have not made any big change since the PR and you can also see what I have just started to change on the commits. But I cannot find the reason why they are failing now. Could you take a look into those? Maybe trying to see if they fail on your local machine too. Thank you |
Those are integration tests (they test the whole up instead of a single module). |
Okay, I figured it out. Apparently if you import something into a file like parser.py and then do not use it, the integration tests will fail. Why? That I do not know, but once I deleted them, the tests started to pass. |
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.
@jorgefandinno Please review this comments and let me know what should be the right approach, I'll made the changes based on what is expected. Thank you
On top of that, I'm getting an error with flake 8, isort cannot import name SortImports. I'm pretty sure I haven't changed any req file. Do you know if flake8 has maybe been updated? |
I am not aware of that. I pulled the content of |
The tests are passing, but here on github when the checks are running, flak8 fails and that is why the checks are failing. If you peek details you'll see how the actual tests are all up to date and passing |
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.
45dec4a
to
3f93d62
Compare
Can you try the tests in your computer by running They fail in github and in my computer. It is very strange. |
I'm pretty sure that there's an error with the installation of the requirements. I was doing some testing using the AST test case class and running them with the command nox -r. And I saw this message and tried the command nox without the flag -r and now the tests are failing due to a coverage exit code -11. It is indeed very strange |
This is solved. Coverage is not 100%. Can you look into it? |
Is there a way of running all tests without having to list them one by one on the noxfile session.run command? Coverage will fail to achieve 100% if some functions are not being used for the specified tests |
@jorgefandinno Coverage is fixed now by running all tests |
…ngAST Lute/reification step4 testing ast
@jorgefandinno Please review the latest changes I have made, I believe it is all fixed now, and all the tests are passing. |
from clingo.ast import Transformer | ||
|
||
|
||
def _rule_to_symbolic_term_adapter(rules): |
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.
Is this function used anywhere besides the tests? If not, the function should go to the test file.
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 for now, is the function I used as helper to call the transformer. It can be moved back to the tests
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.
This is already solved and moved to the test file. @jorgefandinno
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.
Ok, now I understand. It make sense to have a function that wraps the transformer. It is a good idea.
I got confused by the naming. The convention is to start by a underscore _ private functions that are only used in the module. The best idea would be to move the function back here renamed without the underscore. Prepend an underscore to the Transformer and outside of this file use only the function and never the transformer. Is that possible?
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 moved it back and removed the underscore, but I do not understand the prepend an underscore to the Transformer, should I rename the Transformer class to be _? I have not seen any other Transformer being named like that
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.
@jorgefandinno The refactor issue should be solved now |
Addressing issue #37 being step 4 of issue #5 .