kececinumbers 0.5.4__py3-none-any.whl → 0.5.6__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 +42 -108
- {kececinumbers-0.5.4.dist-info → kececinumbers-0.5.6.dist-info}/METADATA +1 -1
- kececinumbers-0.5.6.dist-info/RECORD +10 -0
- kececinumbers-0.5.4.dist-info/RECORD +0 -10
- {kececinumbers-0.5.4.dist-info → kececinumbers-0.5.6.dist-info}/WHEEL +0 -0
- {kececinumbers-0.5.4.dist-info → kececinumbers-0.5.6.dist-info}/licenses/LICENSE +0 -0
- {kececinumbers-0.5.4.dist-info → kececinumbers-0.5.6.dist-info}/top_level.txt +0 -0
kececinumbers/__init__.py
CHANGED
kececinumbers/_version.py
CHANGED
kececinumbers/kececinumbers.py
CHANGED
@@ -552,9 +552,9 @@ def unified_generator(kececi_type: int, start_input_raw: str, add_input_raw: str
|
|
552
552
|
"""
|
553
553
|
Core engine to generate Keçeci Number sequences.
|
554
554
|
|
555
|
-
Bu
|
556
|
-
|
557
|
-
|
555
|
+
Bu nihai versiyon, tüm sayı tipleri için esnek girdi işleme, kuaterniyonlar
|
556
|
+
için tam vektörel toplama desteği sunar ve isteğe bağlı olarak ara
|
557
|
+
hesaplama adımlarını da, veri tekrarı olmadan doğru bir şekilde döndürür.
|
558
558
|
|
559
559
|
Args:
|
560
560
|
kececi_type (int): Keçeci Sayı türü (1-11).
|
@@ -571,104 +571,53 @@ def unified_generator(kececi_type: int, start_input_raw: str, add_input_raw: str
|
|
571
571
|
if not (TYPE_POSITIVE_REAL <= kececi_type <= TYPE_NEUTROSOPHIC_BICOMPLEX):
|
572
572
|
raise ValueError(f"Invalid Keçeci Number Type: {kececi_type}. Must be between {TYPE_POSITIVE_REAL} and {TYPE_NEUTROSOPHIC_BICOMPLEX}.")
|
573
573
|
|
574
|
-
|
575
|
-
add_value_typed = None
|
576
|
-
ask_unit = None
|
577
|
-
use_integer_division = False
|
578
|
-
|
574
|
+
# --- 1. Değişkenlerin Başlatılması ---
|
579
575
|
try:
|
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.
|
583
|
-
|
584
576
|
if kececi_type in [TYPE_POSITIVE_REAL, TYPE_NEGATIVE_REAL]:
|
585
|
-
current_value = int(float(start_input_raw))
|
586
|
-
add_value_typed = int(float(add_input_raw))
|
587
|
-
ask_unit = 1
|
588
|
-
use_integer_division = True
|
589
|
-
|
577
|
+
current_value = int(float(start_input_raw)); add_value_typed = int(float(add_input_raw)); ask_unit = 1; use_integer_division = True
|
590
578
|
elif kececi_type == TYPE_FLOAT:
|
591
|
-
current_value = float(start_input_raw)
|
592
|
-
add_value_typed = float(add_input_raw)
|
593
|
-
ask_unit = 1.0
|
594
|
-
|
579
|
+
current_value = float(start_input_raw); add_value_typed = float(add_input_raw); ask_unit = 1.0
|
595
580
|
elif kececi_type == TYPE_RATIONAL:
|
596
|
-
current_value = Fraction(start_input_raw)
|
597
|
-
add_value_typed = Fraction(add_input_raw)
|
598
|
-
ask_unit = Fraction(1)
|
599
|
-
|
581
|
+
current_value = Fraction(start_input_raw); add_value_typed = Fraction(add_input_raw); ask_unit = Fraction(1)
|
600
582
|
elif kececi_type == TYPE_COMPLEX:
|
601
|
-
current_value = _parse_complex(start_input_raw)
|
602
|
-
a_float = float(add_input_raw)
|
603
|
-
add_value_typed = complex(a_float, a_float)
|
604
|
-
ask_unit = 1 + 1j
|
605
|
-
|
583
|
+
current_value = _parse_complex(start_input_raw); a_float = float(add_input_raw); add_value_typed = complex(a_float, a_float); ask_unit = 1 + 1j
|
606
584
|
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
|
-
|
585
|
+
current_value = _parse_quaternion_from_csv(start_input_raw); add_value_typed = _parse_quaternion_from_csv(add_input_raw); ask_unit = np.quaternion(1, 1, 1, 1)
|
611
586
|
elif kececi_type == TYPE_NEUTROSOPHIC:
|
612
|
-
a, b = _parse_neutrosophic(start_input_raw)
|
613
|
-
current_value = NeutrosophicNumber(a, b)
|
614
|
-
a_float = float(add_input_raw)
|
615
|
-
add_value_typed = NeutrosophicNumber(a_float, 0)
|
616
|
-
ask_unit = NeutrosophicNumber(1, 1)
|
617
|
-
|
587
|
+
a, b = _parse_neutrosophic(start_input_raw); current_value = NeutrosophicNumber(a, b); a_float = float(add_input_raw); add_value_typed = NeutrosophicNumber(a_float, 0); ask_unit = NeutrosophicNumber(1, 1)
|
618
588
|
elif kececi_type == TYPE_NEUTROSOPHIC_COMPLEX:
|
619
|
-
s_complex = _parse_complex(start_input_raw)
|
620
|
-
current_value = NeutrosophicComplexNumber(s_complex.real, s_complex.imag, 0.0)
|
621
|
-
a_float = float(add_input_raw)
|
622
|
-
add_value_typed = NeutrosophicComplexNumber(a_float, 0.0, 0.0)
|
623
|
-
ask_unit = NeutrosophicComplexNumber(1, 1, 1)
|
624
|
-
|
589
|
+
s_complex = _parse_complex(start_input_raw); current_value = NeutrosophicComplexNumber(s_complex.real, s_complex.imag, 0.0); a_float = float(add_input_raw); add_value_typed = NeutrosophicComplexNumber(a_float, 0.0, 0.0); ask_unit = NeutrosophicComplexNumber(1, 1, 1)
|
625
590
|
elif kececi_type == TYPE_HYPERREAL:
|
626
|
-
a, b = _parse_hyperreal(start_input_raw)
|
627
|
-
sequence_list = [a + b / n for n in range(1, 11)]
|
628
|
-
current_value = HyperrealNumber(sequence_list)
|
629
|
-
a_float = float(add_input_raw)
|
630
|
-
add_sequence = [a_float] + [0.0] * 9
|
631
|
-
add_value_typed = HyperrealNumber(add_sequence)
|
632
|
-
ask_unit = HyperrealNumber([1.0] * 10)
|
633
|
-
|
591
|
+
a, b = _parse_hyperreal(start_input_raw); sequence_list = [a + b / n for n in range(1, 11)]; current_value = HyperrealNumber(sequence_list); a_float = float(add_input_raw); add_sequence = [a_float] + [0.0] * 9; add_value_typed = HyperrealNumber(add_sequence); ask_unit = HyperrealNumber([1.0] * 10)
|
634
592
|
elif kececi_type == TYPE_BICOMPLEX:
|
635
|
-
s_complex = _parse_complex(start_input_raw)
|
636
|
-
a_float = float(add_input_raw)
|
637
|
-
a_complex = complex(a_float)
|
638
|
-
current_value = BicomplexNumber(s_complex, s_complex / 2)
|
639
|
-
add_value_typed = BicomplexNumber(a_complex, a_complex / 2)
|
640
|
-
ask_unit = BicomplexNumber(complex(1, 1), complex(0.5, 0.5))
|
641
|
-
|
593
|
+
s_complex = _parse_complex(start_input_raw); a_float = float(add_input_raw); a_complex = complex(a_float); current_value = BicomplexNumber(s_complex, s_complex / 2); add_value_typed = BicomplexNumber(a_complex, a_complex / 2); ask_unit = BicomplexNumber(complex(1, 1), complex(0.5, 0.5))
|
642
594
|
elif kececi_type == TYPE_NEUTROSOPHIC_BICOMPLEX:
|
643
|
-
s_complex = _parse_complex(start_input_raw)
|
644
|
-
current_value = NeutrosophicBicomplexNumber(s_complex.real, s_complex.imag, 0, 0, 0, 0, 0, 0)
|
645
|
-
a_float = float(add_input_raw)
|
646
|
-
add_value_typed = NeutrosophicBicomplexNumber(a_float, 0, 0, 0, 0, 0, 0, 0)
|
647
|
-
ask_unit = NeutrosophicBicomplexNumber(*([1.0] * 8))
|
648
|
-
|
595
|
+
s_complex = _parse_complex(start_input_raw); current_value = NeutrosophicBicomplexNumber(s_complex.real, s_complex.imag, 0, 0, 0, 0, 0, 0); a_float = float(add_input_raw); add_value_typed = NeutrosophicBicomplexNumber(a_float, 0, 0, 0, 0, 0, 0, 0); ask_unit = NeutrosophicBicomplexNumber(*([1.0] * 8))
|
649
596
|
except (ValueError, TypeError) as e:
|
650
597
|
print(f"ERROR: Failed to initialize type {kececi_type} with start='{start_input_raw}' and increment='{add_input_raw}': {e}")
|
651
598
|
return []
|
652
599
|
|
653
|
-
# --- Üreteç Döngüsü ---
|
654
|
-
|
600
|
+
# --- 2. Üreteç Döngüsü (Nihai ve Hata Tekrarını Önleyen Mantık) ---
|
601
|
+
clean_trajectory = [current_value]
|
602
|
+
full_log = [current_value]
|
603
|
+
|
655
604
|
last_divisor_used = None
|
656
605
|
ask_counter = 0
|
657
606
|
|
658
607
|
for _ in range(iterations):
|
608
|
+
# --- Bir Sonraki Adımın Değerini (next_q) Hesapla ---
|
659
609
|
added_value = current_value + add_value_typed
|
660
|
-
if include_intermediate_steps:
|
661
|
-
sequence.append(added_value)
|
662
610
|
|
663
|
-
|
611
|
+
next_q = added_value
|
664
612
|
divided_successfully = False
|
613
|
+
modified_value = None
|
665
614
|
|
666
615
|
primary_divisor = 3 if last_divisor_used == 2 or last_divisor_used is None else 2
|
667
616
|
alternative_divisor = 2 if primary_divisor == 3 else 3
|
668
617
|
|
669
618
|
for divisor in [primary_divisor, alternative_divisor]:
|
670
619
|
if _is_divisible(added_value, divisor, kececi_type):
|
671
|
-
|
620
|
+
next_q = added_value // divisor if use_integer_division else added_value / divisor
|
672
621
|
last_divisor_used = divisor
|
673
622
|
divided_successfully = True
|
674
623
|
break
|
@@ -677,49 +626,34 @@ def unified_generator(kececi_type: int, start_input_raw: str, add_input_raw: str
|
|
677
626
|
modified_value = (added_value + ask_unit) if ask_counter == 0 else (added_value - ask_unit)
|
678
627
|
ask_counter = 1 - ask_counter
|
679
628
|
|
680
|
-
|
681
|
-
sequence.append(modified_value)
|
682
|
-
|
683
|
-
# Pertürbasyon sonrası değeri tekrar bölme testine sok
|
684
|
-
result_value = modified_value
|
629
|
+
next_q = modified_value
|
685
630
|
|
686
631
|
for divisor in [primary_divisor, alternative_divisor]:
|
687
632
|
if _is_divisible(modified_value, divisor, kececi_type):
|
688
|
-
|
633
|
+
next_q = modified_value // divisor if use_integer_division else modified_value / divisor
|
689
634
|
last_divisor_used = divisor
|
690
635
|
break
|
691
636
|
|
692
|
-
#
|
693
|
-
|
637
|
+
# --- Sonuçları Ayrı ve Doğru Listelere Kaydet ---
|
638
|
+
full_log.append(added_value)
|
639
|
+
if modified_value is not None:
|
640
|
+
full_log.append(modified_value)
|
694
641
|
|
695
|
-
#
|
696
|
-
#
|
697
|
-
|
698
|
-
|
642
|
+
# Nihai sonucu, eğer bir önceki ara adımdan farklıysa log'a ekle.
|
643
|
+
# Bu, `(12.3, ...), (12.3, ...)` tekrarını önler.
|
644
|
+
if not full_log or next_q != full_log[-1]:
|
645
|
+
full_log.append(next_q)
|
699
646
|
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
#
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
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
|
-
|
722
|
-
return sequence
|
647
|
+
clean_trajectory.append(next_q)
|
648
|
+
|
649
|
+
# --- Durumu Güncelle ---
|
650
|
+
current_value = next_q
|
651
|
+
|
652
|
+
# --- 3. İsteğe Göre Doğru Listeyi Döndür ---
|
653
|
+
if include_intermediate_steps:
|
654
|
+
return full_log
|
655
|
+
else:
|
656
|
+
return clean_trajectory
|
723
657
|
|
724
658
|
def print_detailed_report(sequence: List[Any], params: Dict[str, Any]):
|
725
659
|
"""Generates and prints a detailed report of the sequence results."""
|
@@ -0,0 +1,10 @@
|
|
1
|
+
docs/conf.py,sha256=jkpH_TchRJcC_EspKeY1E_rml2ODmIWhWoqvyCPu_ok,1116
|
2
|
+
kececinumbers/__init__.py,sha256=pmRMcT9yVvrBTCuAVO7wPj3JNfjBpiyRvOyX0k7XfgY,3758
|
3
|
+
kececinumbers/_version.py,sha256=6ErptlqbjXrnld6IplmBnkQKhPNfpV_qkZZLw-Bu4qY,453
|
4
|
+
kececinumbers/kececinumbers.py,sha256=v3KyAjIKOGiG2HgpSn_jwZSMald41leb0VDdBKPJ6ME,43710
|
5
|
+
kececinumbers-0.5.6.dist-info/licenses/LICENSE,sha256=NJZsJEbQuKzxn1mWPWCbRx8jRUqGS22thl8wwuRQJ9c,1071
|
6
|
+
tests/test_sample.py,sha256=qMWUBGQtlF1gZHZ_e6Gye1vHtyNnUWH7iXK72a1y6VQ,9728
|
7
|
+
kececinumbers-0.5.6.dist-info/METADATA,sha256=acRgMTt4zHgUxpwMLG35Fg3If1AWrRsoRupoi6tOvJ4,33010
|
8
|
+
kececinumbers-0.5.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
9
|
+
kececinumbers-0.5.6.dist-info/top_level.txt,sha256=ABQEKRH9iYb4sWnFdx7gIx7Hg899YktRkQpbRlSSqwU,25
|
10
|
+
kececinumbers-0.5.6.dist-info/RECORD,,
|
@@ -1,10 +0,0 @@
|
|
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,,
|
File without changes
|
File without changes
|
File without changes
|