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
[READY]Add coverage in CI #8
Conversation
f5fb51e
to
97beb1a
Compare
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.
Looks good 👍
@hugohadfield Sorry, after I requested the review last night, without seeing your approval, I felt there are more to be done in a PR this morning (in my timezone), so I added a few commits..... Especially please see my changes in README and see if it's appropriate. |
Codecov Report
@@ Coverage Diff @@
## master #8 +/- ##
=======================================
Coverage ? 40%
=======================================
Files ? 7
Lines ? 4959
Branches ? 0
=======================================
Hits ? 1984
Misses ? 2975
Partials ? 0
Continue to review full report at Codecov.
|
I've changed from Coveralls to CodeCov ( I've used both in the past ) because the latter feels more modern and Coveralls seems to be quite slow. Also I've chosen pytest over nosetests because I was using it and I saw the following on https://nose.readthedocs.io/en/latest/:
and when I go to https://github.com/nose-devs/nose2 , I saw:
|
Oops, I found a bug in my last PR when porting to 3, trying to fix it and add tests for it now. |
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.
Skimming this, looks good! Maybe clear the output of the jupyter notebooks included?
@hugohadfield we should use nbval with clifford docs. maybe just its lax option, since we strip the output. |
Ok cool, I actually have very little idea how these notebook style tests work etc, I'll have a read into them as well when I get a chance! |
@arsenovic |
"from sympy import symbols\n", | ||
"from printer import Format\n", | ||
"from galgebra.printer import Format\n", | ||
"\n", |
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 way to import is changed now.
Sounds sensible @utensil :) |
dict_rep = {} | ||
n = len(basis) | ||
if mat_rep.rows != n or mat_rep.cols != n: | ||
raise ValueError('Matrix and Basis dimensions not equal for Matrix = ' + str(mat)) | ||
raise ValueError('Matrix and Basis dimensions not equal for Matrix = ' + str(mat_rep)) |
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 was an undefined variable, caused by a typo.
n_range = list(range(n)) | ||
for row in n_range: | ||
dict_rep[basis[row]] = S(0) | ||
for col in n_range: | ||
dict_rep[basis[row]] += mat_rep[row,col]*basis[col] | ||
dict_rep[basis[row]] += mat_rep[col,row]*basis[col] |
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 original usage of the class Transpose which calls _entry
with a parameter expand
, but it will call the _entry
method of normal matrix class which don't have such a parameter. So I removed the usage of Transpose, instead directly change the order of indexes to get the result.
@@ -1048,7 +1048,7 @@ def proj(self, bases_lst): | |||
return Mv(obj, ga=self.Ga) | |||
|
|||
def dual(self): | |||
mode = ga.Ga.dual_mode_value | |||
mode = self.Ga.dual_mode_value |
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 was a reference to ga. It won't work after the removal of circular dependency. And given the context, it actually meant self.Ga, just like in other methods. It's a hidden typo which isn't easy to be found before the removal of circular dependency on ga.
# self.terms.sort(key=operator.itemgetter(1), cmp=Pdop.compare) | ||
# terms are in the form of (coef, pdiff) | ||
# so we need to first extract pdiff and then use Pdop.compare to compare | ||
self.terms.sort(key=cmp_to_key(lambda term1, term2 : Pdop.compare(term1[1], term2[1]))) | ||
return |
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 where I was wrong in last PR.
@@ -328,6 +327,9 @@ def __rmul__(self, LT): | |||
else: | |||
raise TypeError('Cannot have LT as left argument in Lt __rmul__\n') | |||
|
|||
def __repr__(self): | |||
return str(self) | |||
|
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.
Without this, it will product the correct LaTeX output with an incorrect text output invisible in a Jupyter notebook. Found it with nbval
.
Thanks for the review, now I'll merge into master. (also added a few comments on some code which fixed problems but not quite visible in the review). Further fix could be done in a separate PR. |
This PR:
test