Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: version files #8

Merged
merged 20 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ dmypy.json
cython_debug/

# # setuptools_scm
# src/*/_version.py

src/*/_version.py
_version.py

# ruff
.ruff_cache/
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,12 @@ Changelog = "https://github.com/zbilodea/odapt/releases"


[tool.hatch.version]
path = "src/odapt/version.py"
source = "vcs"

[tool.hatch.build.hooks.vcs]
version-file = "src/odapt/_version.py"

[tool.hatch.metadata.hooks.vcs]

[tool.pytest.ini_options]
minversion = "6.0"
Expand Down
2 changes: 1 addition & 1 deletion src/odapt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""
from __future__ import annotations

from odapt._version import __version__
from odapt.operations import hadd # noqa: F401
from odapt.version import VERSION as __version__

__all__ = ["__version__"]
4 changes: 4 additions & 0 deletions src/odapt/_version.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from __future__ import annotations

version: str
version_tuple: tuple[int, int, int] | tuple[int, int, int, str, str]
38 changes: 38 additions & 0 deletions src/odapt/operations/hadd.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,3 +476,41 @@ def main():
skip_bad_files=args.skip_bad_files,
union=args.union,
)


# def merge_ttree(ttree1, ttree2, name): #hadd includes
# # Use tmpdir? Or just do two at a time, tree reduction style...
# if ttree1.name != ttree2.name:
# print("Names must be the same")

# #title must be the same as the file name? maybe is just a tChain thing

# # Get keys
# t1_keys = ttree1.keys(recursive=True)
# t2_keys = ttree2.keys(recursive=True)

# all_keys = np.union1d(t1_keys, t2_keys)

# for t1_key in t1_keys:
# class_name = ttree1[t1_key].class_name()
# if class_name == "ttree":
# branches = ttree1[t1_key].branches

# # for t2_key in t2_keys:
# if :


# merge_inputs()

# # Check if histograms

# write...
# # read key - get get class name
# # inputs(?) = tlist()
# # if isTree:
# # obj = obj.CloneTree?
# # branches = obj.branches
# # for f2 in files[1:]:
# # other_obj = f2.getListOfKeys().readObj()
# # inputs.Add(other_obj)
# #
2 changes: 1 addition & 1 deletion tests/test_hadd.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import odapt as od

ROOT = pytest.importorskip("pyarrow")
ROOT = pytest.importorskip("ROOT")


def write_root_file(hist, path):
Expand Down