kececinumbers 0.5.3__py3-none-any.whl → 0.5.5__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 CHANGED
@@ -22,7 +22,7 @@ import warnings
22
22
  # importlib.reload(kececinumbers) # F821 undefined name 'kececinumbers'
23
23
 
24
24
  # Paket sürüm numarası
25
- __version__ = "0.5.3"
25
+ __version__ = "0.5.5"
26
26
  __author__ = "Mehmet Keçeci"
27
27
  __email__ = "mkececi@yaani.com"
28
28
 
kececinumbers/_version.py CHANGED
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # _version.py
3
3
 
4
- __version__ = "0.5.3"
4
+ __version__ = "0.5.5"
5
5
  __license__ = "MIT"
6
6
  __description__ = "Keçeci Numbers: An Exploration of a Dynamic Sequence Across Diverse Number Sets."
7
7
  __author__ = "Mehmet Keçeci"
@@ -548,115 +548,77 @@ 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, add_input_raw: str, iterations: int) -> List[Any]:
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
552
  """
553
553
  Core engine to generate Keçeci Number sequences.
554
- Bu güncellenmiş versiyon, tüm sayı tipleri için esnek girdi işleme ve
555
- kuaterniyonlar için tam vektörel toplama desteği sunar.
554
+
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
+
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.
556
569
  """
557
570
 
558
571
  if not (TYPE_POSITIVE_REAL <= kececi_type <= TYPE_NEUTROSOPHIC_BICOMPLEX):
559
572
  raise ValueError(f"Invalid Keçeci Number Type: {kececi_type}. Must be between {TYPE_POSITIVE_REAL} and {TYPE_NEUTROSOPHIC_BICOMPLEX}.")
560
573
 
561
- current_value = None
562
- add_value_typed = None
563
- ask_unit = None
564
- use_integer_division = False
565
-
574
+ # --- 1. Değişkenlerin Başlatılması ---
566
575
  try:
567
- # DEĞİŞİKLİK 1: Fonksiyonun başındaki genel `float()` dönüştürmesi kaldırıldı.
568
- # Artık her sayı tipi, kendi `elif` bloğu içinde kendi girdisini işleyecek.
569
-
576
+ # Her sayı tipi, kendi `elif` bloğu içinde kendi girdisini işler.
570
577
  if kececi_type in [TYPE_POSITIVE_REAL, TYPE_NEGATIVE_REAL]:
571
- current_value = int(float(start_input_raw))
572
- add_value_typed = int(float(add_input_raw)) # Girdi işleme bu bloğun içine taşındı
573
- ask_unit = 1
574
- use_integer_division = True
575
-
578
+ current_value = int(float(start_input_raw)); add_value_typed = int(float(add_input_raw)); ask_unit = 1; use_integer_division = True
576
579
  elif kececi_type == TYPE_FLOAT:
577
- current_value = float(start_input_raw)
578
- add_value_typed = float(add_input_raw) # Girdi işleme bu bloğun içine taşındı
579
- ask_unit = 1.0
580
-
580
+ current_value = float(start_input_raw); add_value_typed = float(add_input_raw); ask_unit = 1.0
581
581
  elif kececi_type == TYPE_RATIONAL:
582
- current_value = Fraction(start_input_raw)
583
- add_value_typed = Fraction(add_input_raw) # Girdi işleme bu bloğun içine taşındı
584
- ask_unit = Fraction(1)
585
-
582
+ current_value = Fraction(start_input_raw); add_value_typed = Fraction(add_input_raw); ask_unit = Fraction(1)
586
583
  elif kececi_type == TYPE_COMPLEX:
587
- current_value = _parse_complex(start_input_raw)
588
- a_float = float(add_input_raw) # Girdi işleme bu bloğun içine taşındı
589
- add_value_typed = complex(a_float, a_float)
590
- ask_unit = 1 + 1j
591
-
592
- # DEĞİŞİKLİK 2: Kuaterniyon bloğu artık tamamen farklı ve doğru çalışıyor.
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
593
585
  elif kececi_type == TYPE_QUATERNION:
594
- # Hem başlangıç hem de eklenen değer için virgülle ayrılmış formatı işler.
595
- current_value = _parse_quaternion_from_csv(start_input_raw)
596
- add_value_typed = _parse_quaternion_from_csv(add_input_raw)
597
- ask_unit = np.quaternion(1, 1, 1, 1)
598
-
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)
599
587
  elif kececi_type == TYPE_NEUTROSOPHIC:
600
- a, b = _parse_neutrosophic(start_input_raw)
601
- current_value = NeutrosophicNumber(a, b)
602
- a_float = float(add_input_raw) # Girdi işleme bu bloğun içine taşındı
603
- add_value_typed = NeutrosophicNumber(a_float, 0)
604
- ask_unit = NeutrosophicNumber(1, 1)
605
-
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)
606
589
  elif kececi_type == TYPE_NEUTROSOPHIC_COMPLEX:
