sibi-flux 2026.1.6__py3-none-any.whl → 2026.1.7__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.
sibi_flux/datacube/cli.py CHANGED
@@ -478,6 +478,35 @@ def sync(
478
478
  is_append = False
479
479
  existing_content = ""
480
480
 
481
+ # --- Registry Collection (Always run, even if skipped) ---
482
+ # Structure: {conf_obj: {table_name: {class_name: ..., path: ...}}}
483
+ for item in items:
484
+ t_name = item[0]
485
+ conf_obj = item[1]
486
+ cls_n = item[4]
487
+ # Calculate path relative to project root
488
+ try:
489
+ if "project_root" not in locals():
490
+ project_root = config_path.parent.parent.parent
491
+ rel_path = file_path.relative_to(project_root)
492
+ except Exception:
493
+ rel_path = file_path
494
+
495
+ if conf_obj not in generated_registry:
496
+ generated_registry[conf_obj] = {}
497
+
498
+ # Preserve custom_name from existing registry if present
499
+ existing_meta = registry.get_table_details(t_name)
500
+ custom_name = existing_meta.get("custom_name")
501
+
502
+ entry_data = {
503
+ "class_name": cls_n,
504
+ "path": str(rel_path),
505
+ "custom_name": custom_name,
506
+ }
507
+
508
+ generated_registry[conf_obj][t_name] = entry_data
509
+
481
510
  if file_path.exists() and not force:
482
511
  with open(file_path, "r") as f:
483
512
  existing_content = f.read()
@@ -524,12 +553,8 @@ def sync(
524
553
  )
525
554
 
526
555
  if not classes_code:
527
- if not is_append:
528
- summary_table.add_row(
529
- file_path_str, "0", "[red]Failed (No Classes Generated)[/red]"
530
- )
531
- else:
532
- summary_table.add_row(file_path_str, "0", "[red]Failed to Append[/red]")
556
+ status_msg = "[red]Failed (No Classes Generated)[/red]" if not is_append else "[red]Failed to Append[/red]"
557
+ summary_table.add_row(file_path_str, "0", status_msg)
533
558
  continue
534
559
 
535
560
  if not is_append:
@@ -558,36 +583,6 @@ def sync(
558
583
  )
559
584
  summary_table.add_row(file_path_str, str(len(items)), status_msg)
560
585
 
561
- # --- Registry Collection ---
562
- # Collect metadata for generated datacubes
563
- # Structure: {conf_obj: {table_name: {class_name: ..., path: ...}}}
564
- for item in items:
565
- t_name = item[0]
566
- conf_obj = item[1]
567
- cls_n = item[4]
568
- # Calculate path relative to project root
569
- try:
570
- if "project_root" not in locals():
571
- project_root = config_path.parent.parent.parent
572
- rel_path = file_path.relative_to(project_root)
573
- except Exception:
574
- rel_path = file_path
575
-
576
- if conf_obj not in generated_registry:
577
- generated_registry[conf_obj] = {}
578
-
579
- # Preserve custom_name from existing registry if present
580
- existing_meta = registry.get_table_details(t_name)
581
- custom_name = existing_meta.get("custom_name")
582
-
583
- entry_data = {
584
- "class_name": cls_n,
585
- "path": str(rel_path),
586
- "custom_name": custom_name,
587
- }
588
-
589
- generated_registry[conf_obj][t_name] = entry_data
590
-
591
586
  console.print(summary_table)
592
587
 
593
588
  # --- Write Datacube Registry ---
@@ -616,8 +611,9 @@ def sync(
616
611
  with open(reg_file, "w") as f:
617
612
  yaml.dump(reg_data, f, sort_keys=False)
618
613
 
614
+ total_tables = sum(len(tables) for tables in generated_registry.values())
619
615
  console.print(
620
- f"[green]Updated Datacube Registry at {reg_rel_path} ({len(generated_registry)} entries)[/green]"
616
+ f"[green]Updated Datacube Registry at {reg_rel_path} ({total_tables} tables across {len(generated_registry)} groups)[/green]"
621
617
  )
622
618
  except Exception as e:
623
619
  console.print(f"[red]Failed to write Datacube Registry: {e}[/red]")
@@ -815,12 +811,29 @@ def discover(
815
811
  )
816
812
  continue
817
813
 
814
+ # Resolve Registry Path (Target)
815
+ reg_rel_path = params.get("paths", {}).get("repositories", {}).get(
816
+ "global_datacube_registry_file"
817
+ ) or params.get("global_datacube_registry_file")
818
+
819
+ real_registry_path = str(config_path) # Fallback to config if not defined (legacy behavior)
820
+ if reg_rel_path:
821
+ if Path(reg_rel_path).is_absolute():
822
+ real_registry_path = reg_rel_path
823
+ else:
824
+ try:
825
+ # Anchor to project root
826
+ prj_root = config_path.parent.parent.parent
827
+ real_registry_path = str(prj_root / reg_rel_path)
828
+ except Exception:
829
+ real_registry_path = str(config_path.parent / reg_rel_path)
830
+
818
831
  orchestrator = DiscoveryOrchestrator(
819
832
  field_registry=field_registry,
820
833
  params=context.params,
821
834
  rules_path=str(rules_path),
822
835
  whitelist_path=str(whitelist_path),
823
- registry_path=str(config_path),
836
+ registry_path=real_registry_path,
824
837
  db_connection_str=db_conn_str,
825
838
  db_config=db_config,
826
839
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: sibi-flux
3
- Version: 2026.1.6
3
+ Version: 2026.1.7
4
4
  Summary: Sibi Toolkit: A collection of tools for Data Analysis/Engineering.
5
5
  Author: Luis Valverde
6
6
  Author-email: Luis Valverde <lvalverdeb@gmail.com>
@@ -23,7 +23,7 @@ sibi_flux/dask_cluster/exceptions.py,sha256=apQZaUMgac8k2ZTTsvUd-VlWdo9-Nrh5b6St
23
23
  sibi_flux/dask_cluster/utils.py,sha256=Pr2qaow6GVyvM0hqKSM0ZQpe2Ot5ayfGYQiNhNpYA8Y,1342
24
24
  sibi_flux/datacube/__init__.py,sha256=ODEoa4r5RtzynIp-PdVDaJ-4BcPBj1L9VkLIF7RYSPE,91
25
25
  sibi_flux/datacube/_data_cube.py,sha256=Ofgy3JlR7N0eKijpUzI-ixFlISUd3CFsxnKd6a4fguE,12629
26
- sibi_flux/datacube/cli.py,sha256=0CtmsQCYwFUejILWWTt6s2FZhAKvNE6j1_1yvZfdM5Q,95709
26
+ sibi_flux/datacube/cli.py,sha256=ss-inKDZe1kk3lWmUVx-bNZgd3eiAEEI0a9EiOHEIjI,96506
27
27
  sibi_flux/datacube/config_engine.py,sha256=3cmxycCqMzjYJ1fWn8IWrHTNwSQmRqxnPoOzc1lUtDk,8340
28
28
  sibi_flux/datacube/field_factory.py,sha256=Z3Yp6tGzrZ13rvKSjMFr9jvW7fazeNi4K1fAalxLujM,6376
29
29
  sibi_flux/datacube/field_mapper.py,sha256=V6aFYunl28DI7gSvrF7tcidPNX9QtOYymVxbumzQqPs,9334
@@ -123,7 +123,7 @@ sibi_flux/utils/file_utils.py,sha256=7OHUW65OTe6HlQ6wkDagDd7d0SCQ_-NEGmHlOJguKYw
123
123
  sibi_flux/utils/filepath_generator/__init__.py,sha256=YVFJhIewjwksb9E2t43ojNC-W_AqUDhkKxQVBIBMkY8,91
124
124
  sibi_flux/utils/filepath_generator/_filepath_generator.py,sha256=4HG-Ubvjtv6luL0z-A-8B6_r3o9YqBwATFXhOXiTbKc,6789
125
125
  sibi_flux/utils/retry.py,sha256=45t0MF2IoMayN9xkn5_FtakMq4HwZlGvHVd6qv8x1AY,1227
126
- sibi_flux-2026.1.6.dist-info/WHEEL,sha256=ZyFSCYkV2BrxH6-HRVRg3R9Fo7MALzer9KiPYqNxSbo,79
127
- sibi_flux-2026.1.6.dist-info/entry_points.txt,sha256=6xrq5zuz_8wodJj4s49raopnuC3Owy_leZRkWtcXpTk,49
128
- sibi_flux-2026.1.6.dist-info/METADATA,sha256=al8yanEMaHe5u-iRLzp5wOjWwa3CMaFXtLM97-rq1NQ,9886
129
- sibi_flux-2026.1.6.dist-info/RECORD,,
126
+ sibi_flux-2026.1.7.dist-info/WHEEL,sha256=ZyFSCYkV2BrxH6-HRVRg3R9Fo7MALzer9KiPYqNxSbo,79
127
+ sibi_flux-2026.1.7.dist-info/entry_points.txt,sha256=6xrq5zuz_8wodJj4s49raopnuC3Owy_leZRkWtcXpTk,49
128
+ sibi_flux-2026.1.7.dist-info/METADATA,sha256=ipSzbUZvavinUGwi79uEO6Yiy0ON172K8WwiTRouVmw,9886
129
+ sibi_flux-2026.1.7.dist-info/RECORD,,