f9columnar 0.2.3__tar.gz → 0.2.4__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.
- {f9columnar-0.2.3 → f9columnar-0.2.4}/PKG-INFO +5 -5
- {f9columnar-0.2.3 → f9columnar-0.2.4}/README.md +4 -4
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/hdf5_writer.py +34 -14
- {f9columnar-0.2.3 → f9columnar-0.2.4}/pyproject.toml +1 -1
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/__init__.py +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/analysis/__init__.py +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/analysis/triggers.py +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/arrays.py +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/data/PMGxsecDB_mc16.txt +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/data/PMGxsecDB_mc21.txt +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/data/campaigns.json +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/data/luminosity.json +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/data/periods.json +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/data/truth_classification.json +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/dataset_builder.py +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/hdf5_dataloader.py +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/histograms.py +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/processors.py +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/processors_collection.py +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/root_dataloader.py +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/run.py +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/submit/__init__.py +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/submit/act_driver.py +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/submit/act_handler.py +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/submit/act_merger.py +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/submit/act_run.py +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/submit/act_run.sh +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/utils/__init__.py +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/utils/ak_helpers.py +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/utils/config_utils.py +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/utils/helpers.py +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/utils/loggers.py +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/utils/regex_helpers.py +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/utils/rucio_db.py +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/utils/rucio_utils.py +0 -0
- {f9columnar-0.2.3 → f9columnar-0.2.4}/f9columnar/utils/xsec_db.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: f9columnar
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: Columnar analysis utils.
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Jan Gavranovic
|
|
@@ -42,13 +42,13 @@ Description-Content-Type: text/markdown
|
|
|
42
42
|
|
|
43
43
|
# F9 Columnar
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
A lightweight Python package for batch processing of ROOT and HDF5 event data.
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
### Project description
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
This package is designed for efficient handling of large datasets. Built on PyTorch, Awkward Array, and Uproot, it utilizes PyTorch's DataLoader with an IterableDataset to enable parallel processing. It implements a columnar event loop, returning batches of events in a format compatible with standard PyTorch training loops over multiple epochs.
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
Optimized for machine learning applications, the package provides `RootDataLoader` and `Hdf5DataLoader` classes for data loading from ROOT and HDF5 files. Additionally, it supports parallel data processing through a modular pipeline of processor classes, allowing users to chain operations for complex computations and histogramming.
|
|
52
52
|
|
|
53
53
|
## Setup
|
|
54
54
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# F9 Columnar
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A lightweight Python package for batch processing of ROOT and HDF5 event data.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
### Project description
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
This package is designed for efficient handling of large datasets. Built on PyTorch, Awkward Array, and Uproot, it utilizes PyTorch's DataLoader with an IterableDataset to enable parallel processing. It implements a columnar event loop, returning batches of events in a format compatible with standard PyTorch training loops over multiple epochs.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Optimized for machine learning applications, the package provides `RootDataLoader` and `Hdf5DataLoader` classes for data loading from ROOT and HDF5 files. Additionally, it supports parallel data processing through a modular pipeline of processor classes, allowing users to chain operations for complex computations and histogramming.
|
|
10
10
|
|
|
11
11
|
## Setup
|
|
12
12
|
|
|
@@ -443,9 +443,17 @@ class NtupleHdf5Writer(ArraysHdf5Writer):
|
|
|
443
443
|
write_mc: bool = True,
|
|
444
444
|
write_data: bool = True,
|
|
445
445
|
name: str = "datasetHDF5Writer",
|
|
446
|
+
dataset_names: list[str] | None = None,
|
|
446
447
|
**hdf5_kwargs: Any,
|
|
447
448
|
) -> None:
|
|
448
|
-
|
|
449
|
+
|
|
450
|
+
if dataset_names is None:
|
|
451
|
+
dataset_names = ["mc", "data"]
|
|
452
|
+
|
|
453
|
+
if len(dataset_names) != 2:
|
|
454
|
+
raise ValueError("Dataset names must be a list of two strings!")
|
|
455
|
+
|
|
456
|
+
super().__init__(file_path, dataset_names=dataset_names, name=name)
|
|
449
457
|
self.save_node = save_node
|
|
450
458
|
self.chunk_shape = chunk_shape
|
|
451
459
|
|
|
@@ -463,25 +471,26 @@ class NtupleHdf5Writer(ArraysHdf5Writer):
|
|
|
463
471
|
self.data_column_names = data_column_names
|
|
464
472
|
|
|
465
473
|
metadata = {}
|
|
474
|
+
mc_group, data_group = self.dataset_names[0], self.dataset_names[1]
|
|
466
475
|
|
|
467
476
|
if write_mc:
|
|
468
477
|
self.create_datasets(
|
|
469
|
-
dataset_names=[
|
|
478
|
+
dataset_names=[mc_group],
|
|
470
479
|
shape=(self.chunk_shape, len(self.mc_column_names)),
|
|
471
480
|
maxshape=(None, len(self.mc_column_names)),
|
|
472
481
|
**hdf5_kwargs,
|
|
473
482
|
)
|
|
474
|
-
metadata["
|
|
483
|
+
metadata[f"{mc_group}_columns"] = self.mc_column_names
|
|
475
484
|
|
|
476
485
|
if write_data:
|
|
477
486
|
self.create_datasets(
|
|
478
487
|
mode="a" if self.write_mc else "w",
|
|
479
|
-
dataset_names=[
|
|
488
|
+
dataset_names=[data_group],
|
|
480
489
|
shape=(self.chunk_shape, len(self.data_column_names)),
|
|
481
490
|
maxshape=(None, len(self.data_column_names)),
|
|
482
491
|
**hdf5_kwargs,
|
|
483
492
|
)
|
|
484
|
-
metadata["
|
|
493
|
+
metadata[f"{data_group}_columns"] = self.data_column_names
|
|
485
494
|
|
|
486
495
|
self.add_metadata(metadata)
|
|
487
496
|
|
|
@@ -498,12 +507,12 @@ class NtupleHdf5Writer(ArraysHdf5Writer):
|
|
|
498
507
|
|
|
499
508
|
if self.is_data and self.write_data:
|
|
500
509
|
self._current_idx, self._current_shape = self._current_mc_idx, self._current_mc_shape
|
|
501
|
-
self.write_arrays(arrays,
|
|
510
|
+
self.write_arrays(arrays, self.dataset_names[1], self.data_column_names, self.chunk_shape)
|
|
502
511
|
self._current_mc_idx, self._current_mc_shape = self._current_idx, self._current_shape
|
|
503
512
|
|
|
504
513
|
if not self.is_data and self.write_mc:
|
|
505
514
|
self._current_idx, self._current_shape = self._current_data_idx, self._current_data_shape
|
|
506
|
-
self.write_arrays(arrays,
|
|
515
|
+
self.write_arrays(arrays, self.dataset_names[0], self.mc_column_names, self.chunk_shape)
|
|
507
516
|
self._current_data_idx, self._current_data_shape = self._current_idx, self._current_shape
|
|
508
517
|
|
|
509
518
|
return {"processors": processors}
|
|
@@ -522,9 +531,19 @@ class NtupleHdf5PileWriter(ArraysHdf5PileWriter):
|
|
|
522
531
|
write_mc: bool = True,
|
|
523
532
|
write_data: bool = True,
|
|
524
533
|
name: str = "datasetHDF5Writer",
|
|
534
|
+
dataset_names_map: dict[str, str] | None = None,
|
|
525
535
|
**hdf5_kwargs: Any,
|
|
526
536
|
) -> None:
|
|
527
|
-
|
|
537
|
+
|
|
538
|
+
if dataset_names_map is None:
|
|
539
|
+
dataset_names = ["mc", "data"]
|
|
540
|
+
else:
|
|
541
|
+
dataset_names = [dataset_names_map["mc"], dataset_names_map["data"]]
|
|
542
|
+
|
|
543
|
+
if len(dataset_names) != 2:
|
|
544
|
+
raise ValueError("Dataset names must be a list of two strings!")
|
|
545
|
+
|
|
546
|
+
super().__init__(file_path, n_piles, pile_assignment, dataset_names=dataset_names, name=name)
|
|
528
547
|
self.save_node = save_node
|
|
529
548
|
self.chunk_shape = chunk_shape
|
|
530
549
|
|
|
@@ -542,25 +561,26 @@ class NtupleHdf5PileWriter(ArraysHdf5PileWriter):
|
|
|
542
561
|
self.data_column_names = data_column_names
|
|
543
562
|
|
|
544
563
|
metadata: dict[str, Any] = {}
|
|
564
|
+
mc_group, data_group = self.dataset_names[0], self.dataset_names[1]
|
|
545
565
|
|
|
546
566
|
if write_mc:
|
|
547
567
|
self.create_datasets(
|
|
548
|
-
dataset_names=self.pile_datasets_dct[
|
|
568
|
+
dataset_names=self.pile_datasets_dct[mc_group],
|
|
549
569
|
shape=(self.chunk_shape, len(self.mc_column_names)),
|
|
550
570
|
maxshape=(None, len(self.mc_column_names)),
|
|
551
571
|
**hdf5_kwargs,
|
|
552
572
|
)
|
|
553
|
-
metadata["
|
|
573
|
+
metadata[f"{mc_group}_columns"] = self.mc_column_names
|
|
554
574
|
|
|
555
575
|
if write_data:
|
|
556
576
|
self.create_datasets(
|
|
557
577
|
mode="a" if self.write_mc else "w",
|
|
558
|
-
dataset_names=self.pile_datasets_dct[
|
|
578
|
+
dataset_names=self.pile_datasets_dct[data_group],
|
|
559
579
|
shape=(self.chunk_shape, len(self.data_column_names)),
|
|
560
580
|
maxshape=(None, len(self.data_column_names)),
|
|
561
581
|
**hdf5_kwargs,
|
|
562
582
|
)
|
|
563
|
-
metadata["
|
|
583
|
+
metadata[f"{data_group}_columns"] = self.data_column_names
|
|
564
584
|
|
|
565
585
|
metadata["piles"] = self.pile_datasets_dct
|
|
566
586
|
|
|
@@ -575,10 +595,10 @@ class NtupleHdf5PileWriter(ArraysHdf5PileWriter):
|
|
|
575
595
|
raise AttributeError("Arrays attribute not found in the processor!")
|
|
576
596
|
|
|
577
597
|
if self.is_data and self.write_data:
|
|
578
|
-
self.write_arrays(arrays,
|
|
598
|
+
self.write_arrays(arrays, self.dataset_names[1], self.data_column_names, self.chunk_shape)
|
|
579
599
|
|
|
580
600
|
if not self.is_data and self.write_mc:
|
|
581
|
-
self.write_arrays(arrays,
|
|
601
|
+
self.write_arrays(arrays, self.dataset_names[0], self.mc_column_names, self.chunk_shape)
|
|
582
602
|
|
|
583
603
|
return {"processors": processors}
|
|
584
604
|
|
|
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
|
|
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
|
|
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
|