From 50c396cf38fd7caee1ea329de2ffb627be5f4664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Bilodeau?= Date: Fri, 20 Oct 2023 09:21:57 +0200 Subject: [PATCH 01/20] fixing version file name --- pyproject.toml | 2 +- src/odapt/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a6ddfa6..39b8fd3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,7 +56,7 @@ Changelog = "https://github.com/zbilodea/odapt/releases" [tool.hatch.version] -path = "src/odapt/version.py" +path = "src/odapt/_version.py" [tool.pytest.ini_options] diff --git a/src/odapt/__init__.py b/src/odapt/__init__.py index 6d5f52b..8b7bd72 100644 --- a/src/odapt/__init__.py +++ b/src/odapt/__init__.py @@ -5,7 +5,7 @@ """ from __future__ import annotations +from odapt._version import VERSION as __version__ from odapt.operations import hadd # noqa: F401 -from odapt.version import VERSION as __version__ __all__ = ["__version__"] From aa8d8a88ac2ba60df0504ec999ec76612a1ef7f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Bilodeau?= Date: Fri, 20 Oct 2023 09:29:54 +0200 Subject: [PATCH 02/20] fixing version file name --- src/odapt/_version.py | 17 +++++++++++++++++ src/odapt/_version.pyi | 5 +++++ 2 files changed, 22 insertions(+) create mode 100644 src/odapt/_version.py create mode 100644 src/odapt/_version.pyi diff --git a/src/odapt/_version.py b/src/odapt/_version.py new file mode 100644 index 0000000..dbc57e7 --- /dev/null +++ b/src/odapt/_version.py @@ -0,0 +1,17 @@ +# file generated by setuptools_scm +# don't change, don't track in version control +TYPE_CHECKING = False +if TYPE_CHECKING: + from typing import Tuple, Union + VERSION_TUPLE = Tuple[Union[int, str], ...] +else: + VERSION_TUPLE = object + +version: str +__version__: str +__version_tuple__: VERSION_TUPLE +version_tuple: VERSION_TUPLE + +__version__ = version = '0.1.dev8+g40315b5' +__version_tuple__ = version_tuple = (0, 1, 'dev8', 'g40315b5') + diff --git a/src/odapt/_version.pyi b/src/odapt/_version.pyi new file mode 100644 index 0000000..793ea98 --- /dev/null +++ b/src/odapt/_version.pyi @@ -0,0 +1,5 @@ +from __future__ import annotations + +version: str +version_tuple: tuple[int, int, int] | tuple[int, int, int, str, str] + From 69a0f3aa2a74b6d7250bd9217af9aeaaeb680874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Bilodeau?= Date: Fri, 20 Oct 2023 09:42:05 +0200 Subject: [PATCH 03/20] changing version again --- src/odapt/_version.py | 8 +++++--- src/odapt/_version.pyi | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/odapt/_version.py b/src/odapt/_version.py index dbc57e7..bdcbcac 100644 --- a/src/odapt/_version.py +++ b/src/odapt/_version.py @@ -1,8 +1,11 @@ # file generated by setuptools_scm # don't change, don't track in version control +from __future__ import annotations + TYPE_CHECKING = False if TYPE_CHECKING: from typing import Tuple, Union + VERSION_TUPLE = Tuple[Union[int, str], ...] else: VERSION_TUPLE = object @@ -12,6 +15,5 @@ __version_tuple__: VERSION_TUPLE version_tuple: VERSION_TUPLE -__version__ = version = '0.1.dev8+g40315b5' -__version_tuple__ = version_tuple = (0, 1, 'dev8', 'g40315b5') - +__version__ = version = "1.0.dev8+g40315b5" +__version_tuple__ = version_tuple = (1, 0, "dev8", "g40315b5") diff --git a/src/odapt/_version.pyi b/src/odapt/_version.pyi index 793ea98..91744f9 100644 --- a/src/odapt/_version.pyi +++ b/src/odapt/_version.pyi @@ -2,4 +2,3 @@ from __future__ import annotations version: str version_tuple: tuple[int, int, int] | tuple[int, int, int, str, str] - From cbc32b95a091fe10e3caf1938e70f14e371c38c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Bilodeau?= Date: Fri, 20 Oct 2023 09:44:47 +0200 Subject: [PATCH 04/20] changing version again --- src/odapt/_version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/odapt/_version.py b/src/odapt/_version.py index bdcbcac..7925ea2 100644 --- a/src/odapt/_version.py +++ b/src/odapt/_version.py @@ -15,5 +15,5 @@ __version_tuple__: VERSION_TUPLE version_tuple: VERSION_TUPLE -__version__ = version = "1.0.dev8+g40315b5" -__version_tuple__ = version_tuple = (1, 0, "dev8", "g40315b5") +__version__ = version = "1.0.2" +__version_tuple__ = version_tuple = (1, 0, 2) From 600391f336c5c74c2d6d8f8a562a6e155837770d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Bilodeau?= Date: Fri, 20 Oct 2023 09:49:47 +0200 Subject: [PATCH 05/20] changing version again --- src/odapt/_version.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/odapt/_version.py b/src/odapt/_version.py index 7925ea2..7f359c1 100644 --- a/src/odapt/_version.py +++ b/src/odapt/_version.py @@ -2,18 +2,18 @@ # don't change, don't track in version control from __future__ import annotations -TYPE_CHECKING = False -if TYPE_CHECKING: - from typing import Tuple, Union +# TYPE_CHECKING = False +# if TYPE_CHECKING: +# from typing import Tuple, Union - VERSION_TUPLE = Tuple[Union[int, str], ...] -else: - VERSION_TUPLE = object +# VERSION_TUPLE = Tuple[Union[int, str], ...] +# else: +# VERSION_TUPLE = object -version: str -__version__: str -__version_tuple__: VERSION_TUPLE -version_tuple: VERSION_TUPLE +# version: str +# __version__: str +# __version_tuple__: VERSION_TUPLE +# version_tuple: VERSION_TUPLE __version__ = version = "1.0.2" __version_tuple__ = version_tuple = (1, 0, 2) From 70640f99622be6657efcfbf58c36f35d9884c120 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Bilodeau?= Date: Fri, 20 Oct 2023 09:52:02 +0200 Subject: [PATCH 06/20] fixing version import --- src/odapt/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/odapt/__init__.py b/src/odapt/__init__.py index 8b7bd72..5e1880d 100644 --- a/src/odapt/__init__.py +++ b/src/odapt/__init__.py @@ -5,7 +5,7 @@ """ from __future__ import annotations -from odapt._version import VERSION as __version__ +from odapt._version import version as __version__ from odapt.operations import hadd # noqa: F401 __all__ = ["__version__"] From 7c2abbabc9d3d32f0d20b0e7795b064529059b2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Bilodeau?= Date: Fri, 20 Oct 2023 10:09:20 +0200 Subject: [PATCH 07/20] adjusting version again --- .gitignore | 2 +- src/odapt/__init__.py | 2 +- src/odapt/_version.py | 23 ++++------------------- src/odapt/_version.pyi | 4 ---- 4 files changed, 6 insertions(+), 25 deletions(-) delete mode 100644 src/odapt/_version.pyi diff --git a/.gitignore b/.gitignore index 34d7367..cdab210 100644 --- a/.gitignore +++ b/.gitignore @@ -138,7 +138,7 @@ dmypy.json cython_debug/ # # setuptools_scm -# src/*/_version.py +src/*/_version.py # ruff diff --git a/src/odapt/__init__.py b/src/odapt/__init__.py index 5e1880d..5d4bf0e 100644 --- a/src/odapt/__init__.py +++ b/src/odapt/__init__.py @@ -5,7 +5,7 @@ """ from __future__ import annotations -from odapt._version import version as __version__ +from odapt._version import __version__ from odapt.operations import hadd # noqa: F401 __all__ = ["__version__"] diff --git a/src/odapt/_version.py b/src/odapt/_version.py index 7f359c1..d201f68 100644 --- a/src/odapt/_version.py +++ b/src/odapt/_version.py @@ -1,19 +1,4 @@ -# file generated by setuptools_scm -# don't change, don't track in version control -from __future__ import annotations - -# TYPE_CHECKING = False -# if TYPE_CHECKING: -# from typing import Tuple, Union - -# VERSION_TUPLE = Tuple[Union[int, str], ...] -# else: -# VERSION_TUPLE = object - -# version: str -# __version__: str -# __version_tuple__: VERSION_TUPLE -# version_tuple: VERSION_TUPLE - -__version__ = version = "1.0.2" -__version_tuple__ = version_tuple = (1, 0, 2) +# This file is auto-generated by Hatchling. As such, do not: +# - modify +# - track in version control e.g. be sure to add to .gitignore +__version__ = VERSION = '1.0.2' diff --git a/src/odapt/_version.pyi b/src/odapt/_version.pyi deleted file mode 100644 index 91744f9..0000000 --- a/src/odapt/_version.pyi +++ /dev/null @@ -1,4 +0,0 @@ -from __future__ import annotations - -version: str -version_tuple: tuple[int, int, int] | tuple[int, int, int, str, str] From 426e0643b94440573712a92f7fcaf207b3eb908f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Bilodeau?= Date: Fri, 20 Oct 2023 10:12:00 +0200 Subject: [PATCH 08/20] last try adjusting version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 39b8fd3..d3b0943 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ classifiers = [ "Topic :: Scientific/Engineering", "Typing :: Typed", ] -dynamic = ["version"] + dependencies = ["numpy>=1.19.0", "uproot>=5.0.0"] [project.optional-dependencies] From b512fc131e70b52694e926ba755051640aa4c052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Bilodeau?= Date: Fri, 20 Oct 2023 10:13:03 +0200 Subject: [PATCH 09/20] last try adjusting version --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d3b0943..a6ddfa6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ classifiers = [ "Topic :: Scientific/Engineering", "Typing :: Typed", ] - +dynamic = ["version"] dependencies = ["numpy>=1.19.0", "uproot>=5.0.0"] [project.optional-dependencies] @@ -56,7 +56,7 @@ Changelog = "https://github.com/zbilodea/odapt/releases" [tool.hatch.version] -path = "src/odapt/_version.py" +path = "src/odapt/version.py" [tool.pytest.ini_options] From 94c1f90ae2f956879b237bcc578824ae4bf8fb39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Bilodeau?= Date: Fri, 20 Oct 2023 14:50:29 +0200 Subject: [PATCH 10/20] Altered versioning again - will build now --- _version.py | 16 ++++++++++++++++ pyproject.toml | 6 +++++- src/odapt/_version.py | 9 +++++---- src/odapt/operations/hadd.py | 37 ++++++++++++++++++++++++++++++++++++ 4 files changed, 63 insertions(+), 5 deletions(-) create mode 100644 _version.py diff --git a/_version.py b/_version.py new file mode 100644 index 0000000..b548edc --- /dev/null +++ b/_version.py @@ -0,0 +1,16 @@ +# file generated by setuptools_scm +# don't change, don't track in version control +TYPE_CHECKING = False +if TYPE_CHECKING: + from typing import Tuple, Union + VERSION_TUPLE = Tuple[Union[int, str], ...] +else: + VERSION_TUPLE = object + +version: str +__version__: str +__version_tuple__: VERSION_TUPLE +version_tuple: VERSION_TUPLE + +__version__ = version = '1.0.3.dev9+gb512fc1.d20231020' +__version_tuple__ = version_tuple = (1, 0, 3, 'dev9', 'gb512fc1.d20231020') diff --git a/pyproject.toml b/pyproject.toml index a6ddfa6..f5024af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = "_version.py" + +[tool.hatch.metadata.hooks.vcs] [tool.pytest.ini_options] minversion = "6.0" diff --git a/src/odapt/_version.py b/src/odapt/_version.py index d201f68..d427696 100644 --- a/src/odapt/_version.py +++ b/src/odapt/_version.py @@ -1,4 +1,5 @@ -# This file is auto-generated by Hatchling. As such, do not: -# - modify -# - track in version control e.g. be sure to add to .gitignore -__version__ = VERSION = '1.0.2' +# coding: utf-8 +# file generated by setuptools_scm +# don't change, don't track in version control +__version__ = version = '1.2.3' +__version_tuple__ = version_tuple = (1, 2, 3) \ No newline at end of file diff --git a/src/odapt/operations/hadd.py b/src/odapt/operations/hadd.py index f2bb792..fabf4d3 100644 --- a/src/odapt/operations/hadd.py +++ b/src/odapt/operations/hadd.py @@ -476,3 +476,40 @@ 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) + # \ No newline at end of file From 924b64331591c04eb71d2b0c7e03adc2b90a6d76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Bilodeau?= Date: Fri, 20 Oct 2023 14:54:39 +0200 Subject: [PATCH 11/20] Formatting fixes --- _version.py | 7 +++- src/odapt/_version.py | 7 ++-- src/odapt/operations/hadd.py | 73 ++++++++++++++++++------------------ 3 files changed, 46 insertions(+), 41 deletions(-) diff --git a/_version.py b/_version.py index b548edc..68b8492 100644 --- a/_version.py +++ b/_version.py @@ -1,8 +1,11 @@ # file generated by setuptools_scm # don't change, don't track in version control +from __future__ import annotations + TYPE_CHECKING = False if TYPE_CHECKING: from typing import Tuple, Union + VERSION_TUPLE = Tuple[Union[int, str], ...] else: VERSION_TUPLE = object @@ -12,5 +15,5 @@ __version_tuple__: VERSION_TUPLE version_tuple: VERSION_TUPLE -__version__ = version = '1.0.3.dev9+gb512fc1.d20231020' -__version_tuple__ = version_tuple = (1, 0, 3, 'dev9', 'gb512fc1.d20231020') +__version__ = version = "1.0.3.dev9+gb512fc1.d20231020" +__version_tuple__ = version_tuple = (1, 0, 3, "dev9", "gb512fc1.d20231020") diff --git a/src/odapt/_version.py b/src/odapt/_version.py index d427696..f0f29e7 100644 --- a/src/odapt/_version.py +++ b/src/odapt/_version.py @@ -1,5 +1,6 @@ -# coding: utf-8 # file generated by setuptools_scm # don't change, don't track in version control -__version__ = version = '1.2.3' -__version_tuple__ = version_tuple = (1, 2, 3) \ No newline at end of file +from __future__ import annotations + +__version__ = version = "1.2.3" +__version_tuple__ = version_tuple = (1, 2, 3) diff --git a/src/odapt/operations/hadd.py b/src/odapt/operations/hadd.py index fabf4d3..86c021d 100644 --- a/src/odapt/operations/hadd.py +++ b/src/odapt/operations/hadd.py @@ -477,39 +477,40 @@ def main(): 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) - # \ No newline at end of file + +# 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) +# # From 72b588be59a7046d379479619b186ea2e4bd8eb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Bilodeau?= Date: Fri, 20 Oct 2023 15:03:31 +0200 Subject: [PATCH 12/20] last fixes for version --- _version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_version.py b/_version.py index 68b8492..2f83b6f 100644 --- a/_version.py +++ b/_version.py @@ -15,5 +15,5 @@ __version_tuple__: VERSION_TUPLE version_tuple: VERSION_TUPLE -__version__ = version = "1.0.3.dev9+gb512fc1.d20231020" -__version_tuple__ = version_tuple = (1, 0, 3, "dev9", "gb512fc1.d20231020") +__version__ = version = "1.0.3.dev11+g924b643" +__version_tuple__ = version_tuple = (1, 0, 3, "dev11", "g924b643") From f1570a383ad50a9ba750984332b2438b5422f304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Bilodeau?= Date: Fri, 20 Oct 2023 15:13:47 +0200 Subject: [PATCH 13/20] formatting error --- src/odapt/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/odapt/__init__.py b/src/odapt/__init__.py index 5d4bf0e..5e1880d 100644 --- a/src/odapt/__init__.py +++ b/src/odapt/__init__.py @@ -5,7 +5,7 @@ """ from __future__ import annotations -from odapt._version import __version__ +from odapt._version import version as __version__ from odapt.operations import hadd # noqa: F401 __all__ = ["__version__"] From 4686c221621787a19a7252fc96e7ec13e3a830ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Bilodeau?= Date: Fri, 20 Oct 2023 15:27:57 +0200 Subject: [PATCH 14/20] version --- .gitignore | 2 +- _version.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index cdab210..20910f4 100644 --- a/.gitignore +++ b/.gitignore @@ -139,7 +139,7 @@ cython_debug/ # # setuptools_scm src/*/_version.py - +_version.py # ruff .ruff_cache/ diff --git a/_version.py b/_version.py index 2f83b6f..ff86ea6 100644 --- a/_version.py +++ b/_version.py @@ -15,5 +15,5 @@ __version_tuple__: VERSION_TUPLE version_tuple: VERSION_TUPLE -__version__ = version = "1.0.3.dev11+g924b643" -__version_tuple__ = version_tuple = (1, 0, 3, "dev11", "g924b643") +__version__ = version = "1.0.3.dev13+gf1570a3.d20231020" +__version_tuple__ = version_tuple = (1, 0, 3, "dev13", "gf1570a3.d20231020") From c83b5da021ba9fc0f7a429115f9a56608ba83b80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Bilodeau?= Date: Fri, 20 Oct 2023 15:35:26 +0200 Subject: [PATCH 15/20] another version edit --- _version.py | 7 ++----- src/odapt/__init__.py | 4 ++-- src/odapt/_version.py | 6 ------ 3 files changed, 4 insertions(+), 13 deletions(-) delete mode 100644 src/odapt/_version.py diff --git a/_version.py b/_version.py index ff86ea6..ef0e46f 100644 --- a/_version.py +++ b/_version.py @@ -1,11 +1,8 @@ # file generated by setuptools_scm # don't change, don't track in version control -from __future__ import annotations - TYPE_CHECKING = False if TYPE_CHECKING: from typing import Tuple, Union - VERSION_TUPLE = Tuple[Union[int, str], ...] else: VERSION_TUPLE = object @@ -15,5 +12,5 @@ __version_tuple__: VERSION_TUPLE version_tuple: VERSION_TUPLE -__version__ = version = "1.0.3.dev13+gf1570a3.d20231020" -__version_tuple__ = version_tuple = (1, 0, 3, "dev13", "gf1570a3.d20231020") +__version__ = version = '1.0.3.dev14+g4686c22.d20231020' +__version_tuple__ = version_tuple = (1, 0, 3, 'dev14', 'g4686c22.d20231020') diff --git a/src/odapt/__init__.py b/src/odapt/__init__.py index 5e1880d..353884b 100644 --- a/src/odapt/__init__.py +++ b/src/odapt/__init__.py @@ -5,7 +5,7 @@ """ from __future__ import annotations -from odapt._version import version as __version__ +# from odapt._version import __version__ from odapt.operations import hadd # noqa: F401 -__all__ = ["__version__"] +# __all__ = ["__version__"] diff --git a/src/odapt/_version.py b/src/odapt/_version.py deleted file mode 100644 index f0f29e7..0000000 --- a/src/odapt/_version.py +++ /dev/null @@ -1,6 +0,0 @@ -# file generated by setuptools_scm -# don't change, don't track in version control -from __future__ import annotations - -__version__ = version = "1.2.3" -__version_tuple__ = version_tuple = (1, 2, 3) From 9b4b311b7b0548b4484a8745ca5d9548ebf6f319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Bilodeau?= Date: Fri, 20 Oct 2023 15:37:28 +0200 Subject: [PATCH 16/20] another version edit --- _version.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/_version.py b/_version.py index ef0e46f..1dbec65 100644 --- a/_version.py +++ b/_version.py @@ -1,8 +1,11 @@ # file generated by setuptools_scm # don't change, don't track in version control +from __future__ import annotations + TYPE_CHECKING = False if TYPE_CHECKING: from typing import Tuple, Union + VERSION_TUPLE = Tuple[Union[int, str], ...] else: VERSION_TUPLE = object @@ -12,5 +15,5 @@ __version_tuple__: VERSION_TUPLE version_tuple: VERSION_TUPLE -__version__ = version = '1.0.3.dev14+g4686c22.d20231020' -__version_tuple__ = version_tuple = (1, 0, 3, 'dev14', 'g4686c22.d20231020') +__version__ = version = "1.0.3.dev14+g4686c22.d20231020" +__version_tuple__ = version_tuple = (1, 0, 3, "dev14", "g4686c22.d20231020") From c46f551355b4787494cd237607367e0939306c4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Bilodeau?= Date: Fri, 20 Oct 2023 15:41:47 +0200 Subject: [PATCH 17/20] version --- src/odapt/__init__.py | 4 ++-- src/odapt/_version.pyi | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 src/odapt/_version.pyi diff --git a/src/odapt/__init__.py b/src/odapt/__init__.py index 353884b..5d4bf0e 100644 --- a/src/odapt/__init__.py +++ b/src/odapt/__init__.py @@ -5,7 +5,7 @@ """ from __future__ import annotations -# from odapt._version import __version__ +from odapt._version import __version__ from odapt.operations import hadd # noqa: F401 -# __all__ = ["__version__"] +__all__ = ["__version__"] diff --git a/src/odapt/_version.pyi b/src/odapt/_version.pyi new file mode 100644 index 0000000..91744f9 --- /dev/null +++ b/src/odapt/_version.pyi @@ -0,0 +1,4 @@ +from __future__ import annotations + +version: str +version_tuple: tuple[int, int, int] | tuple[int, int, int, str, str] From 2fb2ee86fcbed70d54740c339e0b1dff31ea0fe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Bilodeau?= Date: Fri, 20 Oct 2023 16:34:10 +0200 Subject: [PATCH 18/20] version --- _version.py | 19 ------------- src/odapt/operations/hadd.py | 54 ++++++++++++++++++------------------ tests/test_hadd.py | 2 +- 3 files changed, 28 insertions(+), 47 deletions(-) delete mode 100644 _version.py diff --git a/_version.py b/_version.py deleted file mode 100644 index 1dbec65..0000000 --- a/_version.py +++ /dev/null @@ -1,19 +0,0 @@ -# file generated by setuptools_scm -# don't change, don't track in version control -from __future__ import annotations - -TYPE_CHECKING = False -if TYPE_CHECKING: - from typing import Tuple, Union - - VERSION_TUPLE = Tuple[Union[int, str], ...] -else: - VERSION_TUPLE = object - -version: str -__version__: str -__version_tuple__: VERSION_TUPLE -version_tuple: VERSION_TUPLE - -__version__ = version = "1.0.3.dev14+g4686c22.d20231020" -__version_tuple__ = version_tuple = (1, 0, 3, "dev14", "g4686c22.d20231020") diff --git a/src/odapt/operations/hadd.py b/src/odapt/operations/hadd.py index 86c021d..88e5277 100644 --- a/src/odapt/operations/hadd.py +++ b/src/odapt/operations/hadd.py @@ -478,39 +478,39 @@ def main(): ) -# 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") +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 + #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) + # Get keys + t1_keys = ttree1.keys(recursive=True) + t2_keys = ttree2.keys(recursive=True) -# all_keys = np.union1d(t1_keys, t2_keys) + 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 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 : + # for t2_key in t2_keys: + if : -# merge_inputs() + merge_inputs() -# # Check if histograms + # 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) -# # + 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) + # diff --git a/tests/test_hadd.py b/tests/test_hadd.py index 7e5f825..7928628 100644 --- a/tests/test_hadd.py +++ b/tests/test_hadd.py @@ -8,7 +8,7 @@ import odapt as od -ROOT = pytest.importorskip("pyarrow") +ROOT = pytest.importorskip("ROOT") def write_root_file(hist, path): From 10d639b7ad84b84bb01291d4efee19dbefc4e30c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Bilodeau?= Date: Fri, 20 Oct 2023 16:35:53 +0200 Subject: [PATCH 19/20] version --- src/odapt/operations/hadd.py | 54 ++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/odapt/operations/hadd.py b/src/odapt/operations/hadd.py index 88e5277..86c021d 100644 --- a/src/odapt/operations/hadd.py +++ b/src/odapt/operations/hadd.py @@ -478,39 +478,39 @@ def main(): ) -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") +# 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 +# #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) +# # Get keys +# t1_keys = ttree1.keys(recursive=True) +# t2_keys = ttree2.keys(recursive=True) - all_keys = np.union1d(t1_keys, t2_keys) +# 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 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 : +# # for t2_key in t2_keys: +# if : - merge_inputs() +# merge_inputs() - # Check if histograms +# # 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) - # +# 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) +# # From e773a3af36c3abedb42eb5d35a04352fb8023d2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Bilodeau?= Date: Fri, 20 Oct 2023 16:59:28 +0200 Subject: [PATCH 20/20] version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f5024af..b9b29f8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,7 +59,7 @@ Changelog = "https://github.com/zbilodea/odapt/releases" source = "vcs" [tool.hatch.build.hooks.vcs] -version-file = "_version.py" +version-file = "src/odapt/_version.py" [tool.hatch.metadata.hooks.vcs]