Skip to content

Conversation

utensil
Copy link
Member

@utensil utensil commented Feb 14, 2019

This is a work-in-progress for the release of 0.4.3 which is discussed in #10 and https://github.com/brombo/galgebra/pull/42#issuecomment-462263950 .

This PR includes the following:

@codecov
Copy link

codecov bot commented Feb 14, 2019

Codecov Report

Merging #11 into master will increase coverage by 8.89%.
The diff coverage is 62.22%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #11      +/-   ##
==========================================
+ Coverage      40%   48.89%   +8.89%     
==========================================
  Files           7        8       +1     
  Lines        4959     4947      -12     
==========================================
+ Hits         1984     2419     +435     
+ Misses       2975     2528     -447
Impacted Files Coverage Δ
galgebra/__init__.py 100% <100%> (ø)
galgebra/ga.py 64.81% <100%> (+2.05%) ⬆️
galgebra/printer.py 41.22% <50%> (+10.92%) ⬆️
galgebra/metric.py 57.44% <50%> (+2.97%) ⬆️
galgebra/mv.py 50% <52.63%> (+12.92%) ⬆️
galgebra/lt.py 22.22% <66.66%> (+11.14%) ⬆️
galgebra/utils.py 62.5% <85.71%> (+17.04%) ⬆️
... and 4 more

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 21ed56d...78efe65. Read the comment docs.

@utensil
Copy link
Member Author

utensil commented Feb 14, 2019

@hugohadfield @arsenovic The release of 0.4.3 is ready for review, thanks.


script:
# Run tests, validate Jupyter notebooks and generate coverage report
- pytest --cov=galgebra --nbval examples/ipython/ --nbval doc/ipython/ --nbval doc/python/ --current-env test
Copy link
Member Author

Choose a reason for hiding this comment

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

Tests covers more forms of tests and collects the coverage stat data in one go.

Copy link
Member

Choose a reason for hiding this comment

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

Thats neat

from __future__ import absolute_import, division
from __future__ import print_function
from galgebra.printer import Format, xpdf
from galgebra.ga import Ga
Copy link
Member Author

@utensil utensil Feb 14, 2019

Choose a reason for hiding this comment

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

If the users install galgebra from pip, the way of importing the modules has to conform to the standard "namespaced" way instead of just importing modules from a global namespace. This might break some old code but it's a necessary transition process.

Copy link
Member

Choose a reason for hiding this comment

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

agreed

u = kargs[0] # Coordinate map or vector embedding to define submanifold
coords = kargs[1] # List of cordinates
ga = kwargs['ga'] # base geometric algebra
self.wedge_print = kwargs['wedge']
Copy link
Member Author

@utensil utensil Feb 14, 2019

Choose a reason for hiding this comment

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

This line was clearly a copy-paste bug and this self.wedge_print turns out to be not used and useless for this class.

else:
for (coef, base) in zip(coefs, bases):
obj += modes(coef) * base
obj += Simp.modes(coef) * base
Copy link
Member Author

Choose a reason for hiding this comment

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

An example of using non-existent non-namespaced method.

for (coef, base) in zip(coefs, bases):
obj += modes(coef) * base
mv.obj = obj
mv.obj = Simp.apply(mv.obj)
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 code was repetitive, so calls the method with exactly the same semantic instead.

g_lst = []
g_inv_lst = []
for coord1 in self.coords:
i1 = str(coord2)
Copy link
Member Author

Choose a reason for hiding this comment

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

Incorrect local variable naming, probably just a copy-paste bug. It was not covered in previous tests so it was not detected. Now it's covered and passed.

Copy link
Member

Choose a reason for hiding this comment

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

great, its really nice the tests are running well

return A > B
else:
raise ValeError('Operation ' + op + 'not allowed in Mv.Mul!')
raise ValueError('Operation ' + op + 'not allowed in Mv.Mul!')
Copy link
Member Author

Choose a reason for hiding this comment

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

A typo bug.

elif isinstance(sdop, tuple):
self.term.append(sdop)
self = Dfop.consolidate_coefs(self)
self = Sdop.consolidate_coefs(self)
Copy link
Member Author

Choose a reason for hiding this comment

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

Use the correct version of consolidate_coefs method.


if dop1.cmpflg != dop2.cmpflg:
raise ValueError('In Dop.Add complement flags have different values.')
raise ValueError('In Dop.Add complement flags have different values: %s vs. %s' % (dop1.cmpflg, dop2.cmpflg))
Copy link
Member Author

Choose a reason for hiding this comment

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

cmpflg still has some potential bugs. This is to make the exception to have proper context.

else:
if self.cmpflg:
s += str_dop + '*' + str_base
s += str_sdop + '*' + str_base
Copy link
Member Author

Choose a reason for hiding this comment

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

Also a local variable name typo

def com(A, B):
return ga.Ga.com(A, B)
raise ImportError(
"""mv.com is removed, please use ga.Ga.com(A, B) instead.""")
Copy link
Member Author

Choose a reason for hiding this comment

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

Added a deprecation error.

\\DeclareMathOperator{\Adj}{Adj}
"""
$\\DeclareMathOperator{\\Tr}{Tr}
\\DeclareMathOperator{\\Adj}{Adj}
Copy link
Member Author

Choose a reason for hiding this comment

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

Many backslashes are not properly escaped, caused some warnings and now fixed.

from distutils.core import Extension

VERSION = '0.4.1.1'
VERSION = '0.4.3'
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 version bump.

'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
Copy link
Member Author

Choose a reason for hiding this comment

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

Py3 support. 🎆

Get compatible with python 3

Get Travis set up with some good tests

Copy link
Member Author

Choose a reason for hiding this comment

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

These 2 TODOs are done. 😄

Copy link
Member

@hugohadfield hugohadfield left a comment

Choose a reason for hiding this comment

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

It looks like a load of nice work bringing this library back to life

@hugohadfield
Copy link
Member

@utensil what is your pypi username? I think it makes sense to add you as an owner on https://pypi.org/manage/project/galgebra/

@utensil
Copy link
Member Author

utensil commented Feb 18, 2019

@utensil what is your pypi username? I think it makes sense to add you as an owner on https://pypi.org/manage/project/galgebra/

It's https://pypi.org/user/utensil/ , thanks~

@utensil
Copy link
Member Author

utensil commented Feb 18, 2019

@hugohadfield Thanks for the review, I'll merge now, would you please release it to the PyPI?

@utensil utensil merged commit 22d8abe into master Feb 18, 2019
@utensil utensil mentioned this pull request Feb 22, 2019
27 tasks
@utensil utensil deleted the 0.4.3-release branch February 25, 2019 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants