Skip to content

Commit

Permalink
Merge pull request #115 from mulkieran/bgurney-rh-f41-current
Browse files Browse the repository at this point in the history
Advance current development environment to Fedora 41
  • Loading branch information
mulkieran authored Dec 23, 2024
2 parents 3f3de0f + b4c61f7 commit 1d53f78
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 46 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ jobs:
task: make -f Makefile fmt-travis
- dependencies: yamllint
task: make -f Makefile yamllint
- dependencies: pylint python3-hypothesis
- dependencies: pylint python3-hypothesis python3-setuptools
task: PYTHONPATH=./src make -f Makefile lint
- dependencies: python3-hypothesis
- dependencies: python3-hypothesis python3-setuptools
task: PYTHONPATH=./src make -f Makefile test
- dependencies: python3-coverage python3-hypothesis
- dependencies: python3-coverage python3-hypothesis python3-setuptools
task: PYTHONPATH=./src make -f Makefile coverage
- dependencies: python python3-build twine
task: make -f Makefile package
runs-on: ubuntu-latest
container: fedora:40 # CURRENT DEVELOPMENT ENVIRONMENT
container: fedora:41 # CURRENT DEVELOPMENT ENVIRONMENT
steps:
- uses: actions/checkout@v4
- name: Install dependencies
Expand Down
31 changes: 0 additions & 31 deletions .github/workflows/weekly.yml

This file was deleted.

4 changes: 3 additions & 1 deletion src/justbases/_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ def __init__(self, config, base):
# pylint: disable=unused-argument
self.CONFIG = config

def xform(self, left, right, repeating, base, sign):
def xform(
self, left, right, repeating, base, sign
): # pylint: disable=too-many-positional-arguments
"""
Return prefixes for tuple.
Expand Down
22 changes: 15 additions & 7 deletions src/justbases/_division.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class NatDivision:

@classmethod
def _round(
cls, quotient, divisor, remainder, base, method=RoundingMethods.ROUND_DOWN
cls, quotient, divisor, remainder, base, *, method=RoundingMethods.ROUND_DOWN
):
"""
Round the quotient.
Expand Down Expand Up @@ -91,7 +91,7 @@ def _round(
)

@staticmethod
def _divide(divisor, remainder, quotient, remainders, base, precision=None):
def _divide(divisor, remainder, quotient, remainders, base, *, precision=None):
"""
Given a divisor and dividend, continue until precision in is reached.
Expand Down Expand Up @@ -126,7 +126,13 @@ def _divide(divisor, remainder, quotient, remainders, base, precision=None):

@classmethod
def _fractional_division(
cls, divisor, remainder, base, precision=None, method=RoundingMethods.ROUND_DOWN
cls,
divisor,
remainder,
base,
*,
precision=None,
method=RoundingMethods.ROUND_DOWN
):
"""
Get the repeating and non-repeating part.
Expand All @@ -150,15 +156,15 @@ def _fractional_division(
quotient = []
remainders = []
remainder = cls._divide(
divisor, remainder * base, quotient, remainders, base, precision
divisor, remainder * base, quotient, remainders, base, precision=precision
)

if remainder == 0:
return (0, quotient, [], 0)
if remainder in remainders:
start = remainders.index(remainder)
return (0, quotient[:start], quotient[start:], 0)
return cls._round(quotient, divisor, remainder, base, method)
return cls._round(quotient, divisor, remainder, base, method=method)

@staticmethod
def _division(divisor, dividend, remainder, base):
Expand Down Expand Up @@ -186,7 +192,7 @@ def _division(divisor, dividend, remainder, base):
return (quotient, remainder)

@classmethod
def division(
def division( # pylint: disable=too-many-positional-arguments
cls, divisor, dividend, base, precision=None, method=RoundingMethods.ROUND_DOWN
):
"""
Expand Down Expand Up @@ -239,7 +245,9 @@ def division(
non_repeating_part,
repeating_part,
relation,
) = cls._fractional_division(divisor, rem, base, precision, method)
) = cls._fractional_division(
divisor, rem, base, precision=precision, method=method
)

(carry, integer_part) = Nats.carry_in(integer_part, carry, base)

Expand Down
4 changes: 2 additions & 2 deletions src/justbases/_rationals.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class Radix:
)

@classmethod
def _validate( # pylint: disable=too-many-arguments
def _validate( # pylint: disable=too-many-arguments, too-many-positional-arguments
cls, sign, integer_part, non_repeating_part, repeating_part, base
):
"""
Expand Down Expand Up @@ -309,7 +309,7 @@ def _canonicalize_fraction(cls, non_repeating, repeating):
)
return (non_repeating[: (end - index)], repeating[-index:] + repeating[:-index])

def __init__( # pylint: disable=too-many-arguments
def __init__( # pylint: disable=too-many-arguments, disable=too-many-positional-arguments
self,
sign,
integer_part,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_hypothesis/test_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class TestNumber(unittest.TestCase):
@settings(max_examples=100)
def test_xform(
self, integer_part, non_repeating_part, repeating_part, config, base, sign
):
): # pylint: disable=too-many-positional-arguments
"""
Test xform.
"""
Expand Down

0 comments on commit 1d53f78

Please sign in to comment.