uproot-custom 1.0.0a0__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.
Files changed (35) hide show
  1. uproot_custom-1.0.0a0/.clang-format +127 -0
  2. uproot_custom-1.0.0a0/.github/workflows/python-publish.yml +93 -0
  3. uproot_custom-1.0.0a0/.github/workflows/run-pytest.yml +38 -0
  4. uproot_custom-1.0.0a0/.gitignore +209 -0
  5. uproot_custom-1.0.0a0/LICENSE +28 -0
  6. uproot_custom-1.0.0a0/PKG-INFO +338 -0
  7. uproot_custom-1.0.0a0/README.md +303 -0
  8. uproot_custom-1.0.0a0/cpp/CMakeLists.txt +52 -0
  9. uproot_custom-1.0.0a0/cpp/include/uproot-custom/uproot-custom.hh +219 -0
  10. uproot_custom-1.0.0a0/cpp/share/cmake/uproot-customConfig.cmake +19 -0
  11. uproot_custom-1.0.0a0/cpp/src/uproot-custom.cc +407 -0
  12. uproot_custom-1.0.0a0/example/README.md +46 -0
  13. uproot_custom-1.0.0a0/example/cpp/CMakeLists.txt +31 -0
  14. uproot_custom-1.0.0a0/example/cpp/my_reader.cc +48 -0
  15. uproot_custom-1.0.0a0/example/gen-demo-data/CMakeLists.txt +29 -0
  16. uproot_custom-1.0.0a0/example/gen-demo-data/include/LinkDef.h +9 -0
  17. uproot_custom-1.0.0a0/example/gen-demo-data/include/TOverrideStreamer.hh +16 -0
  18. uproot_custom-1.0.0a0/example/gen-demo-data/src/TOverrideStreamer.cc +34 -0
  19. uproot_custom-1.0.0a0/example/gen-demo-data/src/main.cc +22 -0
  20. uproot_custom-1.0.0a0/example/my_reader/OverrideStreamerReader.py +45 -0
  21. uproot_custom-1.0.0a0/example/my_reader/__init__.py +9 -0
  22. uproot_custom-1.0.0a0/example/pyproject.toml +21 -0
  23. uproot_custom-1.0.0a0/example/read-data.py +11 -0
  24. uproot_custom-1.0.0a0/pyproject.toml +58 -0
  25. uproot_custom-1.0.0a0/tests/test-data.root +0 -0
  26. uproot_custom-1.0.0a0/tests/test_AsCustom.py +19 -0
  27. uproot_custom-1.0.0a0/tests/test_downstream_build.py +41 -0
  28. uproot_custom-1.0.0a0/tests/test_downstream_build_pyproject.toml +20 -0
  29. uproot_custom-1.0.0a0/uproot_custom/AsBinary.py +62 -0
  30. uproot_custom-1.0.0a0/uproot_custom/AsCustom.py +174 -0
  31. uproot_custom-1.0.0a0/uproot_custom/__init__.py +53 -0
  32. uproot_custom-1.0.0a0/uproot_custom/_version.py +21 -0
  33. uproot_custom-1.0.0a0/uproot_custom/cpp.pyi +105 -0
  34. uproot_custom-1.0.0a0/uproot_custom/readers.py +846 -0
  35. uproot_custom-1.0.0a0/uproot_custom/share/cmake/__init__.py +0 -0
