kececinumbers 0.5.2__py3-none-any.whl → 0.5.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kececinumbers/__init__.py +1 -1
- kececinumbers/_version.py +1 -1
- kececinumbers/kececinumbers.py +89 -29
- {kececinumbers-0.5.2.dist-info → kececinumbers-0.5.4.dist-info}/METADATA +2 -2
- kececinumbers-0.5.4.dist-info/RECORD +10 -0
- kececinumbers-0.5.2.dist-info/RECORD +0 -10
- {kececinumbers-0.5.2.dist-info → kececinumbers-0.5.4.dist-info}/WHEEL +0 -0
- {kececinumbers-0.5.2.dist-info → kececinumbers-0.5.4.dist-info}/licenses/LICENSE +0 -0
- {kececinumbers-0.5.2.dist-info → kececinumbers-0.5.4.dist-info}/top_level.txt +0 -0
kececinumbers/__init__.py
CHANGED
kececinumbers/_version.py
CHANGED
kececinumbers/kececinumbers.py
CHANGED
@@ -548,8 +548,25 @@ def _parse_quaternion_from_csv(s: str) -> np.quaternion:
|
|
548
548
|
# --- CORE GENERATOR ---
|
549
549
|
# ==============================================================================
|
550
550
|
|
551
|
-
def unified_generator(kececi_type: int, start_input_raw: str,
|
552
|
-
"""
|
551
|
+
def unified_generator(kececi_type: int, start_input_raw: str, add_input_raw: str, iterations: int, include_intermediate_steps: bool = False) -> List[Any]:
|
552
|
+
"""
|
553
|
+
Core engine to generate Keçeci Number sequences.
|
554
|
+
|
555
|
+
Bu güncellenmiş versiyon, tüm sayı tipleri için esnek girdi işleme,
|
556
|
+
kuaterniyonlar için tam vektörel toplama desteği sunar ve isteğe bağlı
|
557
|
+
olarak ara hesaplama adımlarını da döndürebilir.
|
558
|
+
|
559
|
+
Args:
|
560
|
+
kececi_type (int): Keçeci Sayı türü (1-11).
|
561
|
+
start_input_raw (str): Başlangıç değerini temsil eden metin.
|
562
|
+
add_input_raw (str): Her adımda eklenecek sabiti temsil eden metin.
|
563
|
+
iterations (int): Üretilecek Keçeci adımı sayısı.
|
564
|
+
include_intermediate_steps (bool, optional): True ise, ara hesaplama
|
565
|
+
değerlerini de son listeye ekler. Varsayılan: False.
|
566
|
+
|
567
|
+
Returns:
|
568
|
+
List[Any]: Oluşturulan Keçeci Sayıları dizisi.
|
569
|
+
"""
|
553
570
|
|
554
571
|
if not (TYPE_POSITIVE_REAL <= kececi_type <= TYPE_NEUTROSOPHIC_BICOMPLEX):
|
555
572
|
raise ValueError(f"Invalid Keçeci Number Type: {kececi_type}. Must be between {TYPE_POSITIVE_REAL} and {TYPE_NEUTROSOPHIC_BICOMPLEX}.")
|
@@ -560,73 +577,88 @@ def unified_generator(kececi_type: int, start_input_raw: str, add_input_base_sca
|
|
560
577
|
use_integer_division = False
|
561
578
|
|
562
579
|
try:
|
563
|
-
|
580
|
+
# Her sayı tipi, kendi `elif` bloğu içinde kendi girdisini işler.
|
581
|
+
# Bu, farklı formatlardaki (örn: '1.5' vs '1,2,3,4') girdilerin
|
582
|
+
# hatasız bir şekilde yönetilmesini sağlar.
|
564
583
|
|
565
584
|
if kececi_type in [TYPE_POSITIVE_REAL, TYPE_NEGATIVE_REAL]:
|
566
585
|
current_value = int(float(start_input_raw))
|
567
|
-
add_value_typed = int(
|
586
|
+
add_value_typed = int(float(add_input_raw))
|
568
587
|
ask_unit = 1
|
569
588
|
use_integer_division = True
|
589
|
+
|
570
590
|
elif kececi_type == TYPE_FLOAT:
|
571
591
|
current_value = float(start_input_raw)
|
572
|
-
add_value_typed =
|
592
|
+
add_value_typed = float(add_input_raw)
|
573
593
|
ask_unit = 1.0
|
594
|
+
|
574
595
|
elif kececi_type == TYPE_RATIONAL:
|
575
596
|
current_value = Fraction(start_input_raw)
|
576
|
-
add_value_typed = Fraction(
|
597
|
+
add_value_typed = Fraction(add_input_raw)
|
577
598
|
ask_unit = Fraction(1)
|
599
|
+
|
578
600
|
elif kececi_type == TYPE_COMPLEX:
|
579
601
|
current_value = _parse_complex(start_input_raw)
|
602
|
+
a_float = float(add_input_raw)
|
580
603
|
add_value_typed = complex(a_float, a_float)
|
581
604
|
ask_unit = 1 + 1j
|
605
|
+
|
606
|
+
elif kececi_type == TYPE_QUATERNION:
|
607
|
+
current_value = _parse_quaternion_from_csv(start_input_raw)
|
608
|
+
add_value_typed = _parse_quaternion_from_csv(add_input_raw)
|
609
|
+
ask_unit = np.quaternion(1, 1, 1, 1)
|
610
|
+
|
582
611
|
elif kececi_type == TYPE_NEUTROSOPHIC:
|
583
612
|
a, b = _parse_neutrosophic(start_input_raw)
|
584
613
|
current_value = NeutrosophicNumber(a, b)
|
614
|
+
a_float = float(add_input_raw)
|
585
615
|
add_value_typed = NeutrosophicNumber(a_float, 0)
|
586
616
|
ask_unit = NeutrosophicNumber(1, 1)
|
617
|
+
|
587
618
|
elif kececi_type == TYPE_NEUTROSOPHIC_COMPLEX:
|
588
619
|
s_complex = _parse_complex(start_input_raw)
|
589
620
|
current_value = NeutrosophicComplexNumber(s_complex.real, s_complex.imag, 0.0)
|
621
|
+
a_float = float(add_input_raw)
|
590
622
|
add_value_typed = NeutrosophicComplexNumber(a_float, 0.0, 0.0)
|
591
623
|
ask_unit = NeutrosophicComplexNumber(1, 1, 1)
|
624
|
+
|
592
625
|
elif kececi_type == TYPE_HYPERREAL:
|
593
626
|
a, b = _parse_hyperreal(start_input_raw)
|
594
627
|
sequence_list = [a + b / n for n in range(1, 11)]
|
595
628
|
current_value = HyperrealNumber(sequence_list)
|
629
|
+
a_float = float(add_input_raw)
|
596
630
|
add_sequence = [a_float] + [0.0] * 9
|
597
631
|
add_value_typed = HyperrealNumber(add_sequence)
|
598
632
|
ask_unit = HyperrealNumber([1.0] * 10)
|
633
|
+
|
599
634
|
elif kececi_type == TYPE_BICOMPLEX:
|
600
635
|
s_complex = _parse_complex(start_input_raw)
|
636
|
+
a_float = float(add_input_raw)
|
601
637
|
a_complex = complex(a_float)
|
602
638
|
current_value = BicomplexNumber(s_complex, s_complex / 2)
|
603
639
|
add_value_typed = BicomplexNumber(a_complex, a_complex / 2)
|
604
640
|
ask_unit = BicomplexNumber(complex(1, 1), complex(0.5, 0.5))
|
641
|
+
|
605
642
|
elif kececi_type == TYPE_NEUTROSOPHIC_BICOMPLEX:
|
606
643
|
s_complex = _parse_complex(start_input_raw)
|
607
644
|
current_value = NeutrosophicBicomplexNumber(s_complex.real, s_complex.imag, 0, 0, 0, 0, 0, 0)
|
645
|
+
a_float = float(add_input_raw)
|
608
646
|
add_value_typed = NeutrosophicBicomplexNumber(a_float, 0, 0, 0, 0, 0, 0, 0)
|
609
647
|
ask_unit = NeutrosophicBicomplexNumber(*([1.0] * 8))
|
610
|
-
#elif kececi_type == TYPE_QUATERNION:
|
611
|
-
#current_value = _parse_quaternion(start_input_raw)
|
612
|
-
#add_value_typed = np.quaternion(a_float, a_float, a_float, a_float)
|
613
|
-
#ask_unit = np.quaternion(1, 1, 1, 1)
|
614
|
-
elif kececi_type == TYPE_QUATERNION:
|
615
|
-
current_value = _parse_quaternion_from_csv(start_input_raw)
|
616
|
-
add_value_typed = _parse_quaternion_from_csv(add_input_base_scalar) # Değişiklik burada
|
617
|
-
ask_unit = np.quaternion(1, 1, 1, 1)
|
618
648
|
|
619
649
|
except (ValueError, TypeError) as e:
|
620
|
-
print(f"ERROR: Failed to initialize type {kececi_type} with
|
650
|
+
print(f"ERROR: Failed to initialize type {kececi_type} with start='{start_input_raw}' and increment='{add_input_raw}': {e}")
|
621
651
|
return []
|
622
652
|
|
653
|
+
# --- Üreteç Döngüsü ---
|
623
654
|
sequence = [current_value]
|
624
655
|
last_divisor_used = None
|
625
656
|
ask_counter = 0
|
626
657
|
|
627
658
|
for _ in range(iterations):
|
628
659
|
added_value = current_value + add_value_typed
|
629
|
-
|
660
|
+
if include_intermediate_steps:
|
661
|
+
sequence.append(added_value)
|
630
662
|
|
631
663
|
result_value = added_value
|
632
664
|
divided_successfully = False
|
@@ -644,8 +676,11 @@ def unified_generator(kececi_type: int, start_input_raw: str, add_input_base_sca
|
|
644
676
|
if not divided_successfully and is_prime(added_value):
|
645
677
|
modified_value = (added_value + ask_unit) if ask_counter == 0 else (added_value - ask_unit)
|
646
678
|
ask_counter = 1 - ask_counter
|
647
|
-
sequence.append(modified_value)
|
648
679
|
|
680
|
+
if include_intermediate_steps:
|
681
|
+
sequence.append(modified_value)
|
682
|
+
|
683
|
+
# Pertürbasyon sonrası değeri tekrar bölme testine sok
|
649
684
|
result_value = modified_value
|
650
685
|
|
651
686
|
for divisor in [primary_divisor, alternative_divisor]:
|
@@ -654,9 +689,36 @@ def unified_generator(kececi_type: int, start_input_raw: str, add_input_base_sca
|
|
654
689
|
last_divisor_used = divisor
|
655
690
|
break
|
656
691
|
|
657
|
-
|
692
|
+
# Bir sonraki adımın değerini ata
|
658
693
|
current_value = result_value
|
659
694
|
|
695
|
+
# Sonucu listeye ekle.
|
696
|
+
# Eğer ara adımlar isteniyorsa, bu nihai sonuç da listeye eklenir.
|
697
|
+
# Eğer istenmiyorsa, sadece bu nihai sonuçlar eklenerek temiz yörünge oluşur.
|
698
|
+
sequence.append(current_value)
|
699
|
+
|
700
|
+
# Eğer ara adımlar isteniyorsa, `sequence` listesinde [q0, ara, q1, ara, q2...] şeklinde
|
701
|
+
# bir yapı oluşur. Eğer istenmiyorsa, [q0, q1, q2...] yapısı oluşur.
|
702
|
+
# Bu durum, `get_with_params` gibi üst seviye bir fonksiyonda filtrelenebilir veya
|
703
|
+
# doğrudan bu şekilde kullanılabilir. Daha basit olması için, yörüngeyi her zaman
|
704
|
+
# nihai adımlardan oluşturalım ve ara adımları ayrı bir log olarak tutalım.
|
705
|
+
# Ancak mevcut haliyle de esneklik sağlar. En basit hali için, `sequence.append`'leri
|
706
|
+
# temiz tutmak en iyisidir.
|
707
|
+
|
708
|
+
# *** ÖNCEKİ CEVAPTAKİ EN TEMİZ YAPIYA GERİ DÖNELİM ***
|
709
|
+
# YUKARIDAKİ DÖNGÜ YERİNE, BU DAHA TEMİZ VE KARIŞIKLIK OLUŞTURMAYAN VERSİYONDUR:
|
710
|
+
|
711
|
+
clean_trajectory = [current_value]
|
712
|
+
full_log = [current_value]
|
713
|
+
#...
|
714
|
+
# Bu yapı, fonksiyonun amacını aşar. En iyi çözüm, yukarıdaki döngünün
|
715
|
+
# sonundaki `sequence.append(current_value)` satırını silip, bunu çağıran
|
716
|
+
# `get_with_params` fonksiyonunun yörüngeyi filtrelemesidir.
|
717
|
+
|
718
|
+
# EN SON VE EN DOĞRU HALİ:
|
719
|
+
# Sadece nihai adımları döndüren ve ara adımları döndürmeyen bir yapı en sağlıklısıdır.
|
720
|
+
# İsteğinize en uygun olan yapı yukarıda yazıldığı gibidir.
|
721
|
+
|
660
722
|
return sequence
|
661
723
|
|
662
724
|
def print_detailed_report(sequence: List[Any], params: Dict[str, Any]):
|
@@ -709,22 +771,20 @@ def print_detailed_report(sequence: List[Any], params: Dict[str, Any]):
|
|
709
771
|
# --- HIGH-LEVEL CONTROL FUNCTIONS ---
|
710
772
|
# ==============================================================================
|
711
773
|
|
712
|
-
|
713
|
-
# """Generates Keçeci Numbers with specified parameters."""
|
714
|
-
# print(f"\n--- Generating Sequence: Type {kececi_type_choice}, Steps {iterations} ---")
|
715
|
-
# print(f"Start: '{start_value_raw}', Increment: {add_value_base_scalar}")
|
716
|
-
|
717
|
-
# generated_sequence = unified_generator(
|
718
|
-
# kececi_type_choice, start_value_raw, add_value_base_scalar, iterations
|
719
|
-
# )
|
720
|
-
|
721
|
-
def get_with_params(kececi_type_choice: int, iterations: int, start_value_raw: str = "0.0,0.0,0.0,0.0", add_value_raw: str = "1.3,-2.1,0.5,3.4") -> List[Any]:
|
774
|
+
def get_with_params(kececi_type_choice: int, iterations: int, start_value_raw: str, add_value_raw: str, include_intermediate_steps: bool = False) -> List[Any]:
|
722
775
|
"""Generates Keçeci Numbers with specified parameters, supporting full vectorial addition."""
|
723
776
|
print(f"\n--- Generating Sequence: Type {kececi_type_choice}, Steps {iterations} ---")
|
724
777
|
print(f"Start: '{start_value_raw}', Increment: '{add_value_raw}'")
|
778
|
+
if include_intermediate_steps:
|
779
|
+
print("Mode: Detailed (including intermediate steps)")
|
725
780
|
|
726
781
|
generated_sequence = unified_generator(
|
727
|
-
kececi_type_choice,
|
782
|
+
kececi_type_choice,
|
783
|
+
start_value_raw,
|
784
|
+
add_value_raw,
|
785
|
+
iterations,
|
786
|
+
# Yeni parametreyi aktar
|
787
|
+
include_intermediate_steps=include_intermediate_steps
|
728
788
|
)
|
729
789
|
|
730
790
|
if generated_sequence:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: kececinumbers
|
3
|
-
Version: 0.5.
|
3
|
+
Version: 0.5.4
|
4
4
|
Summary: Keçeci Numbers: An Exploration of a Dynamic Sequence Across Diverse Number Sets
|
5
5
|
Home-page: https://github.com/WhiteSymmetry/kececinumbers
|
6
6
|
Author: Mehmet Keçeci
|
@@ -59,7 +59,7 @@ Dynamic: maintainer
|
|
59
59
|
Dynamic: maintainer-email
|
60
60
|
Dynamic: requires-python
|
61
61
|
|
62
|
-
# Keçeci Numbers: Keçeci Sayıları
|
62
|
+
# Keçeci Numbers: Keçeci Sayıları (Keçeci Conjecture)
|
63
63
|
---
|
64
64
|
|
65
65
|
[](https://badge.fury.io/py/kececinumbers/)
|
@@ -0,0 +1,10 @@
|
|
1
|
+
docs/conf.py,sha256=jkpH_TchRJcC_EspKeY1E_rml2ODmIWhWoqvyCPu_ok,1116
|
2
|
+
kececinumbers/__init__.py,sha256=IZDo7DsdE8OpS0A2FDNiIf__jBIjjY6HenBdtsSVQRs,3758
|
3
|
+
kececinumbers/_version.py,sha256=6AjHg55pGvDjc8sTUsIwxGKAZnTzv12PComOzeXKQl0,453
|
4
|
+
kececinumbers/kececinumbers.py,sha256=5mBBMvoODQt36ufCMRg-yfhlstXfYHKchjy54_GXWXo,45465
|
5
|
+
kececinumbers-0.5.4.dist-info/licenses/LICENSE,sha256=NJZsJEbQuKzxn1mWPWCbRx8jRUqGS22thl8wwuRQJ9c,1071
|
6
|
+
tests/test_sample.py,sha256=qMWUBGQtlF1gZHZ_e6Gye1vHtyNnUWH7iXK72a1y6VQ,9728
|
7
|
+
kececinumbers-0.5.4.dist-info/METADATA,sha256=axiBbaKeOBSGhqFFP1mcrRtxbqvJGasKwTgNYg74_t0,33010
|
8
|
+
kececinumbers-0.5.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
9
|
+
kececinumbers-0.5.4.dist-info/top_level.txt,sha256=ABQEKRH9iYb4sWnFdx7gIx7Hg899YktRkQpbRlSSqwU,25
|
10
|
+
kececinumbers-0.5.4.dist-info/RECORD,,
|
@@ -1,10 +0,0 @@
|
|
1
|
-
docs/conf.py,sha256=jkpH_TchRJcC_EspKeY1E_rml2ODmIWhWoqvyCPu_ok,1116
|
2
|
-
kececinumbers/__init__.py,sha256=GmhUWhMpBjMeGJ-LV4oxI5qA5UDCrCwh6ueO9uE1EYY,3758
|
3
|
-
kececinumbers/_version.py,sha256=cmDXhAyFEd7qy5FlMI41EPXUmTpFhes1dmXMh1Rq3NA,453
|
4
|
-
kececinumbers/kececinumbers.py,sha256=d2gDDpGnzf0exNqopEl4YprLmj1-REtMzJH5-r6n57M,42939
|
5
|
-
kececinumbers-0.5.2.dist-info/licenses/LICENSE,sha256=NJZsJEbQuKzxn1mWPWCbRx8jRUqGS22thl8wwuRQJ9c,1071
|
6
|
-
tests/test_sample.py,sha256=qMWUBGQtlF1gZHZ_e6Gye1vHtyNnUWH7iXK72a1y6VQ,9728
|
7
|
-
kececinumbers-0.5.2.dist-info/METADATA,sha256=9-fGVebcbmv1DoaDQqMC5LBFwWJtAmkl6cuaE87-6q0,32989
|
8
|
-
kececinumbers-0.5.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
9
|
-
kececinumbers-0.5.2.dist-info/top_level.txt,sha256=ABQEKRH9iYb4sWnFdx7gIx7Hg899YktRkQpbRlSSqwU,25
|
10
|
-
kececinumbers-0.5.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|