Skip to content

Commit

Permalink
Introduced dict representation of p-adic: {valuation: mantissa digit}…
Browse files Browse the repository at this point in the history
…; flake8 fix in sphinx/.
  • Loading branch information
GDeLaurentis committed Jun 28, 2024
1 parent fb32774 commit be854b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pyadic/padic.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ def as_tuple(self):
"""Tuple reprensentation of the mantissa."""
return (to_base(int(self), self.p) + tuple([0 for i in range(self.k)]))[:self.k]

@property
def as_dict(self):
"""Dict reprensentation: {valuation: mantissa digit}."""
return dict(zip(range(self.n, self.k), self.as_tuple))

@property
def as_tuple_from_zero(self):
"""Tuple representation of the mantissa, shifted to start from p^0 term."""
Expand Down
2 changes: 1 addition & 1 deletion sphinx/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

sys.path.insert(0, os.path.abspath('../../'))

from version import __version__ as version
from version import __version__ as version # noqa: E402

# -- Project information -----------------------------------------------------

Expand Down

0 comments on commit be854b3

Please sign in to comment.