kececinumbers 0.5.4__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.4"
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.4"
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"
@@ -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 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.
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
- current_value = None
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
- sequence = [current_value]
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
- result_value = added_value
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
- 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
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
- if include_intermediate_steps:
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
- 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
689
635
  last_divisor_used = divisor
690
636
  break
691
637
 
692
- # Bir sonraki adımın değerini ata
693
- 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)
694
643
 
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)
644
+ clean_trajectory.append(next_q)
699
645
 
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
-
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."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kececinumbers
3
- Version: 0.5.4
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=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,,