607
- s_complex = _parse_complex(start_input_raw)
608
- current_value = NeutrosophicComplexNumber(s_complex.real, s_complex.imag, 0.0)
609
- a_float = float(add_input_raw) # Girdi işleme bu bloğun içine taşındı
610
- add_value_typed = NeutrosophicComplexNumber(a_float, 0.0, 0.0)
611
- ask_unit = NeutrosophicComplexNumber(1, 1, 1)
612
-
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)
613
591
  elif kececi_type == TYPE_HYPERREAL:
614
- a, b = _parse_hyperreal(start_input_raw)
615
- sequence_list = [a + b / n for n in range(1, 11)]
616
- current_value = HyperrealNumber(sequence_list)
617
- a_float = float(add_input_raw) # Girdi işleme bu bloğun içine taşındı
618
- add_sequence = [a_float] + [0.0] * 9
619
- add_value_typed = HyperrealNumber(add_sequence)
620
- ask_unit = HyperrealNumber([1.0] * 10)
621
-
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)
622
593
  elif kececi_type == TYPE_BICOMPLEX:
623
- s_complex = _parse_complex(start_input_raw)
624
- a_float = float(add_input_raw) # Girdi işleme bu bloğun içine taşındı
625
- a_complex = complex(a_float)
626
- current_value = BicomplexNumber(s_complex, s_complex / 2)
627
- add_value_typed = BicomplexNumber(a_complex, a_complex / 2)
628
- ask_unit = BicomplexNumber(complex(1, 1), complex(0.5, 0.5))
629
-
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))
630
595
  elif kececi_type == TYPE_NEUTROSOPHIC_BICOMPLEX:
631
- s_complex = _parse_complex(start_input_raw)
632
- current_value = NeutrosophicBicomplexNumber(s_complex.real, s_complex.imag, 0, 0, 0, 0, 0, 0)
633
- a_float = float(add_input_raw) # Girdi işleme bu bloğun içine taşındı
634
- add_value_typed = NeutrosophicBicomplexNumber(a_float, 0, 0, 0, 0, 0, 0, 0)
635
- ask_unit = NeutrosophicBicomplexNumber(*([1.0] * 8))
636
-
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))
637
597
  except (ValueError, TypeError) as e:
638
- # Hata mesajı artık her iki girdiyi de göstererek daha faydalı
639
598
  print(f"ERROR: Failed to initialize type {kececi_type} with start='{start_input_raw}' and increment='{add_input_raw}': {e}")
640
599
  return []
641
600
 
642
- # Fonksiyonun geri kalan üreteç mantığı (döngü kısmı) aynı kalır.
643
- sequence = [current_value]
601
+ # --- 2. Üreteç Döngüsü ---
602
+ clean_trajectory = [current_value]
603
+ full_log = [current_value]
604
+
644
605
  last_divisor_used = None
645
606
  ask_counter = 0
646
607
 
647
608
  for _ in range(iterations):
609
+ # --- Bir Sonraki Adımın Değerini (next_q) Hesapla ---
648
610
  added_value = current_value + add_value_typed
649
- sequence.append(added_value)
650
611
 
651
- result_value = added_value
612
+ next_q = added_value
652
613
  divided_successfully = False
614
+ modified_value = None
653
615
 
654
616
  primary_divisor = 3 if last_divisor_used == 2 or last_divisor_used is None else 2
655
617
  alternative_divisor = 2 if primary_divisor == 3 else 3
656
618
 
657
619
  for divisor in [primary_divisor, alternative_divisor]:
658
620
  if _is_divisible(added_value, divisor, kececi_type):
659
- result_value = added_value // divisor if use_integer_division else added_value / divisor
621
+ next_q = added_value // divisor if use_integer_division else added_value / divisor
660
622
  last_divisor_used = divisor
661
623
  divided_successfully = True
662
624
  break
@@ -664,20 +626,31 @@ def unified_generator(kececi_type: int, start_input_raw: str, add_input_raw: str
664
626
  if not divided_successfully and is_prime(added_value):
665
627
  modified_value = (added_value + ask_unit) if ask_counter == 0 else (added_value - ask_unit)
666
628
  ask_counter = 1 - ask_counter
667
- sequence.append(modified_value)
668
629
 
669
- result_value = modified_value
630
+ next_q = modified_value
670
631
 
671
632
  for divisor in [primary_divisor, alternative_divisor]:
672
633
  if _is_divisible(modified_value, divisor, kececi_type):
673
- result_value = modified_value // divisor if use_integer_division else modified_value / divisor
634
+ next_q = modified_value // divisor if use_integer_division else modified_value / divisor
674
635
  last_divisor_used = divisor
675
636
  break
676
637
 
677
- sequence.append(result_value)
678
- current_value = result_value
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)
679
643
 
680
- return sequence
644
+ clean_trajectory.append(next_q)
645
+
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
681
654
 
682
655
  def print_detailed_report(sequence: List[Any], params: Dict[str, Any]):
