Skip to content
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

Clean up the multiplication table attributes on Ga #66

Merged
merged 1 commit into from Nov 26, 2019

Conversation

@eric-wieser
Copy link
Contributor

eric-wieser commented Nov 25, 2019

This:

  • Removes the always-empty:
    • Ga.mul_table
    • Ga.wedge_table
    • Ga.dot_table
    • Ga.left_contract_table
    • Ga.right_contract_table
  • Rewrites the unused auto_update_dict to be lazy_dict, which uses dict.__missing__ for simplicity
  • Changes Ga.mul_table_dict and similar to be lazy, which is better than it starting off completely empty
  • Adds documentation for the other Ga.*_table_dict attributes
  • Removes the func argument from update_and_substitute, which is now usable with a dictionary alone. I don't think this is really public API, so this should be fine.
@eric-wieser eric-wieser requested a review from utensil Nov 25, 2019
@eric-wieser eric-wieser force-pushed the eric-wieser:delete-unused-tables branch from cc84e0a to b8ff4d0 Nov 25, 2019
def _repr_pretty_(self, p, cycle):
# ipython support
p_open, p_close = type(self).__qualname__ + '(', ')'
with p.group(len(p_open), p_open, p_close):
p.type_pprinters[dict](self, p, cycle)
p.text(',')
p.breakable()
p.text('f_value={}'.format(self.f_value))
Comment on lines +66 to +73

This comment has been minimized.

Copy link
@eric-wieser

eric-wieser Nov 25, 2019

Author Contributor

This gives something like:

lazy_dict({(e_1, e_2): e_1^e_2},
          f_missing=<bound method Ga.wedge_product_basis_blades of <galgebra.ga.Ga object at 0x0000021348293E48>>)
This:
* Removes the always-empty:
  * `Ga.mul_table`
  * `Ga.wedge_table`
  * `Ga.dot_table`
  * `Ga.left_contract_table`
  * `Ga.right_contract_table`
* Rewrites the unused `auto_update_dict` to be `lazy_dict`, which uses `dict.__missing__` for simplicity
* Changes `Ga.mul_table_dict` and similar to be lazy, which is better than it starting off completely empty
* Adds documentation for the other `Ga.*_table_dict` attributes
* Removes the `func` argument from `update_and_substitute`, which is now usable with a dictionary alone. I don't think this is really public API, so this should be fine.
@eric-wieser eric-wieser force-pushed the eric-wieser:delete-unused-tables branch from b8ff4d0 to 5fabcba Nov 25, 2019
@codecov

This comment has been minimized.

Copy link

codecov bot commented Nov 25, 2019

Codecov Report

Merging #66 into master will increase coverage by 0.11%.
The diff coverage is 78.12%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #66      +/-   ##
==========================================
+ Coverage    66.7%   66.82%   +0.11%     
==========================================
  Files           8        8              
  Lines        4890     4883       -7     
==========================================
+ Hits         3262     3263       +1     
+ Misses       1628     1620       -8
Impacted Files Coverage Δ
galgebra/ga.py 75.29% <78.12%> (+0.56%) ⬆️

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 5ae058c...5fabcba. Read the comment docs.

@@ -32,52 +33,61 @@ def is_bases_product(w):
return len(nc) == 2 or len(nc) == 1 and nc[0].is_Pow and nc[0].exp == 2


class auto_update_dict(dict):

This comment has been minimized.

Copy link
@eric-wieser

eric-wieser Nov 25, 2019

Author Contributor

This has been here but unused since three universes before the beginning of time

This comment has been minimized.

Copy link
@eric-wieser

eric-wieser Nov 26, 2019

Author Contributor

I suspect @abrombo intended to use this in exactly this way :)

@eric-wieser eric-wieser added this to Blocks further cleanup in Miscellaneous cleanup Nov 26, 2019
Copy link
Member

utensil left a comment

LGTM.

@utensil utensil merged commit 3e2cfc3 into pygae:master Nov 26, 2019
5 checks passed
5 checks passed
Travis CI - Pull Request Build Passed
Details
codebeat 4 issues resolved and 0 introduced
Details
codecov/patch 78.12% of diff hit (target 66.7%)
Details
codecov/project 66.82% (+0.11%) compared to 5ae058c
Details
continuous-documentation/read-the-docs Read the Docs build succeeded!
Details
Miscellaneous cleanup automation moved this from Blocks further cleanup to Closed Nov 26, 2019
@eric-wieser eric-wieser deleted the eric-wieser:delete-unused-tables branch Nov 26, 2019
@utensil utensil added this to the 0.4.5 milestone Nov 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
2 participants
You can’t perform that action at this time.