kececinumbers 0.5.4__tar.gz → 0.5.5__tar.gz
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-0.5.4/kececinumbers.egg-info → kececinumbers-0.5.5}/PKG-INFO +1 -1
- {kececinumbers-0.5.4 → kececinumbers-0.5.5}/kececinumbers/__init__.py +1 -1
- {kececinumbers-0.5.4 → kececinumbers-0.5.5}/kececinumbers/_version.py +1 -1
- {kececinumbers-0.5.4 → kececinumbers-0.5.5}/kececinumbers/kececinumbers.py +38 -107
- {kececinumbers-0.5.4 → kececinumbers-0.5.5/kececinumbers.egg-info}/PKG-INFO +1 -1
- {kececinumbers-0.5.4 → kececinumbers-0.5.5}/pyproject.toml +1 -1
- {kececinumbers-0.5.4 → kececinumbers-0.5.5}/LICENSE +0 -0
- {kececinumbers-0.5.4 → kececinumbers-0.5.5}/MANIFEST.in +0 -0
- {kececinumbers-0.5.4 → kececinumbers-0.5.5}/README.md +0 -0
- {kececinumbers-0.5.4 → kececinumbers-0.5.5}/docs/conf.py +0 -0
- {kececinumbers-0.5.4 → kececinumbers-0.5.5}/kececinumbers.egg-info/SOURCES.txt +0 -0
- {kececinumbers-0.5.4 → kececinumbers-0.5.5}/kececinumbers.egg-info/dependency_links.txt +0 -0
- {kececinumbers-0.5.4 → kececinumbers-0.5.5}/kececinumbers.egg-info/requires.txt +0 -0
- {kececinumbers-0.5.4 → kececinumbers-0.5.5}/kececinumbers.egg-info/top_level.txt +0 -0
- {kececinumbers-0.5.4 → kececinumbers-0.5.5}/setup.cfg +0 -0
- {kececinumbers-0.5.4 → kececinumbers-0.5.5}/setup.py +0 -0
- {kececinumbers-0.5.4 → kececinumbers-0.5.5}/tests/test_sample.py +0 -0
@@ -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,54 @@ 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
576
|
# 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
577
|
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
|
-
|
578
|
+
current_value = int(float(start_input_raw)); add_value_typed = int(float(add_input_raw)); ask_unit = 1; use_integer_division = True
|
590
579
|
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
|
-
|
580
|
+
current_value = float(start_input_raw); add_value_typed = float(add_input_raw); ask_unit = 1.0
|
595
581
|
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
|
-
|
582
|
+
current_value = Fraction(start_input_raw); add_value_typed = Fraction(add_input_raw); ask_unit = Fraction(1)
|
600
583
|
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
|
-
|
584
|
+
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
585
|
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
|
-
|
586
|
+
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
587
|
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
|
-
|
588
|
+
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
589
|
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
|
-
|
590
|
+
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
591
|
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
|
-
|
592
|
+
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
593
|
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
|
-
|
594
|
+
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
595
|
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
|
-
|
596
|
+
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
597
|
except (ValueError, TypeError) as e:
|
650
598
|
print(f"ERROR: Failed to initialize type {kececi_type} with start='{start_input_raw}' and increment='{add_input_raw}': {e}")
|
651
599
|
return []
|
652
600
|
|
653
|
-
# --- Üreteç Döngüsü ---
|
654
|
-
|
601
|
+
# --- 2. Üreteç Döngüsü ---
|
602
|
+
clean_trajectory = [current_value]
|
603
|
+
full_log = [current_value]
|
604
|
+
|
655
605
|
last_divisor_used = None
|
656
606
|
ask_counter = 0
|
657
607
|
|
658
608
|
for _ in range(iterations):
|
609
|
+
# --- Bir Sonraki Adımın Değerini (next_q) Hesapla ---
|
659
610
|
added_value = current_value + add_value_typed
|
660
|
-
if include_intermediate_steps:
|
661
|
-
sequence.append(added_value)
|
662
611
|
|
663
|
-
|
612
|
+
next_q = added_value
|
664
613
|
divided_successfully = False
|
614
|
+
modified_value = None
|
665
615
|
|
666
616
|
primary_divisor = 3 if last_divisor_used == 2 or last_divisor_used is None else 2
|
667
617
|
alternative_divisor = 2 if primary_divisor == 3 else 3
|
668
618
|
|
669
619
|
for divisor in [primary_divisor, alternative_divisor]:
|
670
620
|
if _is_divisible(added_value, divisor, kececi_type):
|
671
|
-
|
621
|
+
next_q = added_value // divisor if use_integer_division else added_value / divisor
|
672
622
|
last_divisor_used = divisor
|
673
623
|
divided_successfully = True
|
674
624
|
break
|
@@ -677,49 +627,30 @@ def unified_generator(kececi_type: int, start_input_raw: str, add_input_raw: str
|
|
677
627
|
modified_value = (added_value + ask_unit) if ask_counter == 0 else (added_value - ask_unit)
|
678
628
|
ask_counter = 1 - ask_counter
|
679
629
|
|
680
|
-
|
681
|
-
sequence.append(modified_value)
|
682
|
-
|
683
|
-
# Pertürbasyon sonrası değeri tekrar bölme testine sok
|
684
|
-
result_value = modified_value
|
630
|
+
next_q = modified_value
|
685
631
|
|
686
632
|
for divisor in [primary_divisor, alternative_divisor]:
|
687
633
|
if _is_divisible(modified_value, divisor, kececi_type):
|
688
|
-
|
634
|
+
next_q = modified_value // divisor if use_integer_division else modified_value / divisor
|
689
635
|
last_divisor_used = divisor
|
690
636
|
break
|
691
637
|
|
692
|
-
#
|
693
|
-
|
638
|
+
# --- Sonuçları Ayrı Ayrı Kaydet ---
|
639
|
+
full_log.append(added_value)
|
640
|
+
if modified_value is not None:
|
641
|
+
full_log.append(modified_value)
|
642
|
+
full_log.append(next_q)
|
694
643
|
|
695
|
-
|
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)
|
644
|
+
clean_trajectory.append(next_q)
|
699
645
|
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
#
|
704
|
-
|
705
|
-
|
706
|
-
|
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
|
-
|
722
|
-
return sequence
|
646
|
+
# --- Durumu Güncelle ---
|
647
|
+
current_value = next_q
|
648
|
+
|
649
|
+
# --- 3. İsteğe Göre Doğru Listeyi Döndür ---
|
650
|
+
if include_intermediate_steps:
|
651
|
+
return full_log
|
652
|
+
else:
|
653
|
+
return clean_trajectory
|
723
654
|
|
724
655
|
def print_detailed_report(sequence: List[Any], params: Dict[str, Any]):
|
725
656
|
"""Generates and prints a detailed report of the sequence results."""
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|