Skip to content

Commit

Permalink
qaz
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterLuschny committed Nov 23, 2023
1 parent 9f534c1 commit b90ec67
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 18 deletions.
3 changes: 2 additions & 1 deletion src/FallingFact.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ def fallingfactorial(n: int) -> list[int]:


@MakeTriangle(fallingfactorial, "FallingFact",
["A008279", "A068424", "A094587", "A173333", "A181511"], False)
["A008279", "A068424", "A094587", "A173333", "A181511"],
False)
def FallingFactorial(n: int, k: int) -> int:
return fallingfactorial(n)[k]

Expand Down
2 changes: 1 addition & 1 deletion src/Ordinals.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from functools import cache
from _tabltypes import MakeTriangle

"""von Neumann ordinals (kind of).
"""von Neumann ordinals (kind of).
[0] [0]
[1] [0, 1]
Expand Down
2 changes: 1 addition & 1 deletion src/Rencontres.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from _tabltypes import MakeTriangle

"""Rencontres triangle.
[0] 1;
[1] 0, 1;
[2] 1, 0, 1;
Expand Down
8 changes: 4 additions & 4 deletions src/_tablhtml.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@
]

Footer = ("<div style='word-wrap: break-word; width: 95%;'><p style='margin-left:14px'>"
"Note: The A-numbers are based on a finite number of numerical comparisons. "
"The B-numbers are A-numbers of sligthly different variants. They ignore the sign "
"and the OEIS-offset and might differ in the first few values. Since the offset "
"of all triangles is 0 also the offset of all sequences is 0.</p></div>")
"Note: The A-numbers are based on a finite number of numerical comparisons. "
"The B-numbers are A-numbers of sligthly different variants. They ignore the sign "
"and the OEIS-offset and might differ in the first few values. Since the offset "
"of all triangles is 0 also the offset of all sequences is 0.</p></div>")


def HtmlTriangle(fun: tgen) -> str:
Expand Down
13 changes: 7 additions & 6 deletions tabl_demo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from functools import cache
from tabl import MakeTriangle, PrintProfile
from tabl import MakeTriangle, PrintProfile

"""
This is a demo of the simplest use of the 'tabl' module.
Expand All @@ -11,6 +11,7 @@
triangle. It has to be defined for n >= 0.
"""


@cache
def demo(n: int) -> list[int]:
R = range((n * (n + 1)) // 2, ((n + 1) * (n + 2)) // 2)
Expand All @@ -23,12 +24,12 @@ def Demo(n: int, k: int) -> int:


if __name__ == "__main__":
PrintProfile(Demo)
PrintProfile(Demo)


"""
Of course, much more is possible, for example creating a database
for the traits of a triangle. If you want to do this, you should
start by running '_tablsetup.py'. This takes a while, but is a
"""
Of course, much more is possible, for example creating a database
for the traits of a triangle. If you want to do this, you should
start by running '_tablsetup.py'. This takes a while, but is a
one-time thing.
"""
1 change: 1 addition & 0 deletions test/test_Abel.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import unittest
from Abel import abel


class TestAbel(unittest.TestCase):
def test_abel_zero(self):
self.assertEqual(abel(0), [1])
Expand Down
3 changes: 2 additions & 1 deletion test/test_Baxter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import unittest
from Baxter import baxter


class TestBaxter(unittest.TestCase):
def test_baxter_zero(self):
self.assertEqual(baxter(0), [1])
Expand All @@ -13,4 +14,4 @@ def test_baxter_positive(self):
# Add more tests for positive input values

if __name__ == '__main__':
unittest.main()
unittest.main()
2 changes: 2 additions & 0 deletions test/test_Bell.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import unittest
from Bell import bell


class TestBell(unittest.TestCase):
def test_bell_zero(self):
self.assertEqual(bell(0), [1])
Expand All @@ -12,5 +13,6 @@ def test_bell_positive(self):
self.assertEqual(bell(4), [15, 20, 27, 37, 52])
# Add more tests for positive input values


if __name__ == '__main__':
unittest.main()
2 changes: 1 addition & 1 deletion test/test_Motzkin.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ def test_motzkin_four(self):
# Add more tests for other values of n

if __name__ == '__main__':
unittest.main()
unittest.main()
3 changes: 2 additions & 1 deletion test/test_Narayana.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import unittest
from Narayana import narayana


class TestNarayana(unittest.TestCase):
def test_narayana_zero(self):
self.assertEqual(narayana(0), [1])
Expand All @@ -18,4 +19,4 @@ def test_narayana_positive(self):
# Add more tests for positive input values

if __name__ == '__main__':
unittest.main()
unittest.main()
3 changes: 2 additions & 1 deletion test/test_NumBell.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import unittest
from NumBell import bell_num


class TestBellNum(unittest.TestCase):
def test_bell_num_zero(self):
self.assertEqual(bell_num(0), 1)
Expand All @@ -14,4 +15,4 @@ def test_bell_num_positive(self):
# Add more tests for positive input values

if __name__ == '__main__':
unittest.main()
unittest.main()
1 change: 1 addition & 0 deletions test/test_NumBernoulli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from fractions import Fraction as frac
from NumBernoulli import Bernoulli


class TestBernoulli(unittest.TestCase):
def test_bernoulli_zero(self):
self.assertEqual(Bernoulli(0), frac(1, 1))
Expand Down
2 changes: 1 addition & 1 deletion test/test_TernaryTrees.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ def test_ternarytree_four(self):
# Add more tests for other values of n

if __name__ == '__main__':
unittest.main()
unittest.main()

0 comments on commit b90ec67

Please sign in to comment.