683
656
  """Generates and prints a detailed report of the sequence results."""
@@ -729,22 +702,20 @@ def print_detailed_report(sequence: List[Any], params: Dict[str, Any]):
729
702
  # --- HIGH-LEVEL CONTROL FUNCTIONS ---
730
703
  # ==============================================================================
731
704
 
732
- #def get_with_params(kececi_type_choice: int, iterations: int, start_value_raw: str = "0", add_value_base_scalar: float = 9.0) -> List[Any]:
733
- # """Generates Keçeci Numbers with specified parameters."""
734
- # print(f"\n--- Generating Sequence: Type {kececi_type_choice}, Steps {iterations} ---")
735
- # print(f"Start: '{start_value_raw}', Increment: {add_value_base_scalar}")
736
-
737
- # generated_sequence = unified_generator(
738
- # kececi_type_choice, start_value_raw, add_value_base_scalar, iterations
739
- # )
740
-
741
- 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]:
705
+ 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]:
742
706
  """Generates Keçeci Numbers with specified parameters, supporting full vectorial addition."""
743
707
  print(f"\n--- Generating Sequence: Type {kececi_type_choice}, Steps {iterations} ---")
744
708
  print(f"Start: '{start_value_raw}', Increment: '{add_value_raw}'")
709
+ if include_intermediate_steps:
710
+ print("Mode: Detailed (including intermediate steps)")
745
711
 
746
712
  generated_sequence = unified_generator(
747
- kececi_type_choice, start_value_raw, add_value_raw, iterations
713
+ kececi_type_choice,
714
+ start_value_raw,
715
+ add_value_raw,
716
+ iterations,
717
+ # Yeni parametreyi aktar
718
+ include_intermediate_steps=include_intermediate_steps
748
719
  )
749
720
 
750
721
  if generated_sequence:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kececinumbers
3
- Version: 0.5.3
3
+ Version: 0.5.5
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
@@ -0,0 +1,10 @@
1
+ docs/conf.py,sha256=jkpH_TchRJcC_EspKeY1E_rml2ODmIWhWoqvyCPu_ok,1116
2
+ kececinumbers/__init__.py,sha256=VbGT1zN-iC6yCOXzc7s-SlHiXhAVcK8hPiPsITfvoKk,3758
3
+ kececinumbers/_version.py,sha256=qPBH1jRK5qhQB4yEChQ3-1SJ-o_Yn15iW54otBdWF9g,453
4
+ kececinumbers/kececinumbers.py,sha256=Tbp6_yUm7dAQGkppH-yUNMF3zOcuoGwtYpHrXzjN18M,43525
5
+ kececinumbers-0.5.5.dist-info/licenses/LICENSE,sha256=NJZsJEbQuKzxn1mWPWCbRx8jRUqGS22thl8wwuRQJ9c,1071
6
+ tests/test_sample.py,sha256=qMWUBGQtlF1gZHZ_e6Gye1vHtyNnUWH7iXK72a1y6VQ,9728
7
+ kececinumbers-0.5.5.dist-info/METADATA,sha256=I3HQULDUBwpWgtJcyc10xMW0MJrcXnl46L00sGA4_Uc,33010
8
+ kececinumbers-0.5.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
9
+ kececinumbers-0.5.5.dist-info/top_level.txt,sha256=ABQEKRH9iYb4sWnFdx7gIx7Hg899YktRkQpbRlSSqwU,25
10
+ kececinumbers-0.5.5.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- docs/conf.py,sha256=jkpH_TchRJcC_EspKeY1E_rml2ODmIWhWoqvyCPu_ok,1116
2
- kececinumbers/__init__.py,sha256=y_Wlgvwt1591rasdY-u__X0m8MB_mXdYtozcTWUrwvU,3758
3
- kececinumbers/_version.py,sha256=FJEL_1hwFqZz6weWeGRoiwwCrv8TLw_rzkRGsS8JBkM,453
4
- kececinumbers/kececinumbers.py,sha256=TS6vyqbtktEGf38UXVxJxF9xnUgw_B7LKHhodUobIxo,44135
5
- kececinumbers-0.5.3.dist-info/licenses/LICENSE,sha256=NJZsJEbQuKzxn1mWPWCbRx8jRUqGS22thl8wwuRQJ9c,1071
6
- tests/test_sample.py,sha256=qMWUBGQtlF1gZHZ_e6Gye1vHtyNnUWH7iXK72a1y6VQ,9728
7
- kececinumbers-0.5.3.dist-info/METADATA,sha256=AVxaBzyBIFghdP2-fudtGEZw5vvBgjptpWn6U6MWO70,33010
8
- kececinumbers-0.5.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
9
- kececinumbers-0.5.3.dist-info/top_level.txt,sha256=ABQEKRH9iYb4sWnFdx7gIx7Hg899YktRkQpbRlSSqwU,25
10
- kececinumbers-0.5.3.dist-info/RECORD,,