@@ -0,0 +1,127 @@
1
+ # This .clang_format file is derectly copied from Gaudi project.
2
+ ---
3
+ Language: Cpp
4
+ BasedOnStyle: Google
5
+ AccessModifierOffset: -2
6
+ AlignAfterOpenBracket: Align
7
+ AlignConsecutiveAssignments: true
8
+ AlignConsecutiveDeclarations: false
9
+ AlignEscapedNewlines: Right
10
+ AlignOperands: true
11
+ AlignTrailingComments: true
12
+ AllowAllParametersOfDeclarationOnNextLine: true
13
+ AllowShortBlocksOnASingleLine: Always
14
+ AllowShortCaseLabelsOnASingleLine: true
15
+ AllowShortFunctionsOnASingleLine: All
16
+ AllowShortIfStatementsOnASingleLine: AllIfsAndElse
17
+ AllowShortLoopsOnASingleLine: true
18
+ AlwaysBreakAfterDefinitionReturnType: None
19
+ AlwaysBreakAfterReturnType: None
20
+ AlwaysBreakBeforeMultilineStrings: false
21
+ AlwaysBreakTemplateDeclarations: true
22
+ BinPackArguments: true
23
+ BinPackParameters: true
24
+ BraceWrapping:
25
+ AfterClass: false
26
+ AfterControlStatement: true
27
+ AfterEnum: false
28
+ AfterFunction: false
29
+ AfterNamespace: false
30
+ AfterObjCDeclaration: false
31
+ AfterStruct: false
32
+ AfterUnion: false
33
+ AfterExternBlock: false
34
+ BeforeCatch: false
35
+ BeforeElse: true
36
+ IndentBraces: false
37
+ SplitEmptyFunction: false
38
+ SplitEmptyRecord: false
39
+ SplitEmptyNamespace: false
40
+ BreakBeforeBinaryOperators: None
41
+ BreakBeforeBraces: Custom
42
+ BreakBeforeInheritanceComma: false
43
+ BreakBeforeTernaryOperators: true
44
+ BreakConstructorInitializersBeforeComma: true
45
+ BreakConstructorInitializers: BeforeComma
46
+ BreakAfterJavaFieldAnnotations: false
47
+ BreakStringLiterals: true
48
+ ColumnLimit: 95
49
+ CommentPragmas: '^ IWYU pragma:'
50
+ CompactNamespaces: false
51
+ ConstructorInitializerAllOnOneLineOrOnePerLine: true
52
+ ConstructorInitializerIndentWidth: 4
53
+ ContinuationIndentWidth: 4
54
+ Cpp11BracedListStyle: true
55
+ DerivePointerAlignment: false
56
+ DisableFormat: false
57
+ ExperimentalAutoDetectBinPacking: false
58
+ FixNamespaceComments: true
59
+ ForEachMacros:
60
+ - foreach
61
+ - Q_FOREACH
62
+ - BOOST_FOREACH
63
+ IncludeBlocks: Preserve
64
+ IncludeCategories:
65
+ - Regex: '^"(llvm|llvm-c|clang|clang-c)/'
66
+ Priority: 2
67
+ - Regex: '^(<|"(gtest|gmock|isl|json)/)'
68
+ Priority: 3
69
+ - Regex: '.*'
70
+ Priority: 1
71
+ IncludeIsMainRegex: '(Test)?$'
72
+ IndentCaseLabels: false
73
+ IndentPPDirectives: AfterHash
74
+ IndentWidth: 4
75
+ IndentWrappedFunctionNames: false
76
+ JavaScriptQuotes: Leave
77
+ JavaScriptWrapImports: true
78
+ KeepEmptyLinesAtTheStartOfBlocks: true
79
+ MacroBlockBegin: ''
80
+ MacroBlockEnd: ''
81
+ MaxEmptyLinesToKeep: 1
82
+ NamespaceIndentation: All
83
+ ObjCBinPackProtocolList: Auto
84
+ ObjCBlockIndentWidth: 2
85
+ ObjCSpaceAfterProperty: false
86
+ ObjCSpaceBeforeProtocolList: true
87
+ PenaltyBreakAssignment: 2
88
+ PenaltyBreakBeforeFirstCallParameter: 19
89
+ PenaltyBreakComment: 60
90
+ PenaltyBreakFirstLessLess: 30
91
+ PenaltyBreakString: 1000
92
+ PenaltyBreakTemplateDeclaration: 10
93
+ PenaltyExcessCharacter: 1000000
94
+ PenaltyReturnTypeOnItsOwnLine: 60
95
+ PointerAlignment: Left
96
+ ReflowComments: true
97
+ SortIncludes: CaseSensitive
98
+ SortUsingDeclarations: true
99
+ SpaceAfterCStyleCast: false
100
+ SpaceAfterTemplateKeyword: true
101
+ SpaceBeforeAssignmentOperators: true
102
+ SpaceBeforeCpp11BracedList: false
103
+ SpaceBeforeCtorInitializerColon: true
104
+ SpaceBeforeInheritanceColon: true
105
+ SpaceBeforeParens: ControlStatements
106
+ SpaceBeforeRangeBasedForLoopColon: true
107
+ SpaceInEmptyParentheses: false
108
+ SpacesBeforeTrailingComments: 1
109
+ SpacesInAngles: false
110
+ SpacesInContainerLiterals: true
111
+ SpacesInCStyleCastParentheses: false
112
+ SpacesInParentheses: true
113
+ Standard: c++11
114
+ TabWidth: 8
115
+ UseTab: Never
116
+ ---
117
+ Language: Json
118
+ IndentWidth: 4
119
+ ColumnLimit: 95
120
+ ---
121
+ Language: JavaScript
122
+ ColumnLimit: 95
123
+ ---
124
+ Language: ObjC
125
+ # Don't format Objective-C, Objective-C++ files.
126
+ DisableFormat: true
127
+ ...
@@ -0,0 +1,93 @@
1
+ # This workflow will upload a Python Package to PyPI when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3
+
4
+ # This workflow uses actions that are not certified by GitHub.
5
+ # They are provided by a third-party and are governed by
6
+ # separate terms of service, privacy policy, and support
7
+ # documentation.
8
+
9
+ name: Upload Python Package
10
+
11
+ on:
12
+ release:
13
+ types: [published]
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ jobs:
19
+ do-tests:
20
+ uses: ./.github/workflows/run-pytest.yml
21
+
22
+ build-wheels:
23
+ runs-on: ubuntu-latest
24
+ strategy:
25
+ matrix:
26
+ python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
27
+
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+
31
+ - uses: actions/setup-python@v5
32
+ with:
33
+ python-version: ${{ matrix.python-version }}
34
+
35
+ - name: Build wheels for ${{ matrix.python-version }}
36
+ run: |
37
+ python -m pip install --upgrade pip
38
+ python -m pip install repairwheel build
39
+ python -m build -w -o .cache/dist
40
+ repairwheel .cache/dist/*.whl -o dist/
41
+
42
+ - name: Upload distributions
43
+ uses: actions/upload-artifact@v4
44
+ with:
45
+ name: ci-wheels-${{ matrix.python-version }}
46
+ path: ./dist/*.whl
47
+
48
+ build-sdist:
49
+ runs-on: ubuntu-latest
50
+ steps:
51
+ - uses: actions/checkout@v4
52
+
53
+ - name: Build source distribution
54
+ run: pipx run build --sdist
55
+
56
+ - name: Upload source distribution
57
+ uses: actions/upload-artifact@v4
58
+ with:
59
+ name: ci-sdist
60
+ path: ./dist/*.tar.gz
61
+
62
+ pypi-publish:
63
+ runs-on: ubuntu-latest
64
+ needs:
65
+ - build-wheels
66
+ - build-sdist
67
+ permissions:
68
+ # IMPORTANT: this permission is mandatory for trusted publishing
69
+ id-token: write
70
+
71
+ # Dedicated environments with protections for publishing are strongly recommended.
72
+ # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
73
+ environment:
74
+ name: pypi
75
+ # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
76
+ url: https://pypi.org/project/uproot-custom
77
+ #
78
+ # ALTERNATIVE: if your GitHub Release name is the PyPI project version string
79
+ # ALTERNATIVE: exactly, uncomment the following line instead:
80
+ # url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
81
+
82
+ steps:
83
+ - name: Retrieve release distributions
84
+ uses: actions/download-artifact@v4
85
+ with:
86
+ path: dist/
87
+ pattern: ci-*
88
+ merge-multiple: true
89
+
90
+ - name: Publish release distributions to PyPI
91
+ uses: pypa/gh-action-pypi-publish@release/v1
92
+ with:
93
+ packages-dir: dist/
@@ -0,0 +1,38 @@
1
+ name: Run pytest
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+ release:
9
+ types: [published]
10
+ workflow_call:
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ jobs:
16
+ test:
17
+ runs-on: ${{ matrix.os }}
18
+ strategy:
19
+ matrix:
20
+ python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
21
+ os: ["ubuntu-latest", "macos-latest", "windows-latest"]
22
+
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+
26
+ - uses: actions/setup-python@v5
27
+ with:
28
+ python-version: ${{ matrix.python-version }}
29
+
30
+ - name: Install dependencies
31
+ run: |
32
+ python -m pip install --upgrade pip
33
+ pip install .[dev]
34
+
35
+ - name: Run pytest
36
+ run: |
37
+ pytest --version
38
+ pytest tests/
@@ -0,0 +1,209 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+ #poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ #pdm.lock
116
+ #pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ #pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # SageMath parsed files
135
+ *.sage.py
136
+
137
+ # Environments
138
+ .env
139
+ .envrc
140
+ .venv
141
+ env/
142
+ venv/
143
+ ENV/
144
+ env.bak/
145
+ venv.bak/
146
+
147
+ # Spyder project settings
148
+ .spyderproject
149
+ .spyproject
150
+
151
+ # Rope project settings
152
+ .ropeproject
153
+
154
+ # mkdocs documentation
155
+ /site
156
+
157
+ # mypy
158
+ .mypy_cache/
159
+ .dmypy.json
160
+ dmypy.json
161
+
162
+ # Pyre type checker
163
+ .pyre/
164
+
165
+ # pytype static type analyzer
166
+ .pytype/
167
+
168
+ # Cython debug symbols
169
+ cython_debug/
170
+
171
+ # PyCharm
172
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
175
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
176
+ .idea/
177
+
178
+ # Abstra
179
+ # Abstra is an AI-powered process automation framework.
180
+ # Ignore directories containing user credentials, local state, and settings.
181
+ # Learn more at https://abstra.io/docs
182
+ .abstra/
183
+
184
+ # Visual Studio Code
185
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
188
+ # you could uncomment the following to ignore the entire vscode folder
189
+ .vscode/
190
+
191
+ # Ruff stuff:
192
+ .ruff_cache/
193
+
194
+ # PyPI configuration file
195
+ .pypirc
196
+
197
+ # Cursor
198
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
199
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
200
+ # refer to https://docs.cursor.com/context/ignore-files
201
+ .cursorignore
202
+ .cursorindexingignore
203
+
204
+ # Marimo
205
+ marimo/_static/
206
+ marimo/_lsp/
207
+ __marimo__/
208
+
209
+ _version.py
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2025, Mingrun Li
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.