kececinumbers 0.5.0__tar.gz → 0.5.2__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.0/kececinumbers.egg-info → kececinumbers-0.5.2}/PKG-INFO +1 -1
- {kececinumbers-0.5.0 → kececinumbers-0.5.2}/kececinumbers/__init__.py +5 -1
- {kececinumbers-0.5.0 → kececinumbers-0.5.2}/kececinumbers/_version.py +1 -1
- {kececinumbers-0.5.0 → kececinumbers-0.5.2}/kececinumbers/kececinumbers.py +87 -7
- {kececinumbers-0.5.0 → kececinumbers-0.5.2/kececinumbers.egg-info}/PKG-INFO +1 -1
- {kececinumbers-0.5.0 → kececinumbers-0.5.2}/pyproject.toml +1 -1
- {kececinumbers-0.5.0 → kececinumbers-0.5.2}/LICENSE +0 -0
- {kececinumbers-0.5.0 → kececinumbers-0.5.2}/MANIFEST.in +0 -0
- {kececinumbers-0.5.0 → kececinumbers-0.5.2}/README.md +0 -0
- {kececinumbers-0.5.0 → kececinumbers-0.5.2}/docs/conf.py +0 -0
- {kececinumbers-0.5.0 → kececinumbers-0.5.2}/kececinumbers.egg-info/SOURCES.txt +0 -0
- {kececinumbers-0.5.0 → kececinumbers-0.5.2}/kececinumbers.egg-info/dependency_links.txt +0 -0
- {kececinumbers-0.5.0 → kececinumbers-0.5.2}/kececinumbers.egg-info/requires.txt +0 -0
- {kececinumbers-0.5.0 → kececinumbers-0.5.2}/kececinumbers.egg-info/top_level.txt +0 -0
- {kececinumbers-0.5.0 → kececinumbers-0.5.2}/setup.cfg +0 -0
- {kececinumbers-0.5.0 → kececinumbers-0.5.2}/setup.py +0 -0
- {kececinumbers-0.5.0 → kececinumbers-0.5.2}/tests/test_sample.py +0 -0
@@ -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.
|
25
|
+
__version__ = "0.5.2"
|
26
26
|
__author__ = "Mehmet Keçeci"
|
27
27
|
__email__ = "mkececi@yaani.com"
|
28
28
|
|
@@ -40,6 +40,8 @@ __all__ = [
|
|
40
40
|
'get_interactive',
|
41
41
|
'get_random_type',
|
42
42
|
'_get_integer_representation',
|
43
|
+
'_parse_quaternion_from_csv',
|
44
|
+
'generate_kececi_vectorial',
|
43
45
|
|
44
46
|
# --- Core Generation and Analysis ---
|
45
47
|
'unified_generator',
|
@@ -85,6 +87,8 @@ try:
|
|
85
87
|
get_interactive,
|
86
88
|
get_random_type,
|
87
89
|
_get_integer_representation,
|
90
|
+
_parse_quaternion_from_csv,
|
91
|
+
generate_kececi_vectorial,
|
88
92
|
unified_generator,
|
89
93
|
is_prime,
|
90
94
|
find_period,
|
@@ -482,6 +482,68 @@ def get_random_type(num_iterations: int, fixed_start_raw: str = "0", fixed_add_b
|
|
482
482
|
add_value_base_scalar=fixed_add_base_scalar
|
483
483
|
)
|
484
484
|
|
485
|
+
def generate_kececi_vectorial(q0_str, c_str, u_str, iterations):
|
486
|
+
"""
|
487
|
+
Keçeci Haritası'nı tam vektörel toplama ile üreten geliştirilmiş fonksiyon.
|
488
|
+
Bu, kütüphanenin ana üretim fonksiyonu olabilir.
|
489
|
+
Tüm girdileri metin (string) olarak alarak esneklik sağlar.
|
490
|
+
"""
|
491
|
+
try:
|
492
|
+
# Girdi metinlerini kuaterniyon nesnelerine dönüştür
|
493
|
+
w, x, y, z = map(float, q0_str.split(','))
|
494
|
+
q0 = np.quaternion(w, x, y, z)
|
495
|
+
|
496
|
+
cw, cx, cy, cz = map(float, c_str.split(','))
|
497
|
+
c = np.quaternion(cw, cx, cy, cz)
|
498
|
+
|
499
|
+
uw, ux, uy, uz = map(float, u_str.split(','))
|
500
|
+
u = np.quaternion(uw, ux, uy, uz)
|
501
|
+
|
502
|
+
except (ValueError, IndexError):
|
503
|
+
raise ValueError("Girdi metinleri 'w,x,y,z' formatında olmalıdır.")
|
504
|
+
|
505
|
+
trajectory = [q0]
|
506
|
+
prime_events = []
|
507
|
+
current_q = q0
|
508
|
+
|
509
|
+
for i in range(iterations):
|
510
|
+
y = current_q + c
|
511
|
+
processing_val = y
|
512
|
+
|
513
|
+
while True:
|
514
|
+
scalar_int = int(processing_val.w)
|
515
|
+
|
516
|
+
if scalar_int % 2 == 0:
|
517
|
+
next_q = processing_val / 2.0
|
518
|
+
break
|
519
|
+
elif scalar_int % 3 == 0:
|
520
|
+
next_q = processing_val / 3.0
|
521
|
+
break
|
522
|
+
elif is_prime(scalar_int):
|
523
|
+
if processing_val == y:
|
524
|
+
prime_events.append((i, scalar_int))
|
525
|
+
processing_val += u
|
526
|
+
continue
|
527
|
+
else:
|
528
|
+
next_q = processing_val
|
529
|
+
break
|
530
|
+
|
531
|
+
trajectory.append(next_q)
|
532
|
+
current_q = next_q
|
533
|
+
|
534
|
+
return trajectory, prime_events
|
535
|
+
|
536
|
+
def _parse_quaternion_from_csv(s: str) -> np.quaternion:
|
537
|
+
"""Parses a comma-separated string 'w,x,y,z' into a quaternion."""
|
538
|
+
try:
|
539
|
+
parts = [float(p.strip()) for p in s.split(',')]
|
540
|
+
if len(parts) != 4:
|
541
|
+
raise ValueError("Girdi 4 bileşen içermelidir.")
|
542
|
+
# *parts -> (parts[0], parts[1], parts[2], parts[3])
|
543
|
+
return np.quaternion(*parts)
|
544
|
+
except (ValueError, IndexError) as e:
|
545
|
+
raise ValueError(f"Geçersiz virgülle ayrılmış kuaterniyon formatı: '{s}'.") from e
|
546
|
+
|
485
547
|
# ==============================================================================
|
486
548
|
# --- CORE GENERATOR ---
|
487
549
|
# ==============================================================================
|
@@ -545,9 +607,13 @@ def unified_generator(kececi_type: int, start_input_raw: str, add_input_base_sca
|
|
545
607
|
current_value = NeutrosophicBicomplexNumber(s_complex.real, s_complex.imag, 0, 0, 0, 0, 0, 0)
|
546
608
|
add_value_typed = NeutrosophicBicomplexNumber(a_float, 0, 0, 0, 0, 0, 0, 0)
|
547
609
|
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)
|
548
614
|
elif kececi_type == TYPE_QUATERNION:
|
549
|
-
current_value =
|
550
|
-
add_value_typed =
|
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
|
551
617
|
ask_unit = np.quaternion(1, 1, 1, 1)
|
552
618
|
|
553
619
|
except (ValueError, TypeError) as e:
|
@@ -643,13 +709,22 @@ def print_detailed_report(sequence: List[Any], params: Dict[str, Any]):
|
|
643
709
|
# --- HIGH-LEVEL CONTROL FUNCTIONS ---
|
644
710
|
# ==============================================================================
|
645
711
|
|
646
|
-
def get_with_params(kececi_type_choice: int, iterations: int, start_value_raw: str = "0", add_value_base_scalar: float = 9.0) -> List[Any]:
|
647
|
-
"""Generates Keçeci Numbers with specified parameters."""
|
712
|
+
#def get_with_params(kececi_type_choice: int, iterations: int, start_value_raw: str = "0", add_value_base_scalar: float = 9.0) -> List[Any]:
|
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]:
|
722
|
+
"""Generates Keçeci Numbers with specified parameters, supporting full vectorial addition."""
|
648
723
|
print(f"\n--- Generating Sequence: Type {kececi_type_choice}, Steps {iterations} ---")
|
649
|
-
print(f"Start: '{start_value_raw}', Increment: {
|
724
|
+
print(f"Start: '{start_value_raw}', Increment: '{add_value_raw}'")
|
650
725
|
|
651
726
|
generated_sequence = unified_generator(
|
652
|
-
kececi_type_choice, start_value_raw,
|
727
|
+
kececi_type_choice, start_value_raw, add_value_raw, iterations
|
653
728
|
)
|
654
729
|
|
655
730
|
if generated_sequence:
|
@@ -697,7 +772,12 @@ def get_interactive() -> Tuple[List[Any], Dict[str, Any]]:
|
|
697
772
|
|
698
773
|
start_prompt = prompts.get(type_choice, "Enter starting value: ")
|
699
774
|
start_input_val_raw = input(start_prompt)
|
700
|
-
add_base_scalar_val = float(input("Enter base scalar increment (e.g., 9.0): "))
|
775
|
+
#add_base_scalar_val = float(input("Enter base scalar increment (e.g., 9.0): "))
|
776
|
+
if type_choice == TYPE_QUATERNION:
|
777
|
+
add_input_val_raw = input("Enter quaternion increment (e.g., '1.3,-2.1,0.5,3.4'): ")
|
778
|
+
else:
|
779
|
+
# Diğer tipler için eski mantık devam edebilir veya hepsi için string istenir
|
780
|
+
add_input_val_raw = input("Enter increment value: ")
|
701
781
|
num_kececi_steps = int(input("Enter number of Keçeci steps (e.g., 15): "))
|
702
782
|
|
703
783
|
sequence = get_with_params(type_choice, num_kececi_steps, start_input_val_raw, add_base_scalar_val)
|
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
|