kececisquares
Description
Keçeci Binomial Squares (Keçeci Binom Kareleri): Keçeci's Arithmetical Square (Keçeci Aritmetik Karesi, Keçeci'nin Aritmetik Karesi)
Keçeci Binomial Shapes: Keçeci Binomial Şekilleri
Keçeci-Narayana Shapes: Keçeci-Narayana Şekilleri
| PyPI | |
| Conda | |
| DOI | |
| License: AGPL-3.0 license |
Keçeci Binomial Squares (Keçeci Binom Kareleri): Keçeci's Arithmetical Square (Keçeci Aritmetik Karesi, Keçeci'nin Aritmetik Karesi):
Keçeci Binomial Shapes: Keçeci Binomial Şekilleri
Keçeci Binomial Squares (Keçeci Binom Kareleri): The Keçeci Binomial Square is a series of binomial coefficients forming a square or other geometric shapes region within Khayyam (مثلث خیام), Pascal, Binomial Triangle, selected from a specified starting row with defined size and alignment.
Keçeci Binom Karesi, Hayyam (مثلث خیام), Pascal, Binomial üçgeni içinde belirli bir başlangıç satırından itibaren, seçili boyut ve hizalamada bir kare veya diğer geometrik şekiller oluşturan binom katsayıları serisidir.
0.1.8: Keçeci-Narayana Shapes: Keçeci-Narayana Şekilleri
conda install bilgi::kececisquares -y
pip install kececisquares
https://anaconda.org/bilgi/kececisquares
https://pypi.org/project/kececisquares/
https://github.com/WhiteSymmetry/kececisquares
https://zenodo.org/records/15411671
import kececisquares as ks
# Manuel parametre dict'i oluştur
test_params = {
"triangle_source": "binomial",
"num_rows": 12,
"region_size": 4,
"start_row_0idx": 5,
"region_type": "square",
"shape_type": "hexagon",
"alignment": "center",
"is_filled": True,
"show_numbers": True,
"save_plot": False,
"save_path": None,
"export_csv": False,
"export_json": False,
"csv_path": None,
"json_path": None,
"narayana_shape_type": None,
"narayana_width": None,
"region_label": "Square-Kare"
}
# Tek satırda çalıştır
ks.generate_full_report(test_params)
import matplotlib.pyplot as plt
import kececisquares as ks
from kececisquares import get_user_parameters, generate_full_report
# 1. Kullanıcıdan parametreleri al
params = get_user_parameters()
# 2. Parametre geçerliyse görselleştirmeyi başlat
if params:
try:
print("\n⏳ Keçeci Visualizer çalışıyor...")
report = ks.generate_full_report(params)
# 3. Sonuçları özetle
print("\n" + "="*50)
print("📦 OLUŞTURULAN ÇIKTILAR")
print("="*50)
print(f" 🔹 Seçilen Eleman: {report['statistics']['count']}")
print(f" 🔹 Toplam Değer : {report['statistics']['sum']:,}")
for key in ("plot", "csv", "json"):
if report.get(key):
print(f" ✅ {key.upper():<5}: {report[key]}")
print("="*50)
print("🎉 İşlem başarıyla tamamlandı.")
except Exception as e:
print(f"\n❌ Hata oluştu: {e}")
import matplotlib.pyplot as plt
import kececisquares as ks
from kececisquares import (
get_user_parameters,
generate_binomial_triangle,
generate_narayana_triangle,
draw_kececi_region,
export_to_csv,
export_to_json,
calculate_region_statistics
)
# 1. Parametre al
params = get_user_parameters()
if not params:
exit("❌ Parametre alınamadı.")
# 2. Üçgeni oluştur
if params["triangle_source"] == "narayana":
triangle = generate_narayana_triangle(params["num_rows"])
else:
triangle = generate_binomial_triangle(params["num_rows"])
# 3. Görselleştir (5 değer döner: fig, ax, series_data, indices, total_value)
result = ks.draw_kececi_region(
triangle_data=triangle,
num_rows=params["num_rows"],
region_size=params["region_size"],
start_row_0based=params["start_row_0idx"],
region_type=params["region_type"],
shape_to_draw=params["shape_type"],
alignment=params["alignment"],
is_filled=params["is_filled"],
show_values=params["show_numbers"],
triangle_source=params["triangle_source"],
narayana_shape_type=params.get("narayana_shape_type"),
narayana_width=params.get("narayana_width"),
show_plot=False # Manuel kontrol için False
)
if result[0] is None:
exit("❌ Görselleştirme başarısız.")
fig, ax, series_data, indices, total = result
# 4. İstatistikleri hesapla
stats = calculate_region_statistics(series_data, params["region_label"])
print(f"\n📊 Toplam: {total:,} | Eleman: {len(series_data)} | Ortalama: {stats['mean']:.2f}")
# 5. Dışa Aktar (İsteğe bağlı)
if params.get("csv_path"):
ks.export_to_csv(series_data, indices, params["csv_path"])
if params.get("json_path"):
payload = {"series": series_data, "stats": stats, "config": params}
ks.export_to_json(payload, params["json_path"])
# 6. Plot'u kaydet ve göster
if params.get("save_path"):
fig.savefig(params["save_path"], dpi=200, bbox_inches="tight")
print(f"✅ PNG kaydedildi: {params['save_path']}")
plt.show()
#!/usr/bin/env python3
"""Quick test for the fixes."""
from kececisquares import (
generate_binomial_triangle,
kececi_binomial_square,
draw_shape_on_axis,
draw_kececi_region
)
import matplotlib.pyplot as plt
print("🔧 Testing fixes...")
# Test 1: Function signature
tri = generate_binomial_triangle(10)
try:
series, total, indices = kececi_binomial_square(tri, 4, 5, "center")
print(f"✅ kececi_binomial_square: OK ({len(series)} values, total={total})")
except TypeError as e:
print(f"❌ kececi_binomial_square: {e}")
# Test 2: draw_shape_on_axis with RegularPolygon
try:
fig, ax = plt.subplots()
draw_shape_on_axis(ax, 0, 0, "hexagon", 0.5, "gold", "black")
plt.close(fig)
print("✅ draw_shape_on_axis: OK")
except TypeError as e:
print(f"❌ draw_shape_on_axis: {e}")
# Test 3: Full visualization
try:
result = draw_kececi_region(
triangle_data=tri, num_rows=10, region_size=4, start_row_0based=5,
region_type="square", show_plot=False
)
if result[0] is not None:
print("✅ draw_kececi_region: OK")
plt.close(result[0])
else:
print("❌ draw_kececi_region: returned None")
except Exception as e:
print(f"❌ draw_kececi_region: {e}")
print("\n🎉 All tests completed!")
from kececisquares import generate_full_report, print_triangle_matrix
# Örnek 1: Tek fonksiyonla tam rapor
params = {
"triangle_source": "binomial",
"num_rows": 15,
"region_size": 4,
"start_row_0idx": 5,
"region_type": "square",
"alignment": "center",
"save_path": "output.png",
"csv_path": "output.csv",
"json_path": "output.json",
}
result = generate_full_report(params)
print(f"📁 Generated: { {k:v for k,v in result.items() if v} }")
# Örnek 2: Sadece matris yazdırma
from kececisquares import generate_binomial_triangle, print_triangle_matrix
tri = generate_binomial_triangle(10)
print_triangle_matrix(tri, title="Pascal Triangle (10 rows)")
This project is licensed under the AGPL3.0-or-later License. See the LICENSE file for details.
If this library was useful to you in your research, please cite us. Following the GitHub citation standards, here is the recommended citation.
@misc{kececi_2025_15411670,
author = {Keçeci, Mehmet},
title = {kececisquares},
month = may,
year = 2025,
publisher = {GitHub, PyPI, Anaconda, Zenodo},
version = {0.1.0},
doi = {10.5281/zenodo.15411670},
url = {https://doi.org/10.5281/zenodo.15411670},
}
@misc{kececi_2025_15425855,
author = {Keçeci, Mehmet},
title = {The Keçeci Binomial Square: A Reinterpretation of
the Standard Binomial Expansion and Its Potential
Applications
},
month = may,
year = 2025,
publisher = {Zenodo},
doi = {10.5281/zenodo.15425855},
url = {https://doi.org/10.5281/zenodo.15425855},
}
Keçeci, M. (2025). kececisquares [Data set]. WorkflowHub. https://doi.org/10.48546/workflowhub.datafile.15.1
Keçeci, M. (2025). Keçeci's Arithmetical Square. Authorea. June, 2025. https://doi.org/10.22541/au.175070836.63624913/v1
Keçeci, M. (2025). kececisquares. Zenodo. https://doi.org/10.5281/zenodo.15411670
Keçeci, M. (2025). The Keçeci Binomial Square: A Reinterpretation of the Standard Binomial Expansion and Its Potential Applications. https://doi.org/10.5281/zenodo.15425529
Keçeci, Mehmet. kececisquares [Data set]. WorkflowHub, 2025. https://doi.org/10.48546/workflowhub.datafile.15.1
Keçeci, Mehmet. "Keçeci's Arithmetical Square". Authorea. June, 2025. https://doi.org/10.22541/au.175070836.63624913/v1
Keçeci, Mehmet. "kececisquares". Zenodo, 01 May 2025. https://doi.org/10.5281/zenodo.15411670
Keçeci, Mehmet. "The Keçeci Binomial Square: A Reinterpretation of the Standard Binomial Expansion and Its Potential Applications", 15 Mayıs 2025. https://doi.org/10.5281/zenodo.15425529
Files
Files
(300.6 kB)
| Name | Size | Download all |
|---|---|---|
|
md5:49cca9a9c5914f7bc90afb8cd72a0b31
|
41.9 kB | Download |
|
md5:fefd3bd7b1202d786d046c84359427dd
|
111.7 kB | Download |
|
md5:a515ebbd6f91c7ac257d1daa449a6013
|
88.5 kB | Download |
|
md5:19d65b54f478dad5af0a53fba1eb8381
|
58.5 kB | Download |
Additional details
Dates
- Accepted
-
2025-05-14Keçeci Binomial Square
Software
- Repository URL
- https://github.com/WhiteSymmetry/kececisquares
- Programming language
- Python
- Development Status
